Title: [292157] trunk
Revision
292157
Author
[email protected]
Date
2022-03-31 06:56:29 -0700 (Thu, 31 Mar 2022)

Log Message

[CSS contain] Containment disables the special handling of the HTML body element for overflow viewport propagation [part2]
https://bugs.webkit.org/show_bug.cgi?id=238572

Reviewed by Simon Fraser.

Source/WebCore:

While neither the overflow(1) nor the css containment(2) specs are explicit about disabling the propagation of non-visible overflow to the viewport
when the <html> has containment, this behavior makes sense (and also see https://github.com/w3c/csswg-drafts/issues/7184).

(1) https://www.w3.org/TR/css-overflow-3/#overflow-propagation
(2) https://www.w3.org/TR/css-contain-1/#contain-property

* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateFromStyle):

LayoutTests:

* TestExpectations: Progressions.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (292156 => 292157)


--- trunk/LayoutTests/ChangeLog	2022-03-31 12:45:45 UTC (rev 292156)
+++ trunk/LayoutTests/ChangeLog	2022-03-31 13:56:29 UTC (rev 292157)
@@ -1,3 +1,12 @@
+2022-03-31  Alan Bujtas  <[email protected]>
+
+        [CSS contain] Containment disables the special handling of the HTML body element for overflow viewport propagation [part2]
+        https://bugs.webkit.org/show_bug.cgi?id=238572
+
+        Reviewed by Simon Fraser.
+
+        * TestExpectations: Progressions.
+
 2022-03-31  Tim Nguyen  <[email protected]>
 
         [iOS] imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/default-color.html is a constant failure

Modified: trunk/LayoutTests/TestExpectations (292156 => 292157)


--- trunk/LayoutTests/TestExpectations	2022-03-31 12:45:45 UTC (rev 292156)
+++ trunk/LayoutTests/TestExpectations	2022-03-31 13:56:29 UTC (rev 292157)
@@ -4699,9 +4699,6 @@
 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-002.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-003.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-html-overflow-001.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-html-overflow-003.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-html-overflow-004.html [ ImageOnlyFailure ]
 # innerText bug
 webkit.org/b/238555 imported/w3c/web-platform-tests/css/css-contain/contain-flexbox-outline.html [ Failure ]
 

Modified: trunk/Source/WebCore/ChangeLog (292156 => 292157)


--- trunk/Source/WebCore/ChangeLog	2022-03-31 12:45:45 UTC (rev 292156)
+++ trunk/Source/WebCore/ChangeLog	2022-03-31 13:56:29 UTC (rev 292157)
@@ -1,3 +1,19 @@
+2022-03-31  Alan Bujtas  <[email protected]>
+
+        [CSS contain] Containment disables the special handling of the HTML body element for overflow viewport propagation [part2]
+        https://bugs.webkit.org/show_bug.cgi?id=238572
+
+        Reviewed by Simon Fraser.
+
+        While neither the overflow(1) nor the css containment(2) specs are explicit about disabling the propagation of non-visible overflow to the viewport
+        when the <html> has containment, this behavior makes sense (and also see https://github.com/w3c/csswg-drafts/issues/7184).
+
+        (1) https://www.w3.org/TR/css-overflow-3/#overflow-propagation
+        (2) https://www.w3.org/TR/css-contain-1/#contain-property
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::updateFromStyle):
+
 2022-03-31  Alex Christensen  <[email protected]>
 
         Remove EXPERIMENTAL_FEATURES flag use on Cocoa platforms

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (292156 => 292157)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2022-03-31 12:45:45 UTC (rev 292156)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2022-03-31 13:56:29 UTC (rev 292157)
@@ -511,10 +511,14 @@
             // (1) The root element is <html>.
             // (2) We are the primary <body> (can be checked by looking at document.body).
             // (3) The root element has visible overflow.
-            if (is<HTMLHtmlElement>(*document().documentElement())
+            // (4) No containment is set either on the body or on the html document element.
+            auto& documentElement = *document().documentElement();
+            auto& documentElementRenderer = *documentElement.renderer();
+            if (is<HTMLHtmlElement>(documentElement)
                 && document().body() == element()
-                && document().documentElement()->renderer()->effectiveOverflowX() == Overflow::Visible
-                && !styleToUse.effectiveContainment()) {
+                && documentElementRenderer.effectiveOverflowX() == Overflow::Visible
+                && !styleToUse.effectiveContainment()
+                && !documentElementRenderer.style().effectiveContainment()) {
                 boxHasNonVisibleOverflow = false;
             }
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to