mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb/CSS: Serialize Supports::Declaration as original representation
Fixes some WPT tests that expected `supports(foo:bar)` to serialize as `supports(foo:bar)`, instead of `supports(foo: bar)` with a space between. Reading the original_full_text directly also lets us delete Declaration::to_string(), which was only used here.
This commit is contained in:
Notes:
github-actions[bot]
2025-12-02 09:50:44 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/b376ab4e819 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6986
@@ -398,11 +398,11 @@ OwnPtr<Supports::Declaration> Parser::parse_supports_declaration(TokenStream<Com
|
||||
// NB: Here, we only care about the <declaration> part.
|
||||
auto transaction = tokens.begin_transaction();
|
||||
tokens.discard_whitespace();
|
||||
if (auto declaration = consume_a_declaration(tokens); declaration.has_value()) {
|
||||
if (auto declaration = consume_a_declaration(tokens, Nested::No, SaveOriginalText::Yes); declaration.has_value()) {
|
||||
tokens.discard_whitespace();
|
||||
if (!tokens.has_next_token()) {
|
||||
transaction.commit();
|
||||
return Supports::Declaration::create(declaration->to_string(), convert_to_style_property(*declaration).has_value());
|
||||
return Supports::Declaration::create(declaration->original_full_text.release_value(), convert_to_style_property(*declaration).has_value());
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user