diff --git a/components/layout/display_list/stacking_context.rs b/components/layout/display_list/stacking_context.rs index d082c484c2b..0b2241e20c3 100644 --- a/components/layout/display_list/stacking_context.rs +++ b/components/layout/display_list/stacking_context.rs @@ -1449,25 +1449,6 @@ impl BoxFragment { }); } - // scrollable overflow path - // From https://drafts.csswg.org/css-overflow/#propdef-overflow: - // > UAs must apply the overflow-* values set on the root element to the viewport when the - // > root element’s display value is not none. However, when the root element is an [HTML] - // > html element (including XML syntax for HTML) whose overflow value is visible (in both - // > axes), and that element has as a child a body element whose display value is also not - // > none, user agents must instead apply the overflow-* values of the first such child - // > element to the viewport. The element from which the value is propagated must then have a - // > used overflow value of visible. - // - // TODO: This should only happen when the `display` value is actually propagated. - if self - .base - .flags - .contains(FragmentFlags::IS_BODY_ELEMENT_OF_HTML_ELEMENT_ROOT) - { - return None; - } - let scroll_frame_rect = self .padding_rect() .translate(containing_block_rect.origin.to_vector()) diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 2ac5d3d05b2..fc97f7777cf 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -231653,6 +231653,19 @@ {} ] ], + "overflow-body-propagation-012.html": [ + "483b92e79b4f362e7cb6b5a8020103f48798b21a", + [ + null, + [ + [ + "/css/css-overflow/overflow-body-propagation-012-ref.html", + "==" + ] + ], + {} + ] + ], "overflow-canvas.html": [ "e9529cb0bc81202c5689a507435ea088028a97fc", [ @@ -446720,6 +446733,10 @@ "0d440ef20afa3d2456b702b2a1727a9f0717c4c1", [] ], + "overflow-body-propagation-012-ref.html": [ + "06b64c94334582ca9674f26648ef2be9c3c0e6c2", + [] + ], "overflow-canvas-ref.html": [ "3ad440e371906b2fa4bc2ec4ae5c430267cf11c1", [] diff --git a/tests/wpt/tests/css/css-overflow/overflow-body-propagation-012-ref.html b/tests/wpt/tests/css/css-overflow/overflow-body-propagation-012-ref.html new file mode 100644 index 00000000000..06b64c94334 --- /dev/null +++ b/tests/wpt/tests/css/css-overflow/overflow-body-propagation-012-ref.html @@ -0,0 +1,14 @@ + + + +CSS Reference: BODY with overflow:hidden + + +
+ diff --git a/tests/wpt/tests/css/css-overflow/overflow-body-propagation-012.html b/tests/wpt/tests/css/css-overflow/overflow-body-propagation-012.html new file mode 100644 index 00000000000..483b92e79b4 --- /dev/null +++ b/tests/wpt/tests/css/css-overflow/overflow-body-propagation-012.html @@ -0,0 +1,30 @@ + + + +CSS Test: BODY with overflow:hidden + + + + + +
+