mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Propagate body background properties to root HTML element
The Acid1 test has a bit of an unusual background - the html and body tags have different background colors. Our painting order of the DOM was such that the body background was painted first, then all other elements were painted in-phase according to Appendix E of CSS 2.1. So the html element's background color was painted over the body background. This removes the special handling of the body background from InitialContainingBlockBox and now all boxes are painted in-phase. Doing this also exposed that we weren't handling Section 2.11.2 of the spec; when the html background is unset, the body's background should be propagated to the html element.
This commit is contained in:
parent
d1ed6bce5d
commit
dba261f79b
Notes:
sideshowbarker
2024-07-18 18:15:02 +09:00
Author: https://github.com/trflynn89
Commit: dba261f79b
Pull-request: https://github.com/SerenityOS/serenity/pull/7083
5 changed files with 41 additions and 19 deletions
|
@ -17,4 +17,12 @@ HTMLHtmlElement::~HTMLHtmlElement()
|
|||
{
|
||||
}
|
||||
|
||||
bool HTMLHtmlElement::should_use_body_background_properties() const
|
||||
{
|
||||
auto background_color = layout_node()->computed_values().background_color();
|
||||
const auto* background_image = layout_node()->background_image();
|
||||
|
||||
return (background_color == Color::Transparent) && !background_image;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue