mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibWeb: Use a string instead of an internal Parser class in Supports
Now that we can serialize CSS tokens, we can just hold a string and then re-parse it when the Supports is evaluated. This feels a little weird, but it only happens once so it's not going to slow it down much, and it keep the API cleaner.
This commit is contained in:
parent
7d5c626276
commit
dea4f83037
4 changed files with 4 additions and 7 deletions
|
@ -113,9 +113,6 @@ public:
|
|||
|
||||
RefPtr<StyleValue> parse_as_css_value(PropertyID);
|
||||
|
||||
// FIXME: This is a hack, while CSS::Supports is using a StyleDeclarationRule
|
||||
[[nodiscard]] Optional<StyleProperty> convert_to_style_property(StyleDeclarationRule const&);
|
||||
|
||||
private:
|
||||
enum class ParsingResult {
|
||||
Done,
|
||||
|
@ -175,6 +172,7 @@ private:
|
|||
|
||||
[[nodiscard]] RefPtr<CSSRule> convert_to_rule(NonnullRefPtr<StyleRule>);
|
||||
[[nodiscard]] RefPtr<PropertyOwningCSSStyleDeclaration> convert_to_declaration(NonnullRefPtr<StyleBlockRule>);
|
||||
[[nodiscard]] Optional<StyleProperty> convert_to_style_property(StyleDeclarationRule const&);
|
||||
|
||||
Optional<Color> parse_color(StyleComponentValueRule const&);
|
||||
Optional<Length> parse_length(StyleComponentValueRule const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue