|
@@ -526,10 +526,10 @@ static RefPtr<StyleValue> get_custom_property(DOM::Element const& element, FlySt
|
|
return nullptr;
|
|
return nullptr;
|
|
}
|
|
}
|
|
|
|
|
|
-bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView property_name, HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>>& dependencies, Vector<ComponentValue> const& source, Vector<ComponentValue>& dest, size_t source_start_index) const
|
|
|
|
|
|
+bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView property_name, HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>>& dependencies, Vector<Parser::ComponentValue> const& source, Vector<Parser::ComponentValue>& dest, size_t source_start_index) const
|
|
{
|
|
{
|
|
// FIXME: Do this better!
|
|
// FIXME: Do this better!
|
|
- // We build a copy of the tree of StyleComponentValueRules, with all var()s and attr()s replaced with their contents.
|
|
|
|
|
|
+ // We build a copy of the tree of ComponentValues, with all var()s and attr()s replaced with their contents.
|
|
// This is a very naive solution, and we could do better if the CSS Parser could accept tokens one at a time.
|
|
// This is a very naive solution, and we could do better if the CSS Parser could accept tokens one at a time.
|
|
|
|
|
|
// Arbitrary large value chosen to avoid the billion-laughs attack.
|
|
// Arbitrary large value chosen to avoid the billion-laughs attack.
|
|
@@ -619,7 +619,7 @@ bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView p
|
|
}
|
|
}
|
|
|
|
|
|
auto const& source_function = value.function();
|
|
auto const& source_function = value.function();
|
|
- Vector<ComponentValue> function_values;
|
|
|
|
|
|
+ Vector<Parser::ComponentValue> function_values;
|
|
if (!expand_unresolved_values(element, property_name, dependencies, source_function.values(), function_values, 0))
|
|
if (!expand_unresolved_values(element, property_name, dependencies, source_function.values(), function_values, 0))
|
|
return false;
|
|
return false;
|
|
NonnullRefPtr<StyleFunctionRule> function = adopt_ref(*new StyleFunctionRule(source_function.name(), move(function_values)));
|
|
NonnullRefPtr<StyleFunctionRule> function = adopt_ref(*new StyleFunctionRule(source_function.name(), move(function_values)));
|
|
@@ -628,7 +628,7 @@ bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView p
|
|
}
|
|
}
|
|
if (value.is_block()) {
|
|
if (value.is_block()) {
|
|
auto const& source_block = value.block();
|
|
auto const& source_block = value.block();
|
|
- Vector<ComponentValue> block_values;
|
|
|
|
|
|
+ Vector<Parser::ComponentValue> block_values;
|
|
if (!expand_unresolved_values(element, property_name, dependencies, source_block.values(), block_values, 0))
|
|
if (!expand_unresolved_values(element, property_name, dependencies, source_block.values(), block_values, 0))
|
|
return false;
|
|
return false;
|
|
NonnullRefPtr<StyleBlockRule> block = adopt_ref(*new StyleBlockRule(source_block.token(), move(block_values)));
|
|
NonnullRefPtr<StyleBlockRule> block = adopt_ref(*new StyleBlockRule(source_block.token(), move(block_values)));
|
|
@@ -647,7 +647,7 @@ RefPtr<StyleValue> StyleComputer::resolve_unresolved_style_value(DOM::Element& e
|
|
// to produce a different StyleValue from it.
|
|
// to produce a different StyleValue from it.
|
|
VERIFY(unresolved.contains_var_or_attr());
|
|
VERIFY(unresolved.contains_var_or_attr());
|
|
|
|
|
|
- Vector<ComponentValue> expanded_values;
|
|
|
|
|
|
+ Vector<Parser::ComponentValue> expanded_values;
|
|
HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>> dependencies;
|
|
HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>> dependencies;
|
|
if (!expand_unresolved_values(element, string_from_property_id(property_id), dependencies, unresolved.values(), expanded_values, 0))
|
|
if (!expand_unresolved_values(element, string_from_property_id(property_id), dependencies, unresolved.values(), expanded_values, 0))
|
|
return {};
|
|
return {};
|