mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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.
This commit is contained in:
parent
abcc5bc16d
commit
6d38ad32cb
Notes:
github-actions[bot]
2025-11-03 11:30:27 +00:00
Author: https://github.com/AtkinsSJ
Commit: 6d38ad32cb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6646
Reviewed-by: https://github.com/tcl3
3 changed files with 385 additions and 1 deletions
|
|
@ -474,7 +474,7 @@ Parser::ParseErrorOr<NonnullRefPtr<StyleValue const>> Parser::parse_css_value(Pr
|
|||
}
|
||||
|
||||
// FIXME: Stop removing whitespace here. It's less helpful than it seems.
|
||||
if (property_id != PropertyID::Custom && token.is(Token::Type::Whitespace))
|
||||
if (property_requires_whitespace_stripped_before_parsing(property_id) && token.is(Token::Type::Whitespace))
|
||||
continue;
|
||||
|
||||
if (token.is_function())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue