style: Top layer elements that are display:contents should be display: block

As per https://fullscreen.spec.whatwg.org/#new-stacking-layer:

    If its specified display property is contents, it computes to block.

Differential Revision: https://phabricator.services.mozilla.com/D131585
This commit is contained in:
Emilio Cobos Álvarez 2023-06-02 02:39:05 +02:00 committed by Oriol Brufau
parent 2dbc89d1f5
commit 88b82f569b

View file

@ -136,9 +136,15 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
/// computed to 'absolute' if the element is in a top layer.
///
fn adjust_for_top_layer(&mut self) {
if !self.style.is_absolutely_positioned() && self.style.in_top_layer() {
if !self.style.in_top_layer() {
return;
}
if !self.style.is_absolutely_positioned() {
self.style.mutate_box().set_position(Position::Absolute);
}
if self.style.get_box().clone_display().is_contents() {
self.style.mutate_box().set_display(Display::Block);
}
}
/// CSS 2.1 section 9.7: