Commit graph

10 commits

Author SHA1 Message Date
Callum Law
b1801c0bc9 LibWeb: Avoid crash evaluating media query in document lacking window
In some cases a document may lack an associated window - to fix this for
now we just return false but perhaps there are some media queries we
should still attempt to resolve.
2025-10-17 18:24:59 +02:00
Callum Law
2af071380e LibWeb: Dont load a style sheet's fonts until it has an owning document
We need a style sheet to have an owning document to load it's fonts (to
generate a length resolution context).

Fixes #6445
2025-10-16 10:27:32 +01:00
Callum Law
3708fc6aa7 LibWeb: Resolve relative lengths in @font-face using correct viewport
As with everywhere else we should be using the document rather than the
window's viewports.

Fixes #6467
2025-10-16 10:27:32 +01:00
Callum Law
2c7b56511b LibWeb: Add absolutized method to CounterDefinitionsStyleValue
This avoids a crash when a counter value relies on relative units
2025-10-07 10:50:01 +01:00
Callum Law
eeb3890ad7 LibWeb: Resolve stroke-dasharray percentages as lengths
Fixes a crash on https://collabskus.github.io/
2025-10-07 10:19:26 +01:00
Callum Law
d69e62425e LibWeb: Resolve CSS-wide keywords in keyframe properties
Also resolves the `revert` keyword against longhand properties rather
than potential shorthands as this could cause a crash.

Gains us 20 WPT tests.
2025-08-27 14:50:58 +02:00
Callum Law
a70a397501 LibWeb: Support percentages in word-spacing
Fixes crash in the created test as well as https://wpt.live/css/css-text
/word-spacing/reference/word-spacing-percent-001-ref.html. The WPT test
hasn't been imported as it passing is currently a false-positive due to
the fact that we don't yet respect `word-spacing` in most cases.
2025-08-05 11:43:55 +01:00
Tim Ledbetter
40760308c6 LibWeb: Don't crash when border-spacing is set to a calc() value
Previously, the browser would crash if the `border-spacing` property
had 2 lengths and either one of these was set to a `calc()` value.
2025-03-21 08:16:30 +00:00
Andreas Kling
5f10f8c54c LibWeb: Do includes_properties_from_invalidation_set() for :link & co
Fixes #3511.
2025-02-09 15:20:53 +01:00
Andreas Kling
4f855286d7 LibWeb: Clamp layout content sizes to a max value instead of crashing
We've historically asserted that no "saturated" size values end up as
final metrics for boxes in layout. This always had a chance of producing
false positives, since you can trivially create extremely large boxes
with CSS.

The reason we had those assertions was to catch bugs in our own engine
code where we'd incorrectly end up with non-finite values in layout
algorithms. At this point, we've found and fixed all known bugs of that
nature, and what remains are a bunch of false positives on pages that
create very large scrollable areas, iframes etc.

So, let's change it! We now clamp content width and height of boxes to
17895700 pixels, apparently the same cap as Firefox uses.

There's also the issue of calc() being able to produce non-finite
values. Note that we don't clamp the result of calc() directly, but
instead just clamp values when assigning them to content sizes.

Fixes #645.
Fixes #1236.
Fixes #1249.
Fixes #1908.
Fixes #3057.
2025-02-05 18:28:55 +01:00