mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Parse and resolve UnresolvedStyleValues
If a property is custom or contains a `var()` reference, it cannot be parsed into a proper StyleValue immediately, so we store it as an UnresolvedStyleValue until the property is compute. Then, at compute time, we resolve them by expanding out any `var()` references, and parsing the result. The implementation here is very naive, and involves copying the UnresolvedStyleValue's tree of StyleComponentValueRules while copying the contents of any `var()`s it finds along the way. This is quite an expensive operation to do every time that the style is computed.
This commit is contained in:
parent
000fb5a70d
commit
23dc0dac88
Notes:
sideshowbarker
2024-07-17 23:02:49 +09:00
Author: https://github.com/AtkinsSJ
Commit: 23dc0dac88
Pull-request: https://github.com/SerenityOS/serenity/pull/11174
6 changed files with 138 additions and 6 deletions
|
@ -57,7 +57,13 @@ StyleDeclarationRule::StyleDeclarationRule() { }
|
|||
StyleDeclarationRule::~StyleDeclarationRule() { }
|
||||
|
||||
StyleFunctionRule::StyleFunctionRule(String name)
|
||||
: m_name(name)
|
||||
: m_name(move(name))
|
||||
{
|
||||
}
|
||||
|
||||
StyleFunctionRule::StyleFunctionRule(String name, Vector<StyleComponentValueRule>&& values)
|
||||
: m_name(move(name))
|
||||
, m_values(move(values))
|
||||
{
|
||||
}
|
||||
StyleFunctionRule::~StyleFunctionRule() { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue