Title: [276377] trunk
Revision
276377
Author
[email protected]
Date
2021-04-21 11:23:40 -0700 (Wed, 21 Apr 2021)

Log Message

will-change: transform should affect nested position:fixed
https://bugs.webkit.org/show_bug.cgi?id=167600

Reviewed by Alan Bujtas.

"will-change transform" should make an element a container for position:fixed,
just as a transform does.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt:

Source/WebCore:

Test: fast/css/will-change/will-change-transform-contains-fixed.html

* rendering/RenderElement.h:
(WebCore::RenderElement::canContainFixedPositionObjects):

LayoutTests:

* fast/css/will-change/will-change-transform-contains-fixed-expected.html: Added.
* fast/css/will-change/will-change-transform-contains-fixed.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (276376 => 276377)


--- trunk/LayoutTests/ChangeLog	2021-04-21 18:15:10 UTC (rev 276376)
+++ trunk/LayoutTests/ChangeLog	2021-04-21 18:23:40 UTC (rev 276377)
@@ -1,3 +1,16 @@
+2021-04-21  Simon Fraser  <[email protected]>
+
+        will-change: transform should affect nested position:fixed
+        https://bugs.webkit.org/show_bug.cgi?id=167600
+
+        Reviewed by Alan Bujtas.
+
+        "will-change transform" should make an element a container for position:fixed,
+        just as a transform does.
+
+        * fast/css/will-change/will-change-transform-contains-fixed-expected.html: Added.
+        * fast/css/will-change/will-change-transform-contains-fixed.html: Added.
+
 2021-04-21  Chris Lord  <[email protected]>
 
         DOMException should be Serializable

Added: trunk/LayoutTests/fast/css/will-change/will-change-transform-contains-fixed-expected.html (0 => 276377)


--- trunk/LayoutTests/fast/css/will-change/will-change-transform-contains-fixed-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/will-change/will-change-transform-contains-fixed-expected.html	2021-04-21 18:23:40 UTC (rev 276377)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    .container {
+        position: relative;
+        height: 200px;
+        width: 200px;
+        margin: 20px;
+        border: 5px solid blue;
+    }
+    .box {
+        height: 100px;
+        width: 100px;
+    }
+    .absolute {
+        position: absolute;
+        background-color: green;
+        left: 50px;
+        top: 50px;
+    }
+  </style>
+</head>
+<body>
+    <div class="container">
+        <div class="absolute box"></div>
+    </div>
+
+    <div class="container" style="transform: translateZ(0);">
+        <div class="absolute box"></div>
+    </div>
+</body>
+</html>
+

Added: trunk/LayoutTests/fast/css/will-change/will-change-transform-contains-fixed.html (0 => 276377)


--- trunk/LayoutTests/fast/css/will-change/will-change-transform-contains-fixed.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/will-change/will-change-transform-contains-fixed.html	2021-04-21 18:23:40 UTC (rev 276377)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    .container {
+        height: 200px;
+        width: 200px;
+        margin: 20px;
+        border: 5px solid blue;
+    }
+    .box {
+        height: 100px;
+        width: 100px;
+    }
+    .fixed {
+        position: fixed;
+        background-color: green;
+        left: 50px;
+        top: 50px;
+    }
+  </style>
+</head>
+<body>
+    <div class="container" style="transform: translateX(0)">
+        <div class="fixed box"></div>
+    </div>
+
+    <div class="container" style="will-change: transform">
+        <div class="fixed box"></div>
+    </div>
+</body>
+</html>
+

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (276376 => 276377)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-21 18:15:10 UTC (rev 276376)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-21 18:23:40 UTC (rev 276377)
@@ -1,3 +1,15 @@
+2021-04-21  Simon Fraser  <[email protected]>
+
+        will-change: transform should affect nested position:fixed
+        https://bugs.webkit.org/show_bug.cgi?id=167600
+
+        Reviewed by Alan Bujtas.
+
+        "will-change transform" should make an element a container for position:fixed,
+        just as a transform does.
+
+        * web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt:
+
 2021-04-21  Antoine Quint  <[email protected]>
 
         Add discrete animation support for several background CSS properties

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt (276376 => 276377)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt	2021-04-21 18:15:10 UTC (rev 276376)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt	2021-04-21 18:23:40 UTC (rev 276377)
@@ -4,8 +4,8 @@
 PASS abs containing block moves from intermediate to outer
 PASS target is no longer absolute
 PASS target becomes absolute
-FAIL fixed containing block moves from outer to intermediate assert_equals: expected 310 but got 600
-FAIL fixed containing block moves from intermediate to outer assert_equals: expected 210 but got 600
-FAIL target is no longer fixed assert_equals: expected 310 but got 600
-FAIL target becomes fixed assert_equals: expected 310 but got 600
+FAIL fixed containing block moves from outer to intermediate assert_equals: expected 210 but got 310
+FAIL fixed containing block moves from intermediate to outer assert_equals: expected 310 but got 210
+PASS target is no longer fixed
+PASS target becomes fixed
 

Modified: trunk/Source/WebCore/ChangeLog (276376 => 276377)


--- trunk/Source/WebCore/ChangeLog	2021-04-21 18:15:10 UTC (rev 276376)
+++ trunk/Source/WebCore/ChangeLog	2021-04-21 18:23:40 UTC (rev 276377)
@@ -1,3 +1,18 @@
+2021-04-21  Simon Fraser  <[email protected]>
+
+        will-change: transform should affect nested position:fixed
+        https://bugs.webkit.org/show_bug.cgi?id=167600
+
+        Reviewed by Alan Bujtas.
+
+        "will-change transform" should make an element a container for position:fixed,
+        just as a transform does.
+
+        Test: fast/css/will-change/will-change-transform-contains-fixed.html
+
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::canContainFixedPositionObjects):
+
 2021-04-21  Antoine Quint  <[email protected]>
 
         Add discrete animation support for several background CSS properties

Modified: trunk/Source/WebCore/rendering/RenderElement.h (276376 => 276377)


--- trunk/Source/WebCore/rendering/RenderElement.h	2021-04-21 18:15:10 UTC (rev 276376)
+++ trunk/Source/WebCore/rendering/RenderElement.h	2021-04-21 18:23:40 UTC (rev 276377)
@@ -428,6 +428,7 @@
 {
     return isRenderView()
         || (hasTransform() && isRenderBlock())
+        || (style().willChange() && style().willChange()->containsProperty(CSSPropertyTransform))
         || isSVGForeignObject()
         || shouldApplyLayoutContainment(*this)
         || isOutOfFlowRenderFragmentedFlow();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to