ladybird/Userland/Libraries/LibWeb/CSS/Parser
Sam Atkins bcacc2357e LibWeb: Implement smarter CSS StyleValue parsing
We know what types and identifiers a property can accept, so we can use
that information to only parse things that can be accepted. This solves
some awkward ambiguity problems that we have now or will face in the
future, including:

- Is `0` a number or a length with no unit?
- Is `3.5` a number or a ratio?
- Is `bottom` an identifier, or a custom-ident?

Two CSS Parser methods are introduced here:

`parse_css_value_for_property()` attempts to parse a StyleValue that the
property can accept, skipping any types that it doesn't want.

`parse_css_value_for_properties()` does the same, but takes multiple
PropertyIDs and additionally returns which one the parsed StyleValue is
for. This is intended for parsing shorthands, so you can give it a list
of longhands you haven't yet parsed.

Subsequent commits will actually use these new methods.
2023-05-25 06:36:10 +02:00
..
Block.cpp LibWeb: Port CSS::Parser::Block to new Strings 2023-02-15 12:48:26 -05:00
Block.h LibWeb: Port CSS::Parser::Block to new Strings 2023-02-15 12:48:26 -05:00
ComponentValue.cpp LibWeb: Port CSS::Parser::ComponentValue to new Strings 2023-02-15 12:48:26 -05:00
ComponentValue.h LibWeb+LibIDL: Fix (or paper over) various const-correctness issues 2023-02-21 00:54:04 +01:00
Declaration.cpp LibWeb: Port CSS/Serialize.{h,cpp} to new Strings, and propagate errors 2023-02-15 12:48:26 -05:00
Declaration.h LibWeb: Port CSS::Parser::Declaration to new Strings 2023-02-15 12:48:26 -05:00
DeclarationOrAtRule.cpp LibWeb: Port CSS::Parser::Rule to new Strings 2023-02-15 12:48:26 -05:00
DeclarationOrAtRule.h LibWeb: Port CSS::Parser::Rule to new Strings 2023-02-15 12:48:26 -05:00
Function.cpp LibWeb: Port CSS/Serialize.{h,cpp} to new Strings, and propagate errors 2023-02-15 12:48:26 -05:00
Function.h LibWeb: Port CSS::Parser::Function to new Strings 2023-02-15 12:48:26 -05:00
Parser.cpp LibWeb: Implement smarter CSS StyleValue parsing 2023-05-25 06:36:10 +02:00
Parser.h LibWeb: Implement smarter CSS StyleValue parsing 2023-05-25 06:36:10 +02:00
Rule.cpp LibWeb: Port CSS::Parser::Rule to new Strings 2023-02-15 12:48:26 -05:00
Rule.h LibWeb: Port CSS::Parser::Rule to new Strings 2023-02-15 12:48:26 -05:00
Token.cpp Everywhere: Use _{short_,}string to create Strings from literals 2023-02-25 20:51:49 +01:00
Token.h LibWeb: Store the original representation of CSS tokens 2023-03-22 19:45:40 +01:00
Tokenizer.cpp LibWeb: Store the original representation of CSS tokens 2023-03-22 19:45:40 +01:00
Tokenizer.h LibWeb: Store the original representation of CSS tokens 2023-03-22 19:45:40 +01:00
TokenStream.h LibWeb: Propagate errors from CSS Parser construction 2023-03-07 00:43:36 +01:00