mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Don't generate layer for background-image none entry
Reduces the time spent in `background_layers()` from 1.5% to 0.04% when loading https://en.wikipedia.org/wiki/2023_in_American_television
This commit is contained in:
Notes:
github-actions[bot]
2026-01-05 11:36:46 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/79740b04b38 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7255 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -45,12 +45,7 @@ bool HTMLHtmlElement::should_use_body_background_properties() const
|
||||
auto background_color = layout_node()->computed_values().background_color();
|
||||
auto const& background_layers = layout_node()->background_layers();
|
||||
|
||||
for (auto& layer : background_layers) {
|
||||
if (layer.background_image)
|
||||
return false;
|
||||
}
|
||||
|
||||
return (background_color == Color::Transparent);
|
||||
return background_layers.is_empty() && background_color == Color::Transparent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user