mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibWeb: Expand CSS var() inside calc() paren blocks
Before this change, this var() would get expanded: calc(10px * var(--one)) But this one would not: calc(10px * (var(--one))
This commit is contained in:
parent
ce2b88e7cc
commit
1b55ff6f4c
3 changed files with 24 additions and 0 deletions
|
@ -836,6 +836,16 @@ bool StyleComputer::expand_variables(DOM::Element& element, Optional<CSS::Select
|
|||
|
||||
while (source.has_next_token()) {
|
||||
auto const& value = source.next_token();
|
||||
if (value.is_block()) {
|
||||
auto const& source_block = value.block();
|
||||
Vector<Parser::ComponentValue> block_values;
|
||||
Parser::TokenStream source_block_contents { source_block.values() };
|
||||
if (!expand_variables(element, pseudo_element, property_name, dependencies, source_block_contents, block_values))
|
||||
return false;
|
||||
NonnullRefPtr<Parser::Block> block = Parser::Block::create(source_block.token(), move(block_values));
|
||||
dest.empend(block);
|
||||
continue;
|
||||
}
|
||||
if (!value.is_function()) {
|
||||
dest.empend(value);
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue