mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 18:58:56 +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
|
@ -586,6 +586,7 @@ Optional<BordersData> borders_data_for_outline(Layout::Node const& layout_node,
|
|||
if (outline_style == CSS::OutlineStyle::Auto) {
|
||||
// `auto` lets us do whatever we want for the outline. 2px of the accent colour seems reasonable.
|
||||
line_style = CSS::LineStyle::Solid;
|
||||
// NOTE: CalculationResolutionContext is not required here as Accentcolor keyword value is guaranteed to not rely on it to resolve.
|
||||
outline_color = CSS::CSSKeywordValue::create(CSS::Keyword::Accentcolor)->to_color(*static_cast<Layout::NodeWithStyle const*>(&layout_node), {});
|
||||
outline_width = 2;
|
||||
} else {
|
||||
|
|
|
@ -30,7 +30,7 @@ static ColorStopData resolve_color_stop_positions(Layout::NodeWithStyle const& n
|
|||
|
||||
resolved_color_stops.ensure_capacity(expanded_size);
|
||||
for (auto& stop : color_stop_list) {
|
||||
auto resolved_stop = Gfx::ColorStop { .color = stop.color_stop.color->to_color(node, {}) };
|
||||
auto resolved_stop = Gfx::ColorStop { .color = stop.color_stop.color->to_color(node, { .length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(node) }) };
|
||||
for (int i = 0; i < color_stop_length(stop); i++)
|
||||
resolved_color_stops.append(resolved_stop);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue