layout: Convert layout internal display to inline for replaced elements (#31133)

Replaced elements should never be able to have a layout internal
display, according to the specification. This change makes it so that
the used value of replaced element's display is always inline, as the
specification says.
This commit is contained in:
Martin Robinson 2024-01-23 13:55:01 +01:00 committed by GitHub
parent 890588945d
commit 54fb381a0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 79 deletions

View file

@ -172,6 +172,7 @@ fn traverse_element<'dom, Node>(
},
Display::GeneratingBox(display) => {
let contents = replaced.map_or(Contents::OfElement, Contents::Replaced);
let display = display.used_value_for_contents(&contents);
let box_slot = element.element_box_slot();
let info = NodeAndStyleInfo::new(element, style);
handler.handle_element(&info, display, contents, box_slot);