mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 14:17:42 +00:00
LibWeb: Avoid unnecessary copies in CSS Parser
This commit is contained in:
parent
a211c06e99
commit
c64a5ccf29
2 changed files with 3 additions and 3 deletions
|
@ -2740,7 +2740,7 @@ auto Parser::extract_properties(Vector<DeclarationOrAtRule> const& declarations_
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyOwningCSSStyleDeclaration* Parser::convert_to_style_declaration(Vector<DeclarationOrAtRule> declarations_and_at_rules)
|
PropertyOwningCSSStyleDeclaration* Parser::convert_to_style_declaration(Vector<DeclarationOrAtRule> const& declarations_and_at_rules)
|
||||||
{
|
{
|
||||||
auto [properties, custom_properties] = extract_properties(declarations_and_at_rules);
|
auto [properties, custom_properties] = extract_properties(declarations_and_at_rules);
|
||||||
return PropertyOwningCSSStyleDeclaration::create(m_context.window_object(), move(properties), move(custom_properties));
|
return PropertyOwningCSSStyleDeclaration::create(m_context.window_object(), move(properties), move(custom_properties));
|
||||||
|
@ -5409,7 +5409,7 @@ RefPtr<StyleValue> Parser::parse_transform_origin_value(Vector<ComponentValue> c
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto make_list = [](NonnullRefPtr<StyleValue> x_value, NonnullRefPtr<StyleValue> y_value) -> NonnullRefPtr<StyleValueList> {
|
auto make_list = [](NonnullRefPtr<StyleValue> const& x_value, NonnullRefPtr<StyleValue> const& y_value) -> NonnullRefPtr<StyleValueList> {
|
||||||
NonnullRefPtrVector<StyleValue> values;
|
NonnullRefPtrVector<StyleValue> values;
|
||||||
values.append(x_value);
|
values.append(x_value);
|
||||||
values.append(y_value);
|
values.append(y_value);
|
||||||
|
|
|
@ -240,7 +240,7 @@ private:
|
||||||
Vector<FontFace::Source> parse_font_face_src(TokenStream<ComponentValue>&);
|
Vector<FontFace::Source> parse_font_face_src(TokenStream<ComponentValue>&);
|
||||||
|
|
||||||
CSSRule* convert_to_rule(NonnullRefPtr<Rule>);
|
CSSRule* convert_to_rule(NonnullRefPtr<Rule>);
|
||||||
PropertyOwningCSSStyleDeclaration* convert_to_style_declaration(Vector<DeclarationOrAtRule> declarations);
|
PropertyOwningCSSStyleDeclaration* convert_to_style_declaration(Vector<DeclarationOrAtRule> const& declarations);
|
||||||
Optional<StyleProperty> convert_to_style_property(Declaration const&);
|
Optional<StyleProperty> convert_to_style_property(Declaration const&);
|
||||||
|
|
||||||
class Dimension {
|
class Dimension {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue