mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibWeb: Stop constructing temporary ElementInlineCSSStyleDeclarations
Previously, parse_css_style_attribute() would parse the string, extract the properties, add them to a newly-created ElementInlineCSSStyleDeclarations, and then user code would take the properties back out of it again and throw it away. Instead, just return the list of properties, and the caller can create an EICSD if it needs one.
This commit is contained in:
parent
f0d198ca3f
commit
50455c2f5e
Notes:
github-actions[bot]
2025-03-19 13:54:35 +00:00
Author: https://github.com/AtkinsSJ
Commit: 50455c2f5e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3983
5 changed files with 19 additions and 22 deletions
|
@ -88,7 +88,12 @@ public:
|
|||
static Parser create(ParsingParams const&, StringView input, StringView encoding = "utf-8"sv);
|
||||
|
||||
CSSStyleSheet* parse_as_css_stylesheet(Optional<URL::URL> location);
|
||||
ElementInlineCSSStyleDeclaration* parse_as_style_attribute(DOM::Element&);
|
||||
|
||||
struct PropertiesAndCustomProperties {
|
||||
Vector<StyleProperty> properties;
|
||||
HashMap<FlyString, StyleProperty> custom_properties;
|
||||
};
|
||||
PropertiesAndCustomProperties parse_as_style_attribute();
|
||||
CSSRule* parse_as_css_rule();
|
||||
Optional<StyleProperty> parse_as_supports_condition();
|
||||
|
||||
|
@ -452,11 +457,6 @@ private:
|
|||
|
||||
static bool has_ignored_vendor_prefix(StringView);
|
||||
|
||||
struct PropertiesAndCustomProperties {
|
||||
Vector<StyleProperty> properties;
|
||||
HashMap<FlyString, StyleProperty> custom_properties;
|
||||
};
|
||||
|
||||
PropertiesAndCustomProperties extract_properties(Vector<RuleOrListOfDeclarations> const&);
|
||||
void extract_property(Declaration const&, Parser::PropertiesAndCustomProperties&);
|
||||
|
||||
|
@ -510,7 +510,7 @@ private:
|
|||
namespace Web {
|
||||
|
||||
CSS::CSSStyleSheet* parse_css_stylesheet(CSS::Parser::ParsingParams const&, StringView, Optional<URL::URL> location = {});
|
||||
CSS::ElementInlineCSSStyleDeclaration* parse_css_style_attribute(CSS::Parser::ParsingParams const&, StringView, DOM::Element&);
|
||||
CSS::Parser::Parser::PropertiesAndCustomProperties parse_css_style_attribute(CSS::Parser::ParsingParams const&, StringView);
|
||||
RefPtr<CSS::CSSStyleValue> parse_css_value(CSS::Parser::ParsingParams const&, StringView, CSS::PropertyID property_id = CSS::PropertyID::Invalid);
|
||||
Optional<CSS::SelectorList> parse_selector(CSS::Parser::ParsingParams const&, StringView);
|
||||
Optional<CSS::SelectorList> parse_selector_for_nested_style_rule(CSS::Parser::ParsingParams const&, StringView);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue