Commit graph

1712 commits

Author SHA1 Message Date
Sam Atkins
b3e53b0bd2 LibWeb/CSS: Stop stripping whitespace from stroke properties 2025-11-03 11:23:21 +00:00
Sam Atkins
fccddca498 LibWeb/CSS: Stop stripping whitespace from shape properties 2025-11-03 11:23:21 +00:00
Sam Atkins
971c0d0126 LibWeb/CSS: Handle whitespace properly for scrollbar properties
Imported a WPT test that regressed without these changes.
2025-11-03 11:23:21 +00:00
Sam Atkins
60a46b86e4 LibWeb/CSS: Stop stripping whitespace from position-* properties 2025-11-03 11:23:21 +00:00
Sam Atkins
28422e80f2 LibWeb/CSS: Stop stripping whitespace from place-* properties 2025-11-03 11:23:21 +00:00
Sam Atkins
4f5126e52f LibWeb/CSS: Handle whitespace properly in list-style properties 2025-11-03 11:23:21 +00:00
Sam Atkins
8c8168c65c LibWeb/CSS: Handle whitespace properly in grid properties 2025-11-03 11:23:21 +00:00
Sam Atkins
049cc09ae4 LibWeb/CSS: Stop stripping whitespace from flex properties 2025-11-03 11:23:21 +00:00
Sam Atkins
123a3dbbc5 LibWeb/CSS: Handle whitespace properly in mask properties 2025-11-03 11:23:21 +00:00
Sam Atkins
fd682386b8 LibWeb/CSS: Stop stripping whitespace from margin properties 2025-11-03 11:23:21 +00:00
Sam Atkins
d5a0838521 LibWeb/CSS: Stop stripping whitespace from padding properties 2025-11-03 11:23:21 +00:00
Sam Atkins
826eb067c0 LibWeb/CSS: Stop stripping whitespace from overflow properties 2025-11-03 11:23:21 +00:00
Sam Atkins
c4b76d7a49 LibWeb/CSS: Stop stripping whitespace for outline properties 2025-11-03 11:23:21 +00:00
Sam Atkins
85b87378bd LibWeb/CSS: Stop stripping whitespace for size properties 2025-11-03 11:23:21 +00:00
Sam Atkins
eda72541b8 LibWeb/CSS: Stop stripping whitespace for inset properties 2025-11-03 11:23:21 +00:00
Sam Atkins
34e3df1769 LibWeb/CSS: Stop stripping whitespace for SVG geometry properties 2025-11-03 11:23:21 +00:00
Sam Atkins
941ad24abd LibWeb/CSS: Handle whitespace properly in column properties 2025-11-03 11:23:21 +00:00
Sam Atkins
ee13de8426 LibWeb/CSS: Stop stripping whitespace for filter properties 2025-11-03 11:23:21 +00:00
Sam Atkins
cb3773755a LibWeb/CSS: Handle whitespace properly in font properties 2025-11-03 11:23:21 +00:00
Sam Atkins
372ae7c697 LibWeb/CSS: Reformat anchor-size() allowed properties, one per line
Having them grouped as they were is nice, but clang-format 21 really
hates these having multiple values per line.
2025-11-03 11:23:21 +00:00
Sam Atkins
39e0d06987 LibWeb/CSS: Discard whitespace at the start of simple parsing functions 2025-11-03 11:23:21 +00:00
Sam Atkins
003d9e4b49 LibWeb/CSS: Stop stripping whitespace for counter properties 2025-11-03 11:23:21 +00:00
Sam Atkins
17bbf238ed LibWeb/CSS: Stop stripping whitespace for corner-shape properties 2025-11-03 11:23:21 +00:00
Sam Atkins
a348f919be LibWeb/CSS: Handle whitespace properly for shadow properties 2025-11-03 11:23:21 +00:00
Sam Atkins
c5fa5fb80e LibWeb/CSS: Handle whitespace properly for border-image properties 2025-11-03 11:23:21 +00:00
Sam Atkins
a2cd5d5ec8 LibWeb/CSS: Handle whitespace properly for border-radius properties 2025-11-03 11:23:21 +00:00
Sam Atkins
d44c3a0b34 LibWeb/CSS: Stop stripping whitespace for basic border properties
That is, excluding border-image and border-radius properties.
2025-11-03 11:23:21 +00:00
Sam Atkins
e3332dc5c6 LibWeb/CSS: Handle whitespace properly for background properties 2025-11-03 11:23:21 +00:00
Sam Atkins
d2e4f113a2 LibWeb/CSS: Stop stripping whitespace for animation properties 2025-11-03 11:23:21 +00:00
Sam Atkins
821bf4a289 LibWeb/CSS: Discard whitespace when parsing comma-separated lists 2025-11-03 11:23:21 +00:00
Sam Atkins
9dc9e98d14 LibWeb/CSS: Skip whitespace before and after property values
To make this a bit easier, we now wrap the per-property parsing
functions in a parse_all_as() lambda, which skips whitespace, and
returns an error if parsing failed or there are trailing tokens.
2025-11-03 11:23:21 +00:00
Sam Atkins
4fffbf9ba1 LibWeb/CSS: Stop stripping whitespace for simple keyword properties
This is, I believe, all properties that take a single keyword, either
listed literally or using an Enums.json definition.
2025-11-03 11:23:21 +00:00
Sam Atkins
926f5285df LibWeb/CSS: Stop stripping whitespace for all 2025-11-03 11:23:21 +00:00
Sam Atkins
9463526277 LibWeb/CSS: Stop stripping whitespace for align/justify properties 2025-11-03 11:23:21 +00:00
Sam Atkins
f73f7c8209 LibWeb/CSS: Stop stripping whitespace for basic color properties 2025-11-03 11:23:21 +00:00
Sam Atkins
6d38ad32cb LibWeb/CSS: Let Properties.json specify whether to strip whitespace
Removing all whitespace before parsing StyleValues seemed like a good
idea back when I did it, but causes issues. Serialization cares about
whether there was whitespace or not, and we also weren't removing
whitespace from inside blocks and functions so it was inconsistent
whether we needed to deal with whitespace or not.

So currently, some parsing code is conscious of whitespace, some isn't,
and some tries to be but is incorrect. Rather than try to fix all of
this in a single large, messy change, this commit introduces
a "strip-whitespace" flag to Properties.json. We can then disable
whitespace-stripping a few properties at a time and debug any issues
more easily. Eventually (hopefully soon), this will go away entirely.
2025-11-03 11:23:21 +00:00
Marcos Del Sol Vives
abcc5bc16d LibWeb: Support multiple emoji/symbol fonts 2025-11-03 09:56:25 +00:00
Callum Law
ef8dcb2a43 LibWeb: Remove unused code in compute_properties 2025-11-02 23:54:00 +01:00
Callum Law
a95cde3660 LibWeb: Separate CSSAnimation::animationName from Animation::id 2025-11-02 23:54:00 +01:00
Callum Law
2447b8a759 LibWeb: Ignore non-animatable properties in keyframes
Gains us 21 WPT tests
2025-11-02 23:54:00 +01:00
Callum Law
ed0b741a26 LibWeb: Remove special handling of all property for animations
There were a couple places that we had special handling for the `all`
property but since d31a58a was merged we can treat it the same as any
other shorthand
2025-11-02 23:54:00 +01:00
Callum Law
56e2ac8a9d LibWeb: Always do parent document layout updates before updating style
We were doing this manually within `Document::update_layout()` and
`CSSStyleProperties::get_direct_property()` but we should do it for all
callers of `Document::update_style()`
2025-11-02 23:54:00 +01:00
Lorenz A
f54793315c LibWeb: Adjust buttons computed display style 2025-11-01 13:02:44 +00:00
Callum Law
c2ca712406 LibWeb: Properly simplify sum nodes containing negated sum nodes
This is ad-hoc, see https://github.com/w3c/csswg-drafts/issues/13020

Gains us 5 WPT tests
2025-10-30 12:18:24 +00:00
Sam Atkins
9c06d58b2e LibWeb/CSS: Implement and use ValueType::DashedIdent
Reduces the repeated code for parsing these, and makes them available to
the generic value parser.
2025-10-30 11:33:45 +00:00
InvalidUsernameException
35254d17d1 LibWeb/CSS: Do not crash when parsing some multi-layer mask shorthands
This fixes a silly bug where we would crash when parsing a multi-layer
mask shorthand property that contained the no-clip keyword but no value
for mask-origin.

Fixes a crash when parsing the CSS of https://www.browserbase.com/. The
site still has other, unrelated problems though.
2025-10-28 23:50:46 -07:00
Lorenz A
14dba82202 LibWeb: Allow whitespace in not after a boolean-expr-group 2025-10-28 21:54:48 -07:00
Callum Law
5381146e85 LibWeb: Include PropertyID.h in fewer header files
This reduces the size of the recompile when PropertyID.h is modified
from ~1500 to ~125
2025-10-27 14:50:54 +00:00
Callum Law
12716dccf0 LibWeb: Avoid including ComputedProperties.h in Element.h
This reduces the size of the recompile when ComputedProperties.h is
modified from ~1200 to ~70
2025-10-27 14:50:54 +00:00
Callum Law
76dadd45d6 LibWeb: Favour !important property values over animated values 2025-10-27 09:51:50 +00:00