Title: [289646] branches/safari-613.1.17.0-branch
Revision
289646
Author
[email protected]
Date
2022-02-11 11:58:30 -0800 (Fri, 11 Feb 2022)

Log Message

Cherry-pick r289377. rdar://problem/88178304

    Return 'none' for the computed style of mask when there are no mask images
    https://bugs.webkit.org/show_bug.cgi?id=236265
    <rdar://88178304>

    Patch by Matt Woodrow <[email protected]> on 2022-02-08
    Reviewed by Dean Jackson.

    Source/WebCore:

    Rather than returning all the longhand properties, return 'none' if there are no
    mask images. This no longer matches the behaviour of the 'background' property, but
    better matches what other UAs do.

    Ideally we'd return the smallest possible canonical representation of the non-initial
    property values, but this is a much simpler change to fix a compat regression.

    Test: fast/masking/parsing-mask.html
    Updates expected results to match new behavior.

    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::ComputedStyleExtractor::getLayerCount):
    (WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue):
    (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
    (WebCore::ComputedStyleExtractor::getMaskShorthandValue):
    * css/CSSComputedStyleDeclaration.h:

    LayoutTests:

    * fast/masking/parsing-mask-expected.txt:
    * fast/masking/parsing-mask.html:

    Updated expected results to expect 'none' for all cases where there isn't an actual mask
    image.

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

Modified Paths

Diff

Modified: branches/safari-613.1.17.0-branch/LayoutTests/ChangeLog (289645 => 289646)


--- branches/safari-613.1.17.0-branch/LayoutTests/ChangeLog	2022-02-11 19:57:58 UTC (rev 289645)
+++ branches/safari-613.1.17.0-branch/LayoutTests/ChangeLog	2022-02-11 19:58:30 UTC (rev 289646)
@@ -1,3 +1,57 @@
+2022-02-11  Russell Epstein  <[email protected]>
+
+        Cherry-pick r289377. rdar://problem/88178304
+
+    Return 'none' for the computed style of mask when there are no mask images
+    https://bugs.webkit.org/show_bug.cgi?id=236265
+    <rdar://88178304>
+    
+    Patch by Matt Woodrow <[email protected]> on 2022-02-08
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    Rather than returning all the longhand properties, return 'none' if there are no
+    mask images. This no longer matches the behaviour of the 'background' property, but
+    better matches what other UAs do.
+    
+    Ideally we'd return the smallest possible canonical representation of the non-initial
+    property values, but this is a much simpler change to fix a compat regression.
+    
+    Test: fast/masking/parsing-mask.html
+    Updates expected results to match new behavior.
+    
+    * css/CSSComputedStyleDeclaration.cpp:
+    (WebCore::ComputedStyleExtractor::getLayerCount):
+    (WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue):
+    (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
+    (WebCore::ComputedStyleExtractor::getMaskShorthandValue):
+    * css/CSSComputedStyleDeclaration.h:
+    
+    LayoutTests:
+    
+    * fast/masking/parsing-mask-expected.txt:
+    * fast/masking/parsing-mask.html:
+    
+    Updated expected results to expect 'none' for all cases where there isn't an actual mask
+    image.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-08  Matt Woodrow  <[email protected]>
+
+            Return 'none' for the computed style of mask when there are no mask images
+            https://bugs.webkit.org/show_bug.cgi?id=236265
+            <rdar://88178304>
+
+            Reviewed by Dean Jackson.
+
+            * fast/masking/parsing-mask-expected.txt:
+            * fast/masking/parsing-mask.html:
+
+            Updated expected results to expect 'none' for all cases where there isn't an actual mask
+            image.
+
 2022-02-10  Alan Coon  <[email protected]>
 
         Cherry-pick r288434. rdar://problem/56436745

Modified: branches/safari-613.1.17.0-branch/LayoutTests/fast/masking/parsing-mask-expected.txt (289645 => 289646)


--- branches/safari-613.1.17.0-branch/LayoutTests/fast/masking/parsing-mask-expected.txt	2022-02-11 19:57:58 UTC (rev 289645)
+++ branches/safari-613.1.17.0-branch/LayoutTests/fast/masking/parsing-mask-expected.txt	2022-02-11 19:58:30 UTC (rev 289646)
@@ -89,68 +89,68 @@
 PASS innerStyle("mask", "none border-box content-box left top repeat-x") is "none left top repeat-x border-box content-box"
 PASS innerStyle("mask", "none border-box content-box left top / auto repeat-x") is "none left top / auto repeat-x border-box content-box"
 PASS innerStyle("mask", "none border-box content-box right 0px center / auto repeat-x") is "none right 0px center / auto repeat-x border-box content-box"
-PASS computedStyle("mask", "top left") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "bottom right") is "none 100% 100% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "left bottom") is "none 0% 100% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "right top") is "none 100% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "center") is "none 50% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none top") is "none 50% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none bottom") is "none 50% 100% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none right") is "none 100% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none top right") is "none 100% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none bottom left") is "none 0% 100% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none right") is "none 100% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left") is "none 0% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "center 50%") is "none 50% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "50px 50%") is "none 50px 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "center left") is "none 0% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "top center") is "none 50% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "left 10px top 15px") is "none 10px 15px / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "left 10% top 30%") is "none 10% 30% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "right top 15px") is "none 100% 15px / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "left 10px center") is "none 10px 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "center top 20px") is "none 50% 20px / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "center left 30px") is "none 30px 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "left 20% top") is "none 20% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "center center") is "none 50% 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "repeat-x") is "none 0% 0% / auto repeat-x border-box border-box add match-source"
-PASS computedStyle("mask", "repeat-y") is "none 0% 0% / auto repeat-y border-box border-box add match-source"
-PASS computedStyle("mask", "repeat") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "space") is "none 0% 0% / auto space border-box border-box add match-source"
-PASS computedStyle("mask", "no-repeat") is "none 0% 0% / auto no-repeat border-box border-box add match-source"
-PASS computedStyle("mask", "repeat space") is "none 0% 0% / auto repeat space border-box border-box add match-source"
-PASS computedStyle("mask", "repeat round") is "none 0% 0% / auto repeat round border-box border-box add match-source"
-PASS computedStyle("mask", "repeat no-repeat") is "none 0% 0% / auto repeat-x border-box border-box add match-source"
-PASS computedStyle("mask", "repeat none") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none repeat") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "padding-box") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
-PASS computedStyle("mask", "border-box") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "content-box") is "none 0% 0% / auto repeat content-box content-box add match-source"
-PASS computedStyle("mask", "padding-box none") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
-PASS computedStyle("mask", "none padding-box") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
-PASS computedStyle("mask", "padding-box content-box") is "none 0% 0% / auto repeat padding-box content-box add match-source"
-PASS computedStyle("mask", "content-box content-box") is "none 0% 0% / auto repeat content-box content-box add match-source"
-PASS computedStyle("mask", "padding-box border-box") is "none 0% 0% / auto repeat padding-box border-box add match-source"
-PASS computedStyle("mask", "padding-box border-box none") is "none 0% 0% / auto repeat padding-box border-box add match-source"
-PASS computedStyle("mask", "none padding-box border-box") is "none 0% 0% / auto repeat padding-box border-box add match-source"
-PASS computedStyle("mask", "none left top / auto") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left top / auto auto") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left top / 100%") is "none 0% 0% / 100% repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left top / 0%") is "none 0% 0% / 0% repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left top / auto 0%") is "none 0% 0% / auto 0% repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left top / cover") is "none 0% 0% / cover repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left top / contain") is "none 0% 0% / contain repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left 20px top 10px / contain") is "none 20px 10px / contain repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none left 20px top / contain") is "none 20px 0% / contain repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none padding-box content-box") is "none 0% 0% / auto repeat padding-box content-box add match-source"
-PASS computedStyle("mask", "none padding-box") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
-PASS computedStyle("mask", "none top") is "none 50% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none center right 20px") is "none right 20px 50% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none border-box left top") is "none 0% 0% / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none border-box left top 20px") is "none 0% 20px / auto repeat border-box border-box add match-source"
-PASS computedStyle("mask", "none border-box content-box left top repeat-x") is "none 0% 0% / auto repeat-x border-box content-box add match-source"
-PASS computedStyle("mask", "none border-box content-box left top / auto repeat-x") is "none 0% 0% / auto repeat-x border-box content-box add match-source"
-PASS computedStyle("mask", "none border-box content-box right 0px center / auto repeat-x") is "none right 0px 50% / auto repeat-x border-box content-box add match-source"
+PASS computedStyle("mask", "top left") is "none"
+PASS computedStyle("mask", "bottom right") is "none"
+PASS computedStyle("mask", "left bottom") is "none"
+PASS computedStyle("mask", "right top") is "none"
+PASS computedStyle("mask", "center") is "none"
+PASS computedStyle("mask", "none top") is "none"
+PASS computedStyle("mask", "none bottom") is "none"
+PASS computedStyle("mask", "none right") is "none"
+PASS computedStyle("mask", "none top right") is "none"
+PASS computedStyle("mask", "none bottom left") is "none"
+PASS computedStyle("mask", "none right") is "none"
+PASS computedStyle("mask", "none left") is "none"
+PASS computedStyle("mask", "center 50%") is "none"
+PASS computedStyle("mask", "50px 50%") is "none"
+PASS computedStyle("mask", "center left") is "none"
+PASS computedStyle("mask", "top center") is "none"
+PASS computedStyle("mask", "left 10px top 15px") is "none"
+PASS computedStyle("mask", "left 10% top 30%") is "none"
+PASS computedStyle("mask", "right top 15px") is "none"
+PASS computedStyle("mask", "left 10px center") is "none"
+PASS computedStyle("mask", "center top 20px") is "none"
+PASS computedStyle("mask", "center left 30px") is "none"
+PASS computedStyle("mask", "left 20% top") is "none"
+PASS computedStyle("mask", "center center") is "none"
+PASS computedStyle("mask", "repeat-x") is "none"
+PASS computedStyle("mask", "repeat-y") is "none"
+PASS computedStyle("mask", "repeat") is "none"
+PASS computedStyle("mask", "space") is "none"
+PASS computedStyle("mask", "no-repeat") is "none"
+PASS computedStyle("mask", "repeat space") is "none"
+PASS computedStyle("mask", "repeat round") is "none"
+PASS computedStyle("mask", "repeat no-repeat") is "none"
+PASS computedStyle("mask", "repeat none") is "none"
+PASS computedStyle("mask", "none repeat") is "none"
+PASS computedStyle("mask", "padding-box") is "none"
+PASS computedStyle("mask", "border-box") is "none"
+PASS computedStyle("mask", "content-box") is "none"
+PASS computedStyle("mask", "padding-box none") is "none"
+PASS computedStyle("mask", "none padding-box") is "none"
+PASS computedStyle("mask", "padding-box content-box") is "none"
+PASS computedStyle("mask", "content-box content-box") is "none"
+PASS computedStyle("mask", "padding-box border-box") is "none"
+PASS computedStyle("mask", "padding-box border-box none") is "none"
+PASS computedStyle("mask", "none padding-box border-box") is "none"
+PASS computedStyle("mask", "none left top / auto") is "none"
+PASS computedStyle("mask", "none left top / auto auto") is "none"
+PASS computedStyle("mask", "none left top / 100%") is "none"
+PASS computedStyle("mask", "none left top / 0%") is "none"
+PASS computedStyle("mask", "none left top / auto 0%") is "none"
+PASS computedStyle("mask", "none left top / cover") is "none"
+PASS computedStyle("mask", "none left top / contain") is "none"
+PASS computedStyle("mask", "none left 20px top 10px / contain") is "none"
+PASS computedStyle("mask", "none left 20px top / contain") is "none"
+PASS computedStyle("mask", "none padding-box content-box") is "none"
+PASS computedStyle("mask", "none padding-box") is "none"
+PASS computedStyle("mask", "none top") is "none"
+PASS computedStyle("mask", "none center right 20px") is "none"
+PASS computedStyle("mask", "none border-box left top") is "none"
+PASS computedStyle("mask", "none border-box left top 20px") is "none"
+PASS computedStyle("mask", "none border-box content-box left top repeat-x") is "none"
+PASS computedStyle("mask", "none border-box content-box left top / auto repeat-x") is "none"
+PASS computedStyle("mask", "none border-box content-box right 0px center / auto repeat-x") is "none"
 PASS innerStyle("mask", "top none left") is ""
 PASS innerStyle("mask", "right none bottom") is ""
 PASS innerStyle("mask", "right right") is ""

Modified: branches/safari-613.1.17.0-branch/LayoutTests/fast/masking/parsing-mask.html (289645 => 289646)


--- branches/safari-613.1.17.0-branch/LayoutTests/fast/masking/parsing-mask.html	2022-02-11 19:57:58 UTC (rev 289645)
+++ branches/safari-613.1.17.0-branch/LayoutTests/fast/masking/parsing-mask.html	2022-02-11 19:58:30 UTC (rev 289646)
@@ -142,76 +142,76 @@
 testInner("mask", "none border-box content-box right 0px center / auto repeat-x", "none right 0px center / auto repeat-x border-box content-box");
 
 // test mask-position
-testComputed("mask", "top left", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "bottom right", "none 100% 100% / auto repeat border-box border-box add match-source");
-testComputed("mask", "left bottom", "none 0% 100% / auto repeat border-box border-box add match-source");
-testComputed("mask", "right top", "none 100% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "center", "none 50% 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none top", "none 50% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none bottom", "none 50% 100% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none right", "none 100% 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none top right", "none 100% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none bottom left", "none 0% 100% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none right", "none 100% 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none left", "none 0% 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "center 50%", "none 50% 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "50px 50%", "none 50px 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "center left", "none 0% 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "top center", "none 50% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "left 10px top 15px", "none 10px 15px / auto repeat border-box border-box add match-source");
-testComputed("mask", "left 10% top 30%", "none 10% 30% / auto repeat border-box border-box add match-source");
-testComputed("mask", "right top 15px", "none 100% 15px / auto repeat border-box border-box add match-source");
-testComputed("mask", "left 10px center", "none 10px 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "center top 20px", "none 50% 20px / auto repeat border-box border-box add match-source");
-testComputed("mask", "center left 30px", "none 30px 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "left 20% top", "none 20% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "center center", "none 50% 50% / auto repeat border-box border-box add match-source");
+testComputed("mask", "top left", "none");
+testComputed("mask", "bottom right", "none");
+testComputed("mask", "left bottom", "none");
+testComputed("mask", "right top", "none");
+testComputed("mask", "center", "none");
+testComputed("mask", "none top", "none");
+testComputed("mask", "none bottom", "none");
+testComputed("mask", "none right", "none");
+testComputed("mask", "none top right", "none");
+testComputed("mask", "none bottom left", "none");
+testComputed("mask", "none right", "none");
+testComputed("mask", "none left", "none");
+testComputed("mask", "center 50%", "none");
+testComputed("mask", "50px 50%", "none");
+testComputed("mask", "center left", "none");
+testComputed("mask", "top center", "none");
+testComputed("mask", "left 10px top 15px", "none");
+testComputed("mask", "left 10% top 30%", "none");
+testComputed("mask", "right top 15px", "none");
+testComputed("mask", "left 10px center", "none");
+testComputed("mask", "center top 20px", "none");
+testComputed("mask", "center left 30px", "none");
+testComputed("mask", "left 20% top", "none");
+testComputed("mask", "center center", "none");
 
 // test mask-repeat
-testComputed("mask", "repeat-x", "none 0% 0% / auto repeat-x border-box border-box add match-source");
-testComputed("mask", "repeat-y", "none 0% 0% / auto repeat-y border-box border-box add match-source");
-testComputed("mask", "repeat", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "space", "none 0% 0% / auto space border-box border-box add match-source");
-testComputed("mask", "no-repeat", "none 0% 0% / auto no-repeat border-box border-box add match-source");
-testComputed("mask", "repeat space", "none 0% 0% / auto repeat space border-box border-box add match-source");
-testComputed("mask", "repeat round", "none 0% 0% / auto repeat round border-box border-box add match-source");
-testComputed("mask", "repeat no-repeat", "none 0% 0% / auto repeat-x border-box border-box add match-source");
-testComputed("mask", "repeat none", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none repeat", "none 0% 0% / auto repeat border-box border-box add match-source");
+testComputed("mask", "repeat-x", "none");
+testComputed("mask", "repeat-y", "none");
+testComputed("mask", "repeat", "none");
+testComputed("mask", "space", "none");
+testComputed("mask", "no-repeat", "none");
+testComputed("mask", "repeat space", "none");
+testComputed("mask", "repeat round", "none");
+testComputed("mask", "repeat no-repeat", "none");
+testComputed("mask", "repeat none", "none");
+testComputed("mask", "none repeat", "none");
 
 // test mask-origin / mask-clip
-testComputed("mask", "padding-box", "none 0% 0% / auto repeat padding-box padding-box add match-source");
-testComputed("mask", "border-box", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "content-box", "none 0% 0% / auto repeat content-box content-box add match-source");
-testComputed("mask", "padding-box none", "none 0% 0% / auto repeat padding-box padding-box add match-source");
-testComputed("mask", "none padding-box", "none 0% 0% / auto repeat padding-box padding-box add match-source");
-testComputed("mask", "padding-box content-box", "none 0% 0% / auto repeat padding-box content-box add match-source");
-testComputed("mask", "content-box content-box", "none 0% 0% / auto repeat content-box content-box add match-source");
-testComputed("mask", "padding-box border-box", "none 0% 0% / auto repeat padding-box border-box add match-source");
-testComputed("mask", "padding-box border-box none", "none 0% 0% / auto repeat padding-box border-box add match-source");
-testComputed("mask", "none padding-box border-box", "none 0% 0% / auto repeat padding-box border-box add match-source");
+testComputed("mask", "padding-box", "none");
+testComputed("mask", "border-box", "none");
+testComputed("mask", "content-box", "none");
+testComputed("mask", "padding-box none", "none");
+testComputed("mask", "none padding-box", "none");
+testComputed("mask", "padding-box content-box", "none");
+testComputed("mask", "content-box content-box", "none");
+testComputed("mask", "padding-box border-box", "none");
+testComputed("mask", "padding-box border-box none", "none");
+testComputed("mask", "none padding-box border-box", "none");
 
 // test mask-size
-testComputed("mask", "none left top / auto", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none left top / auto auto", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none left top / 100%", "none 0% 0% / 100% repeat border-box border-box add match-source");
-testComputed("mask", "none left top / 0%", "none 0% 0% / 0% repeat border-box border-box add match-source");
-testComputed("mask", "none left top / auto 0%", "none 0% 0% / auto 0% repeat border-box border-box add match-source");
-testComputed("mask", "none left top / cover", "none 0% 0% / cover repeat border-box border-box add match-source");
-testComputed("mask", "none left top / contain", "none 0% 0% / contain repeat border-box border-box add match-source");
-testComputed("mask", "none left 20px top 10px / contain", "none 20px 10px / contain repeat border-box border-box add match-source");
-testComputed("mask", "none left 20px top / contain", "none 20px 0% / contain repeat border-box border-box add match-source");
+testComputed("mask", "none left top / auto", "none");
+testComputed("mask", "none left top / auto auto", "none");
+testComputed("mask", "none left top / 100%", "none");
+testComputed("mask", "none left top / 0%", "none");
+testComputed("mask", "none left top / auto 0%", "none");
+testComputed("mask", "none left top / cover", "none");
+testComputed("mask", "none left top / contain", "none");
+testComputed("mask", "none left 20px top 10px / contain", "none");
+testComputed("mask", "none left 20px top / contain", "none");
 
 // combinations
-testComputed("mask", "none padding-box content-box", "none 0% 0% / auto repeat padding-box content-box add match-source");
-testComputed("mask", "none padding-box", "none 0% 0% / auto repeat padding-box padding-box add match-source");
-testComputed("mask", "none top", "none 50% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none center right 20px", "none right 20px 50% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none border-box left top", "none 0% 0% / auto repeat border-box border-box add match-source");
-testComputed("mask", "none border-box left top 20px", "none 0% 20px / auto repeat border-box border-box add match-source");
-testComputed("mask", "none border-box content-box left top repeat-x", "none 0% 0% / auto repeat-x border-box content-box add match-source");
-testComputed("mask", "none border-box content-box left top / auto repeat-x", "none 0% 0% / auto repeat-x border-box content-box add match-source");
-testComputed("mask", "none border-box content-box right 0px center / auto repeat-x", "none right 0px 50% / auto repeat-x border-box content-box add match-source");
+testComputed("mask", "none padding-box content-box", "none");
+testComputed("mask", "none padding-box", "none");
+testComputed("mask", "none top", "none");
+testComputed("mask", "none center right 20px", "none");
+testComputed("mask", "none border-box left top", "none");
+testComputed("mask", "none border-box left top 20px", "none");
+testComputed("mask", "none border-box content-box left top repeat-x", "none");
+testComputed("mask", "none border-box content-box left top / auto repeat-x", "none");
+testComputed("mask", "none border-box content-box right 0px center / auto repeat-x", "none");
 
 // negative tests
 negativeTest("mask", "top none left");

Modified: branches/safari-613.1.17.0-branch/Source/WebCore/ChangeLog (289645 => 289646)


--- branches/safari-613.1.17.0-branch/Source/WebCore/ChangeLog	2022-02-11 19:57:58 UTC (rev 289645)
+++ branches/safari-613.1.17.0-branch/Source/WebCore/ChangeLog	2022-02-11 19:58:30 UTC (rev 289646)
@@ -1,3 +1,68 @@
+2022-02-11  Russell Epstein  <[email protected]>
+
+        Cherry-pick r289377. rdar://problem/88178304
+
+    Return 'none' for the computed style of mask when there are no mask images
+    https://bugs.webkit.org/show_bug.cgi?id=236265
+    <rdar://88178304>
+    
+    Patch by Matt Woodrow <[email protected]> on 2022-02-08
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    Rather than returning all the longhand properties, return 'none' if there are no
+    mask images. This no longer matches the behaviour of the 'background' property, but
+    better matches what other UAs do.
+    
+    Ideally we'd return the smallest possible canonical representation of the non-initial
+    property values, but this is a much simpler change to fix a compat regression.
+    
+    Test: fast/masking/parsing-mask.html
+    Updates expected results to match new behavior.
+    
+    * css/CSSComputedStyleDeclaration.cpp:
+    (WebCore::ComputedStyleExtractor::getLayerCount):
+    (WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue):
+    (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
+    (WebCore::ComputedStyleExtractor::getMaskShorthandValue):
+    * css/CSSComputedStyleDeclaration.h:
+    
+    LayoutTests:
+    
+    * fast/masking/parsing-mask-expected.txt:
+    * fast/masking/parsing-mask.html:
+    
+    Updated expected results to expect 'none' for all cases where there isn't an actual mask
+    image.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-08  Matt Woodrow  <[email protected]>
+
+            Return 'none' for the computed style of mask when there are no mask images
+            https://bugs.webkit.org/show_bug.cgi?id=236265
+            <rdar://88178304>
+
+            Reviewed by Dean Jackson.
+
+            Rather than returning all the longhand properties, return 'none' if there are no
+            mask images. This no longer matches the behaviour of the 'background' property, but
+            better matches what other UAs do.
+
+            Ideally we'd return the smallest possible canonical representation of the non-initial
+            property values, but this is a much simpler change to fix a compat regression.
+
+            Test: fast/masking/parsing-mask.html
+            Updates expected results to match new behavior.
+
+            * css/CSSComputedStyleDeclaration.cpp:
+            (WebCore::ComputedStyleExtractor::getLayerCount):
+            (WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue):
+            (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
+            (WebCore::ComputedStyleExtractor::getMaskShorthandValue):
+            * css/CSSComputedStyleDeclaration.h:
+
 2022-02-10  Alan Coon  <[email protected]>
 
         Cherry-pick r288434. rdar://problem/56436745

Modified: branches/safari-613.1.17.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (289645 => 289646)


--- branches/safari-613.1.17.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-02-11 19:57:58 UTC (rev 289645)
+++ branches/safari-613.1.17.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-02-11 19:58:30 UTC (rev 289646)
@@ -4419,14 +4419,19 @@
     size_t layerCount = 0;
     for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
         layerCount++;
+    if (layerCount == 1 && property == CSSPropertyMask && !layers.image())
+        return 0;
     return layerCount;
 }
 
-Ref<CSSValueList> ComputedStyleExtractor::getFillLayerPropertyShorthandValue(CSSPropertyID property, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty)
+RefPtr<CSSValue> ComputedStyleExtractor::getFillLayerPropertyShorthandValue(CSSPropertyID property, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty)
 {
     ASSERT(property == CSSPropertyBackground || property == CSSPropertyMask);
     size_t layerCount = getLayerCount(property);
-    ASSERT(layerCount);
+    if (!layerCount) {
+        ASSERT(property == CSSPropertyMask);
+        return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
+    }
 
     auto lastValue = lastLayerProperty != CSSPropertyInvalid ? propertyValue(lastLayerProperty, DoNotUpdateLayout) : nullptr;
     auto before = getCSSPropertyValuesForShorthandProperties(propertiesBeforeSlashSeparator);
@@ -4467,7 +4472,7 @@
 }
 
 
-Ref<CSSValueList> ComputedStyleExtractor::getBackgroundShorthandValue()
+RefPtr<CSSValue> ComputedStyleExtractor::getBackgroundShorthandValue()
 {
     static const CSSPropertyID propertiesBeforeSlashSeparator[] = { CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment, CSSPropertyBackgroundPosition };
     static const CSSPropertyID propertiesAfterSlashSeparator[] = { CSSPropertyBackgroundSize, CSSPropertyBackgroundOrigin, CSSPropertyBackgroundClip };
@@ -4475,7 +4480,7 @@
     return getFillLayerPropertyShorthandValue(CSSPropertyBackground, StylePropertyShorthand(CSSPropertyBackground, propertiesBeforeSlashSeparator), StylePropertyShorthand(CSSPropertyBackground, propertiesAfterSlashSeparator), CSSPropertyBackgroundColor);
 }
 
-Ref<CSSValueList> ComputedStyleExtractor::getMaskShorthandValue()
+RefPtr<CSSValue> ComputedStyleExtractor::getMaskShorthandValue()
 {
     static const CSSPropertyID propertiesBeforeSlashSeperator[2] = { CSSPropertyMaskImage, CSSPropertyMaskPosition };
     static const CSSPropertyID propertiesAfterSlashSeperator[6] = { CSSPropertyMaskSize, CSSPropertyMaskRepeat, CSSPropertyMaskOrigin, CSSPropertyMaskClip, CSSPropertyMaskComposite, CSSPropertyMaskMode };

Modified: branches/safari-613.1.17.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h (289645 => 289646)


--- branches/safari-613.1.17.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h	2022-02-11 19:57:58 UTC (rev 289645)
+++ branches/safari-613.1.17.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h	2022-02-11 19:58:30 UTC (rev 289646)
@@ -101,9 +101,9 @@
     RefPtr<CSSValueList> getCSSPropertyValuesFor4SidesShorthand(const StylePropertyShorthand&);
 
     size_t getLayerCount(CSSPropertyID);
-    Ref<CSSValueList> getFillLayerPropertyShorthandValue(CSSPropertyID, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty);
-    Ref<CSSValueList> getBackgroundShorthandValue();
-    Ref<CSSValueList> getMaskShorthandValue();
+    RefPtr<CSSValue> getFillLayerPropertyShorthandValue(CSSPropertyID, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty);
+    RefPtr<CSSValue> getBackgroundShorthandValue();
+    RefPtr<CSSValue> getMaskShorthandValue();
     Ref<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&);
 
     RefPtr<Element> m_element;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to