mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 09:18:55 +00:00
LibWeb: Use correct root element when resolving paint properties
Previously, the first `HTMLHtmlELement` in the given document would always be used when determining whether to propagate background properties to the body element. This meant the wrong root element was used for SVG `foreignObject` elements, which could lead to a crash.
This commit is contained in:
parent
62fe795c9b
commit
551c7f966b
Notes:
github-actions[bot]
2025-09-10 09:36:15 +00:00
Author: https://github.com/tcl3
Commit: 551c7f966b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6145
Reviewed-by: https://github.com/gmta ✅
2 changed files with 8 additions and 1 deletions
|
@ -1537,7 +1537,8 @@ void PaintableBox::resolve_paint_properties()
|
|||
|
||||
// Section 2.11.2: If the computed value of background-image on the root element is none and its background-color is transparent,
|
||||
// user agents must instead propagate the computed values of the background properties from that element’s first HTML BODY child element.
|
||||
if (document().html_element()->should_use_body_background_properties()) {
|
||||
auto& html_element = as<HTML::HTMLHtmlElement>(*layout_node_with_style_and_box_metrics().dom_node());
|
||||
if (html_element.should_use_body_background_properties()) {
|
||||
background_layers = document().background_layers();
|
||||
background_color = document().background_color();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" >
|
||||
<foreignObject>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
</html>
|
||||
</foreignObject>
|
||||
</svg>
|
After Width: | Height: | Size: 158 B |
Loading…
Add table
Add a link
Reference in a new issue