Commit graph

75098 commits

Author SHA1 Message Date
Ben Wiederhake
feb465ca7f AK: Remove unused include from OptionParser 2026-02-17 12:38:51 +00:00
Ben Wiederhake
aeaa68c6fa AK: Remove unused include from NumberFormat 2026-02-17 12:38:51 +00:00
Ben Wiederhake
5459f882e9 AK: Remove unused include from MemoryStream 2026-02-17 12:38:51 +00:00
Ben Wiederhake
9d073e4d8d AK: Remove unused include from Hex 2026-02-17 12:38:51 +00:00
Ben Wiederhake
12cac43cff AK: Remove unused include from Format 2026-02-17 12:38:51 +00:00
Ben Wiederhake
a6dd6bfe5a AK: Remove unused include from CircularBuffer 2026-02-17 12:38:51 +00:00
Ben Wiederhake
b13df3a426 AK: Remove unused include from ByteStringImpl 2026-02-17 12:38:51 +00:00
Ben Wiederhake
dab83d35d1 AK: Remove unused include from ByteString 2026-02-17 12:38:51 +00:00
Ben Wiederhake
8f59397dd1 AK: Remove unused include from Base64 2026-02-17 12:38:51 +00:00
Callum Law
6d73a3e85f LibWeb: Parse @font-feature-values at-rule
We don't yet support the `font-display` descriptor as part of this
2026-02-17 12:25:27 +00:00
Callum Law
d998a0aeeb LibWeb: Add generic string_from_style_value method
Reduces duplication in line with `Time::from_style_value()`,
`Angle::from_style_value()` etc
2026-02-17 12:25:27 +00:00
Callum Law
784911fb6d LibWeb: Implement CSSFontFeatureValuesRule 2026-02-17 12:25:27 +00:00
Callum Law
fcdc05a4ee LibWeb: Implement CSSFontFeatureValuesMap
This will be used within `CSSFontFeatureValuesRule`
2026-02-17 12:25:27 +00:00
Callum Law
3f8da74e63 LibIDL+Meta: Add support for WebIDL maplike declarations on interfaces
Currently we only support string keys and numeric sequence values.

This is heavily based on the implementation of `setlike`.
2026-02-17 12:25:27 +00:00
Callum Law
6294fb1f7a LibJS: Mark MapIterator for export 2026-02-17 12:25:27 +00:00
Callum Law
f36d0407ec Tests: Import some @font-feature-values tests 2026-02-17 12:25:27 +00:00
Jelle Raaijmakers
d5173fe6ca LibWeb: Inflate range rect by font ascenders/descenders
Chrome and Firefox inflate this rect to accommodate for the font's
ascenders and descenders, while the absolute rect for the fragment
remains unaffected. This fixes ascenders/descenders in text being
clipped when selecting text.
2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
819bfa11ec LibWeb: Simplify primary offset translation in ::range_rect()
No functional changes.
2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
8b32456473 LibWeb: Use explicit CSSPixels(float) constructor in ::range_rect()
No functional changes.
2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
f831534589 LibWeb: Add explanatory comment to ::range_rect() on trailing whitespace 2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
d2ad917fbc LibWeb: Simplify PaintableFragment::absolute_rect()
We can pass in offset() immediately. No functional changes.
2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
d37691a0d4 LibGfx: Add Rect<T>::inflate_primary/secondary_for_orientation()
This mirrors the 2-param `::inflate(T, T)` method but allows for passing
in an orientation.
2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
8654e2caf4 LibWeb: Apply letter-spacing for selection rects and grapheme bounds
Fixes the selection rect on the title text of https://modern-css.com/
being misaligned with the actual characters.
2026-02-17 10:51:48 +01:00
Jelle Raaijmakers
ded42e649b LibWeb: Do not scroll cursor into view on programmatic selection changes
We were mimicking Firefox' behavior that whenever a programmatic change
to an <input>'s or <textarea>'s selection happened, the new selection
focus is brought into view by scrolling. Currently we run a layout
update synchronously for that to make sure we have the fragment's
correct dimensions, which caused a significant performance regression in
Speedometer.

Since this is non-standard behavior, let's mimic Chromium instead which
does not scroll at all - only for direct user initiated input such as
typing.

Relevant issues:

* https://github.com/whatwg/html/issues/6217
* https://bugzilla.mozilla.org/show_bug.cgi?id=232405
* https://issues.chromium.org/issues/41081857
2026-02-17 10:24:00 +01:00
Jelle Raaijmakers
fa04c8db83 LibWeb: Move needs_layout_tree_rebuild to just before we use it
No functional changes.
2026-02-17 10:24:00 +01:00
Andreas Kling
19bf3f9479 LibJS: Use a forward cursor for source map lookup during compilation
The find_source_record lambda was doing a reverse linear scan through
the entire source map for every instruction emitted, resulting in
quadratic behavior. This was catastrophic for large scripts like
Octane/mandreel.js, where compile() dominated the profile at ~30s.

Since both source map entries and instruction iteration are ordered by
offset, replace the per-instruction scan with a forward cursor that
advances in lockstep with instruction emission.
2026-02-16 20:41:02 +01:00
Aliaksandr Kalenik
3c73457b26 LibWeb: Implement CSS Grid dense packing and fix span placement
Implement the `dense` keyword for `grid-auto-flow` so auto-placed items
backfill earlier gaps in the grid. The sparse/dense cursor logic is now
centralized in `place_grid_items()` step 4: dense resets the cursor to
the grid start before each search, while sparse keeps advancing forward.

Also fix a pre-existing bug where `find_unoccupied_place()` and several
placement helpers only checked if a single cell was unoccupied, ignoring
multi-cell spans. Add `OccupationGrid::is_area_occupied()` and use it
throughout to correctly verify the entire rectangular area is available.
2026-02-16 20:00:17 +01:00
Jelle Raaijmakers
aa2a95c775 LibWeb: Pass through background image painting even if area is empty
We should decide at a later stage, when we've calculated the final
background painting area, whether that area is empty and we can skip
painting the background.

Fixes #7973
2026-02-16 19:33:01 +01:00
Shannon Booth
b835e5cbda LibWeb/HTML: Remove uneeded indexed property functionality on Storage
With the bug in the previous commit fixed, we no longer need these
helpers to support JS like:

localStorage[1] = "my value";
2026-02-16 18:49:15 +01:00
Shannon Booth
1a3a775943 LibWeb: Treat numeric PropertyKeys as Strings per spec in PlatformObject
PropertyKey values can only be String or Symbol per spec; numeric keys
are an internal optimization and should be treated as Strings.

This fixes incorrect behavior for numeric property names on legacy
platform objects (e.g. Web Storage).
2026-02-16 18:49:15 +01:00
Shannon Booth
a0d4344d4e Tests/LibWeb: Import some more webstorage WPT tests
Which were helpful in determining property behaviour for the Storage
object.
2026-02-16 18:49:15 +01:00
Shannon Booth
e859402ea1 LibJS: Remove duplicate property_key_to_value helper function
An equivalent already exists as a member of PropertyKey.
2026-02-16 18:49:15 +01:00
Shannon Booth
7015a5fae2 LibWeb/Bindings: Fix link for legacy platform object [[GetOwnProperty]]
The previous link was dead, probably from a spec rename.
2026-02-16 18:49:15 +01:00
Psychpsyo
68f27e9bbc LibWeb: Don't select text when multi-clicking user-select:none node 2026-02-16 15:57:55 +01:00
Luke Wilde
0e958ca8d5 LibWebView+UI/AppKit: Present IOSurfaces directly
Instead of copying the Bitmap that wraps the IOSurface, we can just
present the IOSurface directly. This significantly reduces CPU usage in
the UI process, particularly at high refresh rates such as 120Hz where
it would saturate a full CPU core.

This is done by using CAMetalLayer and blitting the IOSurface to the
next drawable buffer, which handles triple buffering, locking the
IOSurface and vsync automatically. This also allows the Metal HUD to
work, but the only accurate stat is the frame intervals/FPS because
it's in the UI layer, not WebContent. However, that's still useful
to detect frame drops.
2026-02-16 14:57:17 +00:00
aplefull
aeec2c804c LibRegex: Implement Unicode case-insensitive matching
Previously, case-insensitive regex matching used ASCII-only case
conversion (to_ascii_lowercase) even for Unicode characters.

Now we implement Canonicalize abstract operation, so we can case-fold
Unicode characters properly during case-insensitive matching.
2026-02-16 07:51:00 -05:00
aplefull
e1682424aa LibUnicode: Add Unicode case folding support for regex matching 2026-02-16 07:51:00 -05:00
Ben Wiederhake
2085bdc361 Documentation: Add missing parent for AK/
Without this includedir, files like AK/Debug.h cannot be resolved.
2026-02-16 13:21:42 +01:00
Callum Law
9f7f623455 LibWeb: Store FilterOperation::DropShadow sub-values as StyleValues
This simplifies handling and brings it into line with other `StyleValue`
types
2026-02-16 12:09:23 +00:00
Callum Law
98e62cf86a LibWeb: Store FilterOperation::Blur::radius as StyleValue
This simplifies handling and brings it into line with other `StyleValue`
types
2026-02-16 12:09:23 +00:00
Callum Law
caa5705edf LibWeb: Clamp blur() calculated values 2026-02-16 12:09:23 +00:00
Callum Law
c529614e67 LibWeb: Store FilterOperation::HueRotate::angle as StyleValue
This simplifies handling and brings it into line with other `StyleValue`
types
2026-02-16 12:09:23 +00:00
Callum Law
68c596942c LibWeb: Store FilterOperation::Color::amount as StyleValue
This simplifies handling and means we now support tree counting
functions.
2026-02-16 12:09:23 +00:00
Callum Law
2c4db0da7e LibWeb: Clamp calculated filter color() amounts by context
This brings us in line with other properties/values and simplifies
handling of non-calculated values
2026-02-16 12:09:23 +00:00
Callum Law
e410efcfb7 LibWeb: Absolutize parsed canvas filter value 2026-02-16 12:09:23 +00:00
Callum Law
79dbca29ee LibWeb: Correctly serialize filter url() value
Previously we would have two closing parentheses when serializing a
`url()` within a `FilterValueListStyleValue`
2026-02-16 12:09:23 +00:00
Callum Law
cd799aa7e7 LibWeb: Forward declare CSS::FilterOperation structs
This means we don't need to include `FilterValueListStyleValue.h` in as
many places - reducing the rebuild from editing that file from 717 files
to 19.
2026-02-16 12:09:23 +00:00
Callum Law
3d3d0a50b6 LibWeb: Add generic Length::from_style_value method 2026-02-16 12:09:23 +00:00
Callum Law
846493831d LibWeb: Add generic number_from_style_value method 2026-02-16 12:09:23 +00:00
Psychpsyo
30c1f2f938 LibWeb: Do not re-target hits to fragments with user-select:none
This makes text selection more usable around them, as demonstrated in
the added test case.
2026-02-16 08:39:28 +01:00