mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb: Support relative lengths in calc
color values
Gains us ~40 WPT tests.
This commit is contained in:
parent
62d138ebf7
commit
9ab7c5d08d
Notes:
github-actions[bot]
2025-07-04 12:20:09 +00:00
Author: https://github.com/Calme1709
Commit: 9ab7c5d08d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5284
Reviewed-by: https://github.com/AtkinsSJ ✅
17 changed files with 169 additions and 74 deletions
|
@ -1687,10 +1687,13 @@ void Document::obtain_theme_color()
|
|||
// 4. If color is not failure, then return color.
|
||||
if (!css_value.is_null() && css_value->has_color()) {
|
||||
Optional<Layout::NodeWithStyle const&> root_node;
|
||||
if (html_element() && html_element()->layout_node())
|
||||
CSS::CalculationResolutionContext resolution_context;
|
||||
if (html_element() && html_element()->layout_node()) {
|
||||
root_node = *html_element()->layout_node();
|
||||
resolution_context.length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(*html_element()->layout_node());
|
||||
}
|
||||
|
||||
theme_color = css_value->to_color(root_node, {});
|
||||
theme_color = css_value->to_color(root_node, resolution_context);
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue