Title: [277192] branches/safari-611-branch
Revision
277192
Author
repst...@apple.com
Date
2021-05-07 11:48:40 -0700 (Fri, 07 May 2021)

Log Message

Cherry-pick r276627. rdar://problem/77580982

    Create a containing block when relevant properties are set in the current element will-change
    https://bugs.webkit.org/show_bug.cgi?id=167868

    Patch by Tim Nguyen <n...@apple.com> on 2021-04-26
    Reviewed by Alan Bujtas.

    Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
    current element's will-change.

    Relevant WPT are enabled.

    Test: fast/css/will-change/will-change-creates-containing-block.html

    LayoutTests/imported/w3c:

    * web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:

    Source/WebCore:

    * rendering/RenderElement.h:
    (WebCore::RenderElement::canContainFixedPositionObjects const):
    (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
    * rendering/style/WillChangeData.cpp:
    (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
    * rendering/style/WillChangeData.h:

    LayoutTests:

    * TestExpectations:
    * fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
    * fast/css/will-change/will-change-creates-containing-block.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-611-branch/LayoutTests/ChangeLog (277191 => 277192)


--- branches/safari-611-branch/LayoutTests/ChangeLog	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/LayoutTests/ChangeLog	2021-05-07 18:48:40 UTC (rev 277192)
@@ -1,3 +1,59 @@
+2021-05-07  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r276627. rdar://problem/77580982
+
+    Create a containing block when relevant properties are set in the current element will-change
+    https://bugs.webkit.org/show_bug.cgi?id=167868
+    
+    Patch by Tim Nguyen <n...@apple.com> on 2021-04-26
+    Reviewed by Alan Bujtas.
+    
+    Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
+    current element's will-change.
+    
+    Relevant WPT are enabled.
+    
+    Test: fast/css/will-change/will-change-creates-containing-block.html
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:
+    
+    Source/WebCore:
+    
+    * rendering/RenderElement.h:
+    (WebCore::RenderElement::canContainFixedPositionObjects const):
+    (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
+    * rendering/style/WillChangeData.cpp:
+    (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
+    * rendering/style/WillChangeData.h:
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    * fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
+    * fast/css/will-change/will-change-creates-containing-block.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-26  Tim Nguyen  <n...@apple.com>
+
+            Create a containing block when relevant properties are set in the current element will-change
+            https://bugs.webkit.org/show_bug.cgi?id=167868
+
+            Reviewed by Alan Bujtas.
+
+            Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
+            current element's will-change.
+
+            Relevant WPT are enabled.
+
+            Test: fast/css/will-change/will-change-creates-containing-block.html
+
+            * TestExpectations:
+            * fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
+            * fast/css/will-change/will-change-creates-containing-block.html: Added.
+
 2021-05-06  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r276630. rdar://problem/77581089

Modified: branches/safari-611-branch/LayoutTests/TestExpectations (277191 => 277192)


--- branches/safari-611-branch/LayoutTests/TestExpectations	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/LayoutTests/TestExpectations	2021-05-07 18:48:40 UTC (rev 277192)
@@ -4606,3 +4606,14 @@
 webanimations/transform-property-and-transform-animation-with-delay-on-forced-layer.html [ Skip ]
 webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html [ Skip ]
 
+# CSS will-change failures
+webkit.org/b/224928 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-dynamic-001.html [ ImageOnlyFailure ]
+webkit.org/b/225035 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-002.html [ ImageOnlyFailure ]
+webkit.org/b/225034 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-003.html [ ImageOnlyFailure ]
+webkit.org/b/224902 [ Debug ] imported/w3c/web-platform-tests/css/css-will-change/parsing/will-change-invalid.html [ Skip ]
+
+# Needs -webkit-backdrop-filter to be unprefixed
+webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-003.html [ ImageOnlyFailure ]
+webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-004.html [ ImageOnlyFailure ]
+webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-005.html [ ImageOnlyFailure ]
+

Added: branches/safari-611-branch/LayoutTests/fast/css/will-change/will-change-creates-containing-block-expected.html (0 => 277192)


--- branches/safari-611-branch/LayoutTests/fast/css/will-change/will-change-creates-containing-block-expected.html	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/css/will-change/will-change-creates-containing-block-expected.html	2021-05-07 18:48:40 UTC (rev 277192)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            height: 200px;
+            width: 200px;
+            margin: 40px;
+            border: 5px solid blue;
+        }
+        .absolute {
+            position: absolute;
+            background-color: green;
+            left: 50px;
+            top: 50px;
+            height: 100px;
+            width: 100px;
+        }
+    </style>
+</head>
+<body>
+    <div class="container" style="position: relative;">
+        <div class="absolute"></div>
+    </div>
+
+    <div class="container" style="position: relative;">
+        <div class="absolute"></div>
+    </div>
+</body>
+</html>

Added: branches/safari-611-branch/LayoutTests/fast/css/will-change/will-change-creates-containing-block.html (0 => 277192)


--- branches/safari-611-branch/LayoutTests/fast/css/will-change/will-change-creates-containing-block.html	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/css/will-change/will-change-creates-containing-block.html	2021-05-07 18:48:40 UTC (rev 277192)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            height: 200px;
+            width: 200px;
+            margin: 40px;
+            border: 5px solid blue;
+        }
+        .absolute {
+            position: absolute;
+            background-color: green;
+            left: 50px;
+            top: 50px;
+            height: 100px;
+            width: 100px;
+        }
+    </style>
+</head>
+<body>
+    <div class="container" style="position: relative;">
+        <div class="absolute"></div>
+    </div>
+
+    <div class="container" style="will-change: position;">
+        <div class="absolute"></div>
+    </div>
+</body>
+</html>

Modified: branches/safari-611-branch/LayoutTests/imported/w3c/ChangeLog (277191 => 277192)


--- branches/safari-611-branch/LayoutTests/imported/w3c/ChangeLog	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/LayoutTests/imported/w3c/ChangeLog	2021-05-07 18:48:40 UTC (rev 277192)
@@ -1,3 +1,57 @@
+2021-05-07  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r276627. rdar://problem/77580982
+
+    Create a containing block when relevant properties are set in the current element will-change
+    https://bugs.webkit.org/show_bug.cgi?id=167868
+    
+    Patch by Tim Nguyen <n...@apple.com> on 2021-04-26
+    Reviewed by Alan Bujtas.
+    
+    Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
+    current element's will-change.
+    
+    Relevant WPT are enabled.
+    
+    Test: fast/css/will-change/will-change-creates-containing-block.html
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:
+    
+    Source/WebCore:
+    
+    * rendering/RenderElement.h:
+    (WebCore::RenderElement::canContainFixedPositionObjects const):
+    (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
+    * rendering/style/WillChangeData.cpp:
+    (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
+    * rendering/style/WillChangeData.h:
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    * fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
+    * fast/css/will-change/will-change-creates-containing-block.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-26  Tim Nguyen  <n...@apple.com>
+
+            Create a containing block when relevant properties are set in the current element will-change
+            https://bugs.webkit.org/show_bug.cgi?id=167868
+
+            Reviewed by Alan Bujtas.
+
+            Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
+            current element's will-change.
+
+            Relevant WPT are enabled.
+
+            Test: fast/css/will-change/will-change-creates-containing-block.html
+
+            * web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:
+
 2021-02-24  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r272911. rdar://problem/74501076

Modified: branches/safari-611-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/padding-computed-expected.txt (277191 => 277192)


--- branches/safari-611-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/padding-computed-expected.txt	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/padding-computed-expected.txt	2021-05-07 18:48:40 UTC (rev 277192)
@@ -5,11 +5,11 @@
 PASS Property padding-right value '20px'
 PASS Property padding-bottom value '30px'
 PASS Property padding-left value '40px'
-FAIL Property padding value '20%' assert_equals: expected "40px" but got "160px"
-FAIL Property padding value '10px 20% 30% 40px' assert_equals: expected "10px 40px 60px" but got "10px 160px 240px 40px"
-FAIL Property padding-right value '20%' assert_equals: expected "40px" but got "160px"
-FAIL Property padding-top value 'calc(10% - 40px)' assert_equals: expected "0px" but got "40px"
-FAIL Property padding-right value 'calc(10% + 40px)' assert_equals: expected "60px" but got "120px"
+PASS Property padding value '20%'
+PASS Property padding value '10px 20% 30% 40px'
+PASS Property padding-right value '20%'
+PASS Property padding-top value 'calc(10% - 40px)'
+PASS Property padding-right value 'calc(10% + 40px)'
 PASS Property padding-bottom value 'calc(10px - 0.5em)'
 PASS Property padding-left value 'calc(10px + 0.5em)'
 

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (277191 => 277192)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-05-07 18:48:40 UTC (rev 277192)
@@ -1,5 +1,64 @@
 2021-05-07  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r276627. rdar://problem/77580982
+
+    Create a containing block when relevant properties are set in the current element will-change
+    https://bugs.webkit.org/show_bug.cgi?id=167868
+    
+    Patch by Tim Nguyen <n...@apple.com> on 2021-04-26
+    Reviewed by Alan Bujtas.
+    
+    Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
+    current element's will-change.
+    
+    Relevant WPT are enabled.
+    
+    Test: fast/css/will-change/will-change-creates-containing-block.html
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:
+    
+    Source/WebCore:
+    
+    * rendering/RenderElement.h:
+    (WebCore::RenderElement::canContainFixedPositionObjects const):
+    (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
+    * rendering/style/WillChangeData.cpp:
+    (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
+    * rendering/style/WillChangeData.h:
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    * fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
+    * fast/css/will-change/will-change-creates-containing-block.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-26  Tim Nguyen  <n...@apple.com>
+
+            Create a containing block when relevant properties are set in the current element will-change
+            https://bugs.webkit.org/show_bug.cgi?id=167868
+
+            Reviewed by Alan Bujtas.
+
+            Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
+            current element's will-change.
+
+            Relevant WPT are enabled.
+
+            Test: fast/css/will-change/will-change-creates-containing-block.html
+
+            * rendering/RenderElement.h:
+            (WebCore::RenderElement::canContainFixedPositionObjects const):
+            (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
+            * rendering/style/WillChangeData.cpp:
+            (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
+            * rendering/style/WillChangeData.h:
+
+2021-05-07  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r276575. rdar://problem/77581037
 
     Make more IndexedDB objects iso-heap'ed

Modified: branches/safari-611-branch/Source/WebCore/rendering/RenderElement.h (277191 => 277192)


--- branches/safari-611-branch/Source/WebCore/rendering/RenderElement.h	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/Source/WebCore/rendering/RenderElement.h	2021-05-07 18:48:40 UTC (rev 277192)
@@ -423,7 +423,9 @@
 inline bool RenderElement::canContainFixedPositionObjects() const
 {
     return isRenderView()
-        || (hasTransform() && isRenderBlock())
+        || (isRenderBlock() && hasTransform())
+        // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
+        || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
         || isSVGForeignObject()
         || isOutOfFlowRenderFragmentedFlow();
 }
@@ -432,6 +434,8 @@
 {
     return style().position() != PositionType::Static
         || (isRenderBlock() && hasTransformRelatedProperty())
+        // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
+        || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
         || isSVGForeignObject()
         || isRenderView();
 }

Modified: branches/safari-611-branch/Source/WebCore/rendering/style/WillChangeData.cpp (277191 => 277192)


--- branches/safari-611-branch/Source/WebCore/rendering/style/WillChangeData.cpp	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/Source/WebCore/rendering/style/WillChangeData.cpp	2021-05-07 18:48:40 UTC (rev 277192)
@@ -60,6 +60,23 @@
     return false;
 }
 
+bool WillChangeData::createsContainingBlockForOutOfFlowPositioned() const
+{
+    return containsProperty(CSSPropertyPosition)
+        || containsProperty(CSSPropertyPerspective)
+        // CSS transforms
+        || containsProperty(CSSPropertyTransform)
+        || containsProperty(CSSPropertyTranslate)
+        || containsProperty(CSSPropertyRotate)
+        || containsProperty(CSSPropertyScale)
+        // CSS filter & backdrop-filter
+        // FIXME: exclude root element for those properties (bug 225034)
+#if ENABLE(FILTERS_LEVEL_2)
+        || containsProperty(CSSPropertyWebkitBackdropFilter)
+#endif
+        || containsProperty(CSSPropertyFilter);
+}
+
 // "If any non-initial value of a property would create a stacking context on the element,
 // specifying that property in will-change must create a stacking context on the element."
 bool WillChangeData::propertyCreatesStackingContext(CSSPropertyID property)

Modified: branches/safari-611-branch/Source/WebCore/rendering/style/WillChangeData.h (277191 => 277192)


--- branches/safari-611-branch/Source/WebCore/rendering/style/WillChangeData.h	2021-05-07 18:48:34 UTC (rev 277191)
+++ branches/safari-611-branch/Source/WebCore/rendering/style/WillChangeData.h	2021-05-07 18:48:40 UTC (rev 277192)
@@ -52,6 +52,7 @@
     bool containsContents() const;
     bool containsProperty(CSSPropertyID) const;
 
+    bool createsContainingBlockForOutOfFlowPositioned() const;
     bool canCreateStackingContext() const { return m_canCreateStackingContext; }
     bool canTriggerCompositing() const { return m_canTriggerCompositing; }
     bool canTriggerCompositingOnInline() const { return m_canTriggerCompositingOnInline; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to