Commit graph

46108 commits

Author SHA1 Message Date
Linus Groh
ef389c086d LibJS: Port parse_temporal_calendar_string()
Also make is_builtin_calendar() take a StringView as part of this, it
only does equality checks.
2023-01-26 20:20:54 +00:00
Linus Groh
8f7c2f8292 LibJS: Port get_difference_settings() to String
Also make balance_duration() take a StringView as part of this, it only
does equality checks.
2023-01-26 20:20:54 +00:00
Linus Groh
227379a1da LibJS: Port prepare_temporal_fields() and calendar_fields() to String 2023-01-26 20:20:54 +00:00
Linus Groh
90a1de564c LibJS: Make parse_temporal_*_string() take a StringView
The underlying parse_iso8601() function already does this as well.
2023-01-26 20:20:54 +00:00
Linus Groh
82ba940646 LibJS: Port format_seconds_string_part() to String 2023-01-26 20:20:54 +00:00
Linus Groh
654911444e LibJS: Port merge_largest_unit_option() to String 2023-01-26 20:20:54 +00:00
Linus Groh
918122c1e3 LibJS: Port get_temporal_unit() to String 2023-01-26 20:20:54 +00:00
Linus Groh
f928c7754d LibJS: Port to_show_offset_option() to String 2023-01-26 20:20:54 +00:00
Linus Groh
ddd5d8531b LibJS: Port to_time_zone_name_option() to String 2023-01-26 20:20:54 +00:00
Linus Groh
0435156a86 LibJS: Port to_calendar_name_option() to String 2023-01-26 20:20:54 +00:00
Linus Groh
a387b22599 LibJS: Port to_temporal_offset() to String 2023-01-26 20:20:54 +00:00
Linus Groh
3aa3ab65b1 LibJS: Port to_temporal_rounding_mode() to String
Also make negate_temporal_rounding_mode() take a StringView as part of
this, it only does equality checks.
2023-01-26 20:20:54 +00:00
Linus Groh
ec9f2013c9 LibJS: Port to_temporal_disambiguation() to String 2023-01-26 20:20:54 +00:00
Linus Groh
b8759e86ee LibJS: Port to_temporal_overflow() to String 2023-01-26 20:20:54 +00:00
Nico Weber
1044844307 LibGfx: Enforce type of 'cprt' and 'desc' type in v4 files
Add a targeted quirk for the one known file where this is violated.

Adding that quirk is a bit of a bummer, since that means all client
code of this class now needs to deal with the possibility that
'cprt' and 'desc' aren't 'mluc' for v4 files. But if that code wants
to handle v2 files, it needs to deal with that anyways, so it's
really just a bit of a bummer and not more.
2023-01-26 17:38:17 +00:00
Nico Weber
4daa9aeb57 LibGfx: Check the types of tags in ICCProfile
This adds checking for all tags where ICCProfile can parse the type.
Over time, more of this needs implementing -- at least lut8Type,
lut16Type, lutAToBType, and lutBToAType, since these are used by
required tags.

What _is_ checked for the most part matches the spec, but it's possible
that the spec text is aspirational and that profiles in the wild don't
fully match it.

I've run the current checks against these profiles:

    find \
        ~/src/Compact-ICC-Profiles \
        /{System/,}Library/ColorSync \
        -name '*.icc' \
        -exec echo {} \; \
        -exec Build/lagom/icc {} \;

...and against 3 hand-selected icc files I locally extracted from jpegs.

This identified 3 cases where the spec text is too strict for reality.
I added comments for these for now. Eventually, I'd like to try to still
enforce these types, and have a profile-id-based quirks list for which
they aren't enforced. It's possible that that won't be feasible, but
it's probably better to start out to strict and then relax over time
than the other way round.
2023-01-26 17:38:17 +00:00
Nico Weber
4735397606 icc: Align "else" for Type3 with "if" 2023-01-26 17:38:17 +00:00
Nico Weber
0d94e23039 icc: Indent ParametricCurveTagData the same amount as the other types 2023-01-26 17:38:17 +00:00
Linus Groh
2ff989914d LibJS: Make Value::typeof() return a StringView 2023-01-26 17:26:31 +00:00
Sam Atkins
3cc376d1a2 LibWebView: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
d8fde14324 LibWeb: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
4dac287aa5 LibTest: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
783251b98a LibSymbolication: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
6ee68d6e45 LibKeyboard: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
2fce19a451 LibGUI: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
4313c17d95 LibDesktop: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
04b3908172 LibDebug: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
08f932259a LibCoreDump: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
269ce258b4 LibCore: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
d55f763fcd Tests: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Sam Atkins
ad9b2043dd CodeGenerators: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
Tim Ledbetter
77e15ff4da PixelPaint: Let the move tool optionally select the active layer
Previously, the move tool would always select the topmost layer before
performing a move operation. This commit adds an option for the move
tool to always select the active layer, even if it is behind another.
2023-01-26 14:00:14 +01:00
Andreas Kling
16eca649f1 LibWeb: Use available space in FFC remaining space calculations
We were incorrectly using the inner main size of the flex container
instead of the avilable space in some parts of the remaining space
calculation. This meant that the algorithm only worked correctly
for definite available space in the main axis.
2023-01-26 12:34:56 +01:00
Andreas Kling
5c13631625 LibWeb: Use available_inner_space_or_constraints_from() for flex items 2023-01-26 12:34:56 +01:00
Andreas Kling
61d65294fa LibWeb: Always pass some available space to flex item fit-content sizing
Same deal as flex item intrinsic sizing: if we have definite size for
the item, use that, otherwise fall back to the available space.
2023-01-26 12:34:56 +01:00
Andreas Kling
0bbc54c200 LibWeb: Always pass *some* available width to flex item intrinsic sizing
If we have determined a definite width for the item, we can use that.
Otherwise, use the "space available for items" width as available width.
2023-01-26 12:34:56 +01:00
Andreas Kling
1ea276bf6d LibWeb: Take used width into account for flex item intrinsic heights
If we've already established the used width for a flex item, we need
to take it into account when calculating the min-content and max-content
heights for that item.

We were already doing this when calculating cross sizes. This patch adds
the same consideration for main sizes.
2023-01-26 12:34:56 +01:00
Aliaksandr Kalenik
00f8b5a911 LibWeb: Ignore only anonymous blocks in block auto height calculation
Previously block auto height calculation was changed to skip boxes with
collapsed margins and then condition to skip anonymous boxes with no
lines was also removed in 6c5ba10bb0 to
avoid skipping anonymous wrappers of tables.

Skipping boxes with collapsed margins (currently it's check that
height is 0) is wrong because it makes empty boxes with clearance to
be skipped which is not correct while anonymous boxes with no lines
should be skipped and it's no longer causes problems with tables
(fixed in 87f0e835eb)
2023-01-26 12:34:29 +01:00
Aliaksandr Kalenik
6eb2f4bfee LibWeb: Fix reset of floats y offset
Commit 7dc0edcb86 was supposed to prevent
floats from being placed higher than preceding boxes but the change
turned out to be completely wrong and caused regressions because:
1. Call to `clear()` in `layout_block_level_children` would reset
   floating boxes only after layout of box with _not_ inline children
although the same should happen after layout of IFC.
2. `clear()` causes offset y of floats to be reset but it also clears
   all currently enocuntered floating boxes which means the next box
   that has actual clearance will get wrong y position.
2023-01-26 12:34:29 +01:00
Timothy Flynn
66f98237a7 LibSQL: Don't interpret AK::Error codes as SQL error codes
This makes error invocations such as Error::from_string_literal become
associated with a SQLErrorCode (typically 0, AmbiguousColumnName). The
result, when displayed to the user, is quite confusing, e.g.:

    Column name 'Heap()::write_block(): Oversized block' is ambiguous

Instead, just interpret these as internal errors, so the error message
is displayed as-is.
2023-01-26 10:43:30 +00:00
Torstennator
452285a3f8 PixelPaint: Add a GradientTool
This patch adds a new gradient tool to pixelpaint that allows us to fill
the canvas with a smooth color gradient outline at the edge of the
filled area.
2023-01-26 10:37:26 +00:00
Torstennator
e7ceaf8a6d LibGfx: Add small convenience functions for Lines and AA Painter
This patch adds the following some convenience functions:
- Lines do now support rotated(), scaled() and translated()
- AntiAliasingPainter has now a draw_line function that takes a
  FloatLine as argument
2023-01-26 10:37:26 +00:00
konrad
95c469ca4c Kernel: Move Aarch64 MMU debug message into memory manager initializer
Doing so unifies startup debug messages visually.
2023-01-25 23:17:36 +01:00
konrad
e1c50b83e1 Kernel: Use RDSEED assembly snippet to seed RNG on Aarch64
There’s similar RDRAND register (encoded as ‘s3_3_c2_c4_0ʼ) to be
added if needed. RNG CPU feature on Aarch64 guarantees existence of both
RDSEED and RDRAND registers simultaneously—in contrast to x86-64, where
respective instructions are independent of each other.
2023-01-25 23:17:36 +01:00
konrad
7c8e61f4d1 Kernel: Unify x86-64 assembly snippets naming for RDSEED & RDRAND 2023-01-25 23:17:36 +01:00
konrad
d7d233ab04 Kernel: Use existing assembly snippets for x86-64 RDSEED & RDRAND calls 2023-01-25 23:17:36 +01:00
Nico Weber
cb4cbe3ae8 LibGfx: Fix typo in name of DeviceClass::InputDevice 2023-01-25 20:24:34 +00:00
Nico Weber
29e72bf381 LibGfx: Add checking for required tags to ICCProfile 2023-01-25 20:24:34 +00:00
Rodrigo Tobar
3588709986 LibPDF: Load Type1C fonts when found
Now that our CFF parser is working we can load Type1C fonts in PDF,
which are backed by a CFF stream.
2023-01-25 15:40:11 +01:00
Rodrigo Tobar
c4b45a82cd LibPDF: Add initial CFF parsing
The Compat Font Format specification (Adobe's Technical Note #5176) is
used by PDF's Type1C fonts to store their data. While being similar in
spirit to PS1 Type 1 Font Programs, it was designed for a more compact
representation and thus space reduction (but an increment on
complexity). It also shares most of the charstring encoding logic, which
is why the CFF class also inherits from Type1FontProgram.

This initial implementation is still lacking many details, e.g.:

 * It doesn't include all the built-in CFF SIDs
 * It doesn't support CFF-provided SIDs (defaults those glyphs to the
   space character)
 * More checks in general
2023-01-25 15:40:11 +01:00