Title: [292663] branches/safari-613-branch
Revision
292663
Author
[email protected]
Date
2022-04-08 17:14:25 -0700 (Fri, 08 Apr 2022)

Log Message

Cherry-pick r292155. rdar://problem/90572543

    Interop issue with position: sticky within contain: paint
    https://bugs.webkit.org/show_bug.cgi?id=238016

    Patch by Rob Buis <[email protected]> on 2022-03-31
    Reviewed by Simon Fraser.

    LayoutTests/imported/w3c:

    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html: Added.
    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html: Added.
    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html: Added.

    Source/WebCore:

    Elements with overflow: clip (contain: paint enables it) are
    not scroll containers, so they can't act as scrolling
    ancestor for sticky elements.

    Tests: imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html
           imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html

    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::enclosingOverflowClipLayer const):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog (292662 => 292663)


--- branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog	2022-04-09 00:14:21 UTC (rev 292662)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog	2022-04-09 00:14:25 UTC (rev 292663)
@@ -1,5 +1,46 @@
 2022-04-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r292155. rdar://problem/90572543
+
+    Interop issue with position: sticky within contain: paint
+    https://bugs.webkit.org/show_bug.cgi?id=238016
+    
+    Patch by Rob Buis <[email protected]> on 2022-03-31
+    Reviewed by Simon Fraser.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html: Added.
+    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html: Added.
+    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html: Added.
+    
+    Source/WebCore:
+    
+    Elements with overflow: clip (contain: paint enables it) are
+    not scroll containers, so they can't act as scrolling
+    ancestor for sticky elements.
+    
+    Tests: imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html
+           imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html
+    
+    * rendering/RenderLayer.cpp:
+    (WebCore::RenderLayer::enclosingOverflowClipLayer const):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-31  Rob Buis  <[email protected]>
+
+            Interop issue with position: sticky within contain: paint
+            https://bugs.webkit.org/show_bug.cgi?id=238016
+
+            Reviewed by Simon Fraser.
+
+            * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html: Added.
+            * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html: Added.
+            * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html: Added.
+
+2022-04-07  Alan Coon  <[email protected]>
+
         Cherry-pick r292029. rdar://problem/90977336
 
     Use Canvas/CanvasText system colors for <dialog> default styling

Added: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html (0 => 292663)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html	2022-04-09 00:14:25 UTC (rev 292663)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<title>Sticky elements should not consider overflow: clip containers as possible scroll ancestor</title>
+<style>
+body {
+  margin: 0;
+  overflow: hidden; /* hide scrollbars */
+}
+
+#container {
+  height: 300px;
+  overflow-y: scroll;
+}
+
+#overflowClipContainer {
+  overflow: visible;
+  height: 600px;
+}
+
+#sticky {
+  position: sticky;
+  top: 0;
+  height: 50px;
+  background-color: yellow;
+}
+</style>
+<script>
+function doTest()
+{
+  container.scrollTo(0, 50);
+}
+window.addEventListener('load', doTest, false);
+</script>
+<div id="container">
+  <div id="overflowClipContainer">
+    <div id="sticky"></div>
+  </div>
+</div>

Added: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html (0 => 292663)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html	2022-04-09 00:14:25 UTC (rev 292663)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<title>Sticky elements should not consider overflow: clip containers as possible scroll ancestor</title>
+<style>
+body {
+  margin: 0;
+  overflow: hidden; /* hide scrollbars */
+}
+
+#container {
+  height: 300px;
+  overflow-y: scroll;
+}
+
+#overflowClipContainer {
+  overflow: visible;
+  height: 600px;
+}
+
+#sticky {
+  position: sticky;
+  top: 0;
+  height: 50px;
+  background-color: yellow;
+}
+</style>
+<script>
+function doTest()
+{
+  container.scrollTo(0, 50);
+}
+window.addEventListener('load', doTest, false);
+</script>
+<div id="container">
+  <div id="overflowClipContainer">
+    <div id="sticky"></div>
+  </div>
+</div>

Added: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html (0 => 292663)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html	2022-04-09 00:14:25 UTC (rev 292663)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<title>Sticky elements should not consider overflow: clip containers as possible scroll ancestor</title>
+<link rel="match" href="" />
+<link rel="help" href="" />
+<meta name="assert" content="This test checks that sticky elements do not consider overflow:clip containers as possible scroll ancestor"/>
+<style>
+body {
+  margin: 0;
+  overflow: hidden; /* hide scrollbars */
+}
+
+#container {
+  height: 300px;
+  overflow: auto;
+}
+
+#overflowClipContainer {
+  overflow: clip;
+  height: 600px;
+}
+
+#sticky {
+  position: sticky;
+  top: 0;
+  height: 50px;
+  background-color: yellow;
+}
+</style>
+<script>
+function doTest()
+{
+  container.scrollTo(0, 50);
+}
+window.addEventListener('load', doTest, false);
+</script>
+<div id="container">
+  <div id="overflowClipContainer">
+    <div id="sticky"></div>
+  </div>
+</div>

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (292662 => 292663)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-04-09 00:14:21 UTC (rev 292662)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-04-09 00:14:25 UTC (rev 292663)
@@ -1,5 +1,52 @@
 2022-04-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r292155. rdar://problem/90572543
+
+    Interop issue with position: sticky within contain: paint
+    https://bugs.webkit.org/show_bug.cgi?id=238016
+    
+    Patch by Rob Buis <[email protected]> on 2022-03-31
+    Reviewed by Simon Fraser.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-expected.html: Added.
+    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html: Added.
+    * web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html: Added.
+    
+    Source/WebCore:
+    
+    Elements with overflow: clip (contain: paint enables it) are
+    not scroll containers, so they can't act as scrolling
+    ancestor for sticky elements.
+    
+    Tests: imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html
+           imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html
+    
+    * rendering/RenderLayer.cpp:
+    (WebCore::RenderLayer::enclosingOverflowClipLayer const):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-31  Rob Buis  <[email protected]>
+
+            Interop issue with position: sticky within contain: paint
+            https://bugs.webkit.org/show_bug.cgi?id=238016
+
+            Reviewed by Simon Fraser.
+
+            Elements with overflow: clip (contain: paint enables it) are
+            not scroll containers, so they can't act as scrolling
+            ancestor for sticky elements.
+
+            Tests: imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html
+                   imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html
+
+            * rendering/RenderLayer.cpp:
+            (WebCore::RenderLayer::enclosingOverflowClipLayer const):
+
+2022-04-07  Alan Coon  <[email protected]>
+
         Cherry-pick r292054. rdar://problem/80630664
 
     WebCore::LegacyRootInlineBox::lineSnapAdjustment should bail out on grid line height < 1

Modified: branches/safari-613-branch/Source/WebCore/rendering/RenderLayer.cpp (292662 => 292663)


--- branches/safari-613-branch/Source/WebCore/rendering/RenderLayer.cpp	2022-04-09 00:14:21 UTC (rev 292662)
+++ branches/safari-613-branch/Source/WebCore/rendering/RenderLayer.cpp	2022-04-09 00:14:25 UTC (rev 292663)
@@ -1351,7 +1351,7 @@
 {
     const RenderLayer* layer = (includeSelf == IncludeSelf) ? this : parent();
     while (layer) {
-        if (layer->renderer().hasNonVisibleOverflow())
+        if (layer->renderer().hasPotentiallyScrollableOverflow())
             return const_cast<RenderLayer*>(layer);
 
         layer = layer->parent();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to