diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 873be2b2743..7985fac3f73 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -1519,11 +1519,10 @@ impl<'a, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal { let style = node.style(self.style_context()); - let munged_display = if style.get_box()._servo_display_for_hypothetical_box == - display::T::inline { - display::T::inline - } else { - style.get_box().display + let original_display = style.get_box()._servo_display_for_hypothetical_box; + let munged_display = match original_display { + display::T::inline | display::T::inline_block => original_display, + _ => style.get_box().display, }; (munged_display, style.get_box().float, style.get_box().position) } @@ -1577,7 +1576,8 @@ impl<'a, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal { + (display::T::inline, _, position::T::absolute) | + (display::T::inline_block, _, position::T::absolute) => { let construction_result = self.build_fragment_for_absolutely_positioned_inline(node); self.set_flow_construction_result(node, construction_result) diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index a4604810b29..4d17eef015a 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -2280,6 +2280,18 @@ "url": "/_mozilla/css/inline_background_a.html" } ], + "css/inline_block_absolute_hypothetical_a.html": [ + { + "path": "css/inline_block_absolute_hypothetical_a.html", + "references": [ + [ + "/_mozilla/css/inline_block_absolute_hypothetical_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/inline_block_absolute_hypothetical_a.html" + } + ], "css/inline_block_baseline_a.html": [ { "path": "css/inline_block_baseline_a.html", @@ -9044,6 +9056,18 @@ "url": "/_mozilla/css/inline_background_a.html" } ], + "css/inline_block_absolute_hypothetical_a.html": [ + { + "path": "css/inline_block_absolute_hypothetical_a.html", + "references": [ + [ + "/_mozilla/css/inline_block_absolute_hypothetical_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/inline_block_absolute_hypothetical_a.html" + } + ], "css/inline_block_baseline_a.html": [ { "path": "css/inline_block_baseline_a.html", diff --git a/tests/wpt/mozilla/tests/css/inline_block_absolute_hypothetical_a.html b/tests/wpt/mozilla/tests/css/inline_block_absolute_hypothetical_a.html new file mode 100644 index 00000000000..612a922a4f9 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/inline_block_absolute_hypothetical_a.html @@ -0,0 +1,12 @@ + + + + +Hello world! + diff --git a/tests/wpt/mozilla/tests/css/inline_block_absolute_hypothetical_ref.html b/tests/wpt/mozilla/tests/css/inline_block_absolute_hypothetical_ref.html new file mode 100644 index 00000000000..2dd7f39da41 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/inline_block_absolute_hypothetical_ref.html @@ -0,0 +1,11 @@ + + + +Hello world! +