From 88b82f569b8b5e778578af932e152c6436c3778d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 2 Jun 2023 02:39:05 +0200 Subject: [PATCH] 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 --- components/style/style_adjuster.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index d12864155dd..ca5bbe9bb00 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -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: