mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
LibWeb/CSS: Rewrite CSS Parser core methods according to new spec
CSS Syntax 3 (https://drafts.csswg.org/css-syntax) has changed significantly since we implemented it a couple of years ago. Just about every parsing algorithm has been rewritten in terms of the new token stream concept, and to support nested styles. As all of those algorithms call into each other, this is an unfortunately chonky diff. As part of this, the transitory types (Declaration, Function, AtRule...) have been rewritten. That's both because we have new requirements of what they should be and contain, and also because the spec asks us to create and then gradually modify them in place, which is easier if they are plain structs.
This commit is contained in:
parent
f11c0e6cc0
commit
e0be17e4fb
Notes:
github-actions[bot]
2024-10-14 06:09:33 +00:00
Author: https://github.com/AtkinsSJ
Commit: e0be17e4fb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1729
24 changed files with 1126 additions and 1278 deletions
|
@ -118,7 +118,7 @@ static Optional<RoundingStrategy> parse_rounding_strategy(Vector<ComponentValue>
|
|||
|
||||
OwnPtr<CalculationNode> Parser::parse_math_function(PropertyID property_id, Function const& function)
|
||||
{
|
||||
TokenStream stream { function.values() };
|
||||
TokenStream stream { function.value };
|
||||
auto arguments = parse_a_comma_separated_list_of_component_values(stream);
|
||||
)~~~");
|
||||
|
||||
|
@ -129,7 +129,7 @@ OwnPtr<CalculationNode> Parser::parse_math_function(PropertyID property_id, Func
|
|||
auto function_generator = generator.fork();
|
||||
function_generator.set("name:lowercase", name);
|
||||
function_generator.set("name:titlecase", title_casify(name));
|
||||
function_generator.appendln(" if (function.name().equals_ignoring_ascii_case(\"@name:lowercase@\"sv)) {");
|
||||
function_generator.appendln(" if (function.name.equals_ignoring_ascii_case(\"@name:lowercase@\"sv)) {");
|
||||
if (function_data.get_bool("is-variadic"sv).value_or(false)) {
|
||||
// Variadic function
|
||||
function_generator.append(R"~~~(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue