Changeset 289377 in webkit


Ignore:
Timestamp:
Feb 8, 2022 8:23:16 AM (5 months ago)
Author:
commit-queue@webkit.org
Message:

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 <Matt Woodrow> 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.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r289375 r289377  
     12022-02-08  Matt Woodrow  <mattwoodrow@apple.com>
     2
     3        Return 'none' for the computed style of mask when there are no mask images
     4        https://bugs.webkit.org/show_bug.cgi?id=236265
     5        <rdar://88178304>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * fast/masking/parsing-mask-expected.txt:
     10        * fast/masking/parsing-mask.html:
     11
     12        Updated expected results to expect 'none' for all cases where there isn't an actual mask
     13        image.
     14
    1152022-02-08  Diego Pino Garcia  <dpino@igalia.com>
    216
  • trunk/LayoutTests/fast/masking/parsing-mask-expected.txt

    r286795 r289377  
    9090PASS innerStyle("mask", "none border-box content-box left top / auto repeat-x") is "none left top / auto repeat-x border-box content-box"
    9191PASS 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"
    92 PASS computedStyle("mask", "top left") is "none 0% 0% / auto repeat border-box border-box add match-source"
    93 PASS computedStyle("mask", "bottom right") is "none 100% 100% / auto repeat border-box border-box add match-source"
    94 PASS computedStyle("mask", "left bottom") is "none 0% 100% / auto repeat border-box border-box add match-source"
    95 PASS computedStyle("mask", "right top") is "none 100% 0% / auto repeat border-box border-box add match-source"
    96 PASS computedStyle("mask", "center") is "none 50% 50% / auto repeat border-box border-box add match-source"
    97 PASS computedStyle("mask", "none top") is "none 50% 0% / auto repeat border-box border-box add match-source"
    98 PASS computedStyle("mask", "none bottom") is "none 50% 100% / auto repeat border-box border-box add match-source"
    99 PASS computedStyle("mask", "none right") is "none 100% 50% / auto repeat border-box border-box add match-source"
    100 PASS computedStyle("mask", "none top right") is "none 100% 0% / auto repeat border-box border-box add match-source"
    101 PASS computedStyle("mask", "none bottom left") is "none 0% 100% / auto repeat border-box border-box add match-source"
    102 PASS computedStyle("mask", "none right") is "none 100% 50% / auto repeat border-box border-box add match-source"
    103 PASS computedStyle("mask", "none left") is "none 0% 50% / auto repeat border-box border-box add match-source"
    104 PASS computedStyle("mask", "center 50%") is "none 50% 50% / auto repeat border-box border-box add match-source"
    105 PASS computedStyle("mask", "50px 50%") is "none 50px 50% / auto repeat border-box border-box add match-source"
    106 PASS computedStyle("mask", "center left") is "none 0% 50% / auto repeat border-box border-box add match-source"
    107 PASS computedStyle("mask", "top center") is "none 50% 0% / auto repeat border-box border-box add match-source"
    108 PASS computedStyle("mask", "left 10px top 15px") is "none 10px 15px / auto repeat border-box border-box add match-source"
    109 PASS computedStyle("mask", "left 10% top 30%") is "none 10% 30% / auto repeat border-box border-box add match-source"
    110 PASS computedStyle("mask", "right top 15px") is "none 100% 15px / auto repeat border-box border-box add match-source"
    111 PASS computedStyle("mask", "left 10px center") is "none 10px 50% / auto repeat border-box border-box add match-source"
    112 PASS computedStyle("mask", "center top 20px") is "none 50% 20px / auto repeat border-box border-box add match-source"
    113 PASS computedStyle("mask", "center left 30px") is "none 30px 50% / auto repeat border-box border-box add match-source"
    114 PASS computedStyle("mask", "left 20% top") is "none 20% 0% / auto repeat border-box border-box add match-source"
    115 PASS computedStyle("mask", "center center") is "none 50% 50% / auto repeat border-box border-box add match-source"
    116 PASS computedStyle("mask", "repeat-x") is "none 0% 0% / auto repeat-x border-box border-box add match-source"
    117 PASS computedStyle("mask", "repeat-y") is "none 0% 0% / auto repeat-y border-box border-box add match-source"
    118 PASS computedStyle("mask", "repeat") is "none 0% 0% / auto repeat border-box border-box add match-source"
    119 PASS computedStyle("mask", "space") is "none 0% 0% / auto space border-box border-box add match-source"
    120 PASS computedStyle("mask", "no-repeat") is "none 0% 0% / auto no-repeat border-box border-box add match-source"
    121 PASS computedStyle("mask", "repeat space") is "none 0% 0% / auto repeat space border-box border-box add match-source"
    122 PASS computedStyle("mask", "repeat round") is "none 0% 0% / auto repeat round border-box border-box add match-source"
    123 PASS computedStyle("mask", "repeat no-repeat") is "none 0% 0% / auto repeat-x border-box border-box add match-source"
    124 PASS computedStyle("mask", "repeat none") is "none 0% 0% / auto repeat border-box border-box add match-source"
    125 PASS computedStyle("mask", "none repeat") is "none 0% 0% / auto repeat border-box border-box add match-source"
    126 PASS computedStyle("mask", "padding-box") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
    127 PASS computedStyle("mask", "border-box") is "none 0% 0% / auto repeat border-box border-box add match-source"
    128 PASS computedStyle("mask", "content-box") is "none 0% 0% / auto repeat content-box content-box add match-source"
    129 PASS computedStyle("mask", "padding-box none") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
    130 PASS computedStyle("mask", "none padding-box") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
    131 PASS computedStyle("mask", "padding-box content-box") is "none 0% 0% / auto repeat padding-box content-box add match-source"
    132 PASS computedStyle("mask", "content-box content-box") is "none 0% 0% / auto repeat content-box content-box add match-source"
    133 PASS computedStyle("mask", "padding-box border-box") is "none 0% 0% / auto repeat padding-box border-box add match-source"
    134 PASS computedStyle("mask", "padding-box border-box none") is "none 0% 0% / auto repeat padding-box border-box add match-source"
    135 PASS computedStyle("mask", "none padding-box border-box") is "none 0% 0% / auto repeat padding-box border-box add match-source"
    136 PASS computedStyle("mask", "none left top / auto") is "none 0% 0% / auto repeat border-box border-box add match-source"
    137 PASS computedStyle("mask", "none left top / auto auto") is "none 0% 0% / auto repeat border-box border-box add match-source"
    138 PASS computedStyle("mask", "none left top / 100%") is "none 0% 0% / 100% repeat border-box border-box add match-source"
    139 PASS computedStyle("mask", "none left top / 0%") is "none 0% 0% / 0% repeat border-box border-box add match-source"
    140 PASS computedStyle("mask", "none left top / auto 0%") is "none 0% 0% / auto 0% repeat border-box border-box add match-source"
    141 PASS computedStyle("mask", "none left top / cover") is "none 0% 0% / cover repeat border-box border-box add match-source"
    142 PASS computedStyle("mask", "none left top / contain") is "none 0% 0% / contain repeat border-box border-box add match-source"
    143 PASS computedStyle("mask", "none left 20px top 10px / contain") is "none 20px 10px / contain repeat border-box border-box add match-source"
    144 PASS computedStyle("mask", "none left 20px top / contain") is "none 20px 0% / contain repeat border-box border-box add match-source"
    145 PASS computedStyle("mask", "none padding-box content-box") is "none 0% 0% / auto repeat padding-box content-box add match-source"
    146 PASS computedStyle("mask", "none padding-box") is "none 0% 0% / auto repeat padding-box padding-box add match-source"
    147 PASS computedStyle("mask", "none top") is "none 50% 0% / auto repeat border-box border-box add match-source"
    148 PASS computedStyle("mask", "none center right 20px") is "none right 20px 50% / auto repeat border-box border-box add match-source"
    149 PASS computedStyle("mask", "none border-box left top") is "none 0% 0% / auto repeat border-box border-box add match-source"
    150 PASS computedStyle("mask", "none border-box left top 20px") is "none 0% 20px / auto repeat border-box border-box add match-source"
    151 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"
    152 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"
    153 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"
     92PASS computedStyle("mask", "top left") is "none"
     93PASS computedStyle("mask", "bottom right") is "none"
     94PASS computedStyle("mask", "left bottom") is "none"
     95PASS computedStyle("mask", "right top") is "none"
     96PASS computedStyle("mask", "center") is "none"
     97PASS computedStyle("mask", "none top") is "none"
     98PASS computedStyle("mask", "none bottom") is "none"
     99PASS computedStyle("mask", "none right") is "none"
     100PASS computedStyle("mask", "none top right") is "none"
     101PASS computedStyle("mask", "none bottom left") is "none"
     102PASS computedStyle("mask", "none right") is "none"
     103PASS computedStyle("mask", "none left") is "none"
     104PASS computedStyle("mask", "center 50%") is "none"
     105PASS computedStyle("mask", "50px 50%") is "none"
     106PASS computedStyle("mask", "center left") is "none"
     107PASS computedStyle("mask", "top center") is "none"
     108PASS computedStyle("mask", "left 10px top 15px") is "none"
     109PASS computedStyle("mask", "left 10% top 30%") is "none"
     110PASS computedStyle("mask", "right top 15px") is "none"
     111PASS computedStyle("mask", "left 10px center") is "none"
     112PASS computedStyle("mask", "center top 20px") is "none"
     113PASS computedStyle("mask", "center left 30px") is "none"
     114PASS computedStyle("mask", "left 20% top") is "none"
     115PASS computedStyle("mask", "center center") is "none"
     116PASS computedStyle("mask", "repeat-x") is "none"
     117PASS computedStyle("mask", "repeat-y") is "none"
     118PASS computedStyle("mask", "repeat") is "none"
     119PASS computedStyle("mask", "space") is "none"
     120PASS computedStyle("mask", "no-repeat") is "none"
     121PASS computedStyle("mask", "repeat space") is "none"
     122PASS computedStyle("mask", "repeat round") is "none"
     123PASS computedStyle("mask", "repeat no-repeat") is "none"
     124PASS computedStyle("mask", "repeat none") is "none"
     125PASS computedStyle("mask", "none repeat") is "none"
     126PASS computedStyle("mask", "padding-box") is "none"
     127PASS computedStyle("mask", "border-box") is "none"
     128PASS computedStyle("mask", "content-box") is "none"
     129PASS computedStyle("mask", "padding-box none") is "none"
     130PASS computedStyle("mask", "none padding-box") is "none"
     131PASS computedStyle("mask", "padding-box content-box") is "none"
     132PASS computedStyle("mask", "content-box content-box") is "none"
     133PASS computedStyle("mask", "padding-box border-box") is "none"
     134PASS computedStyle("mask", "padding-box border-box none") is "none"
     135PASS computedStyle("mask", "none padding-box border-box") is "none"
     136PASS computedStyle("mask", "none left top / auto") is "none"
     137PASS computedStyle("mask", "none left top / auto auto") is "none"
     138PASS computedStyle("mask", "none left top / 100%") is "none"
     139PASS computedStyle("mask", "none left top / 0%") is "none"
     140PASS computedStyle("mask", "none left top / auto 0%") is "none"
     141PASS computedStyle("mask", "none left top / cover") is "none"
     142PASS computedStyle("mask", "none left top / contain") is "none"
     143PASS computedStyle("mask", "none left 20px top 10px / contain") is "none"
     144PASS computedStyle("mask", "none left 20px top / contain") is "none"
     145PASS computedStyle("mask", "none padding-box content-box") is "none"
     146PASS computedStyle("mask", "none padding-box") is "none"
     147PASS computedStyle("mask", "none top") is "none"
     148PASS computedStyle("mask", "none center right 20px") is "none"
     149PASS computedStyle("mask", "none border-box left top") is "none"
     150PASS computedStyle("mask", "none border-box left top 20px") is "none"
     151PASS computedStyle("mask", "none border-box content-box left top repeat-x") is "none"
     152PASS computedStyle("mask", "none border-box content-box left top / auto repeat-x") is "none"
     153PASS computedStyle("mask", "none border-box content-box right 0px center / auto repeat-x") is "none"
    154154PASS innerStyle("mask", "top none left") is ""
    155155PASS innerStyle("mask", "right none bottom") is ""
  • trunk/LayoutTests/fast/masking/parsing-mask.html

    r286795 r289377  
    143143
    144144// test mask-position
    145 testComputed("mask", "top left", "none 0% 0% / auto repeat border-box border-box add match-source");
    146 testComputed("mask", "bottom right", "none 100% 100% / auto repeat border-box border-box add match-source");
    147 testComputed("mask", "left bottom", "none 0% 100% / auto repeat border-box border-box add match-source");
    148 testComputed("mask", "right top", "none 100% 0% / auto repeat border-box border-box add match-source");
    149 testComputed("mask", "center", "none 50% 50% / auto repeat border-box border-box add match-source");
    150 testComputed("mask", "none top", "none 50% 0% / auto repeat border-box border-box add match-source");
    151 testComputed("mask", "none bottom", "none 50% 100% / auto repeat border-box border-box add match-source");
    152 testComputed("mask", "none right", "none 100% 50% / auto repeat border-box border-box add match-source");
    153 testComputed("mask", "none top right", "none 100% 0% / auto repeat border-box border-box add match-source");
    154 testComputed("mask", "none bottom left", "none 0% 100% / auto repeat border-box border-box add match-source");
    155 testComputed("mask", "none right", "none 100% 50% / auto repeat border-box border-box add match-source");
    156 testComputed("mask", "none left", "none 0% 50% / auto repeat border-box border-box add match-source");
    157 testComputed("mask", "center 50%", "none 50% 50% / auto repeat border-box border-box add match-source");
    158 testComputed("mask", "50px 50%", "none 50px 50% / auto repeat border-box border-box add match-source");
    159 testComputed("mask", "center left", "none 0% 50% / auto repeat border-box border-box add match-source");
    160 testComputed("mask", "top center", "none 50% 0% / auto repeat border-box border-box add match-source");
    161 testComputed("mask", "left 10px top 15px", "none 10px 15px / auto repeat border-box border-box add match-source");
    162 testComputed("mask", "left 10% top 30%", "none 10% 30% / auto repeat border-box border-box add match-source");
    163 testComputed("mask", "right top 15px", "none 100% 15px / auto repeat border-box border-box add match-source");
    164 testComputed("mask", "left 10px center", "none 10px 50% / auto repeat border-box border-box add match-source");
    165 testComputed("mask", "center top 20px", "none 50% 20px / auto repeat border-box border-box add match-source");
    166 testComputed("mask", "center left 30px", "none 30px 50% / auto repeat border-box border-box add match-source");
    167 testComputed("mask", "left 20% top", "none 20% 0% / auto repeat border-box border-box add match-source");
    168 testComputed("mask", "center center", "none 50% 50% / auto repeat border-box border-box add match-source");
     145testComputed("mask", "top left", "none");
     146testComputed("mask", "bottom right", "none");
     147testComputed("mask", "left bottom", "none");
     148testComputed("mask", "right top", "none");
     149testComputed("mask", "center", "none");
     150testComputed("mask", "none top", "none");
     151testComputed("mask", "none bottom", "none");
     152testComputed("mask", "none right", "none");
     153testComputed("mask", "none top right", "none");
     154testComputed("mask", "none bottom left", "none");
     155testComputed("mask", "none right", "none");
     156testComputed("mask", "none left", "none");
     157testComputed("mask", "center 50%", "none");
     158testComputed("mask", "50px 50%", "none");
     159testComputed("mask", "center left", "none");
     160testComputed("mask", "top center", "none");
     161testComputed("mask", "left 10px top 15px", "none");
     162testComputed("mask", "left 10% top 30%", "none");
     163testComputed("mask", "right top 15px", "none");
     164testComputed("mask", "left 10px center", "none");
     165testComputed("mask", "center top 20px", "none");
     166testComputed("mask", "center left 30px", "none");
     167testComputed("mask", "left 20% top", "none");
     168testComputed("mask", "center center", "none");
    169169
    170170// test mask-repeat
    171 testComputed("mask", "repeat-x", "none 0% 0% / auto repeat-x border-box border-box add match-source");
    172 testComputed("mask", "repeat-y", "none 0% 0% / auto repeat-y border-box border-box add match-source");
    173 testComputed("mask", "repeat", "none 0% 0% / auto repeat border-box border-box add match-source");
    174 testComputed("mask", "space", "none 0% 0% / auto space border-box border-box add match-source");
    175 testComputed("mask", "no-repeat", "none 0% 0% / auto no-repeat border-box border-box add match-source");
    176 testComputed("mask", "repeat space", "none 0% 0% / auto repeat space border-box border-box add match-source");
    177 testComputed("mask", "repeat round", "none 0% 0% / auto repeat round border-box border-box add match-source");
    178 testComputed("mask", "repeat no-repeat", "none 0% 0% / auto repeat-x border-box border-box add match-source");
    179 testComputed("mask", "repeat none", "none 0% 0% / auto repeat border-box border-box add match-source");
    180 testComputed("mask", "none repeat", "none 0% 0% / auto repeat border-box border-box add match-source");
     171testComputed("mask", "repeat-x", "none");
     172testComputed("mask", "repeat-y", "none");
     173testComputed("mask", "repeat", "none");
     174testComputed("mask", "space", "none");
     175testComputed("mask", "no-repeat", "none");
     176testComputed("mask", "repeat space", "none");
     177testComputed("mask", "repeat round", "none");
     178testComputed("mask", "repeat no-repeat", "none");
     179testComputed("mask", "repeat none", "none");
     180testComputed("mask", "none repeat", "none");
    181181
    182182// test mask-origin / mask-clip
    183 testComputed("mask", "padding-box", "none 0% 0% / auto repeat padding-box padding-box add match-source");
    184 testComputed("mask", "border-box", "none 0% 0% / auto repeat border-box border-box add match-source");
    185 testComputed("mask", "content-box", "none 0% 0% / auto repeat content-box content-box add match-source");
    186 testComputed("mask", "padding-box none", "none 0% 0% / auto repeat padding-box padding-box add match-source");
    187 testComputed("mask", "none padding-box", "none 0% 0% / auto repeat padding-box padding-box add match-source");
    188 testComputed("mask", "padding-box content-box", "none 0% 0% / auto repeat padding-box content-box add match-source");
    189 testComputed("mask", "content-box content-box", "none 0% 0% / auto repeat content-box content-box add match-source");
    190 testComputed("mask", "padding-box border-box", "none 0% 0% / auto repeat padding-box border-box add match-source");
    191 testComputed("mask", "padding-box border-box none", "none 0% 0% / auto repeat padding-box border-box add match-source");
    192 testComputed("mask", "none padding-box border-box", "none 0% 0% / auto repeat padding-box border-box add match-source");
     183testComputed("mask", "padding-box", "none");
     184testComputed("mask", "border-box", "none");
     185testComputed("mask", "content-box", "none");
     186testComputed("mask", "padding-box none", "none");
     187testComputed("mask", "none padding-box", "none");
     188testComputed("mask", "padding-box content-box", "none");
     189testComputed("mask", "content-box content-box", "none");
     190testComputed("mask", "padding-box border-box", "none");
     191testComputed("mask", "padding-box border-box none", "none");
     192testComputed("mask", "none padding-box border-box", "none");
    193193
    194194// test mask-size
    195 testComputed("mask", "none left top / auto", "none 0% 0% / auto repeat border-box border-box add match-source");
    196 testComputed("mask", "none left top / auto auto", "none 0% 0% / auto repeat border-box border-box add match-source");
    197 testComputed("mask", "none left top / 100%", "none 0% 0% / 100% repeat border-box border-box add match-source");
    198 testComputed("mask", "none left top / 0%", "none 0% 0% / 0% repeat border-box border-box add match-source");
    199 testComputed("mask", "none left top / auto 0%", "none 0% 0% / auto 0% repeat border-box border-box add match-source");
    200 testComputed("mask", "none left top / cover", "none 0% 0% / cover repeat border-box border-box add match-source");
    201 testComputed("mask", "none left top / contain", "none 0% 0% / contain repeat border-box border-box add match-source");
    202 testComputed("mask", "none left 20px top 10px / contain", "none 20px 10px / contain repeat border-box border-box add match-source");
    203 testComputed("mask", "none left 20px top / contain", "none 20px 0% / contain repeat border-box border-box add match-source");
     195testComputed("mask", "none left top / auto", "none");
     196testComputed("mask", "none left top / auto auto", "none");
     197testComputed("mask", "none left top / 100%", "none");
     198testComputed("mask", "none left top / 0%", "none");
     199testComputed("mask", "none left top / auto 0%", "none");
     200testComputed("mask", "none left top / cover", "none");
     201testComputed("mask", "none left top / contain", "none");
     202testComputed("mask", "none left 20px top 10px / contain", "none");
     203testComputed("mask", "none left 20px top / contain", "none");
    204204
    205205// combinations
    206 testComputed("mask", "none padding-box content-box", "none 0% 0% / auto repeat padding-box content-box add match-source");
    207 testComputed("mask", "none padding-box", "none 0% 0% / auto repeat padding-box padding-box add match-source");
    208 testComputed("mask", "none top", "none 50% 0% / auto repeat border-box border-box add match-source");
    209 testComputed("mask", "none center right 20px", "none right 20px 50% / auto repeat border-box border-box add match-source");
    210 testComputed("mask", "none border-box left top", "none 0% 0% / auto repeat border-box border-box add match-source");
    211 testComputed("mask", "none border-box left top 20px", "none 0% 20px / auto repeat border-box border-box add match-source");
    212 testComputed("mask", "none border-box content-box left top repeat-x", "none 0% 0% / auto repeat-x border-box content-box add match-source");
    213 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");
    214 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");
     206testComputed("mask", "none padding-box content-box", "none");
     207testComputed("mask", "none padding-box", "none");
     208testComputed("mask", "none top", "none");
     209testComputed("mask", "none center right 20px", "none");
     210testComputed("mask", "none border-box left top", "none");
     211testComputed("mask", "none border-box left top 20px", "none");
     212testComputed("mask", "none border-box content-box left top repeat-x", "none");
     213testComputed("mask", "none border-box content-box left top / auto repeat-x", "none");
     214testComputed("mask", "none border-box content-box right 0px center / auto repeat-x", "none");
    215215
    216216// negative tests
  • trunk/Source/WebCore/ChangeLog

    r289376 r289377  
     12022-02-08  Matt Woodrow  <mattwoodrow@apple.com>
     2
     3        Return 'none' for the computed style of mask when there are no mask images
     4        https://bugs.webkit.org/show_bug.cgi?id=236265
     5        <rdar://88178304>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Rather than returning all the longhand properties, return 'none' if there are no
     10        mask images. This no longer matches the behaviour of the 'background' property, but
     11        better matches what other UAs do.
     12
     13        Ideally we'd return the smallest possible canonical representation of the non-initial
     14        property values, but this is a much simpler change to fix a compat regression.
     15
     16        Test: fast/masking/parsing-mask.html
     17        Updates expected results to match new behavior.
     18
     19        * css/CSSComputedStyleDeclaration.cpp:
     20        (WebCore::ComputedStyleExtractor::getLayerCount):
     21        (WebCore::ComputedStyleExtractor::getFillLayerPropertyShorthandValue):
     22        (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
     23        (WebCore::ComputedStyleExtractor::getMaskShorthandValue):
     24        * css/CSSComputedStyleDeclaration.h:
     25
    1262022-02-08  Alan Bujtas  <zalan@apple.com>
    227
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r289225 r289377  
    44304430    for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
    44314431        layerCount++;
     4432    if (layerCount == 1 && property == CSSPropertyMask && !layers.image())
     4433        return 0;
    44324434    return layerCount;
    44334435}
    44344436
    4435 Ref<CSSValueList> ComputedStyleExtractor::getFillLayerPropertyShorthandValue(CSSPropertyID property, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty)
     4437RefPtr<CSSValue> ComputedStyleExtractor::getFillLayerPropertyShorthandValue(CSSPropertyID property, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty)
    44364438{
    44374439    ASSERT(property == CSSPropertyBackground || property == CSSPropertyMask);
    44384440    size_t layerCount = getLayerCount(property);
    4439     ASSERT(layerCount);
     4441    if (!layerCount) {
     4442        ASSERT(property == CSSPropertyMask);
     4443        return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
     4444    }
    44404445
    44414446    auto lastValue = lastLayerProperty != CSSPropertyInvalid ? propertyValue(lastLayerProperty, DoNotUpdateLayout) : nullptr;
     
    44784483
    44794484
    4480 Ref<CSSValueList> ComputedStyleExtractor::getBackgroundShorthandValue()
     4485RefPtr<CSSValue> ComputedStyleExtractor::getBackgroundShorthandValue()
    44814486{
    44824487    static const CSSPropertyID propertiesBeforeSlashSeparator[] = { CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment, CSSPropertyBackgroundPosition };
     
    44864491}
    44874492
    4488 Ref<CSSValueList> ComputedStyleExtractor::getMaskShorthandValue()
     4493RefPtr<CSSValue> ComputedStyleExtractor::getMaskShorthandValue()
    44894494{
    44904495    static const CSSPropertyID propertiesBeforeSlashSeperator[2] = { CSSPropertyMaskImage, CSSPropertyMaskPosition };
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h

    r287987 r289377  
    9595
    9696    size_t getLayerCount(CSSPropertyID);
    97     Ref<CSSValueList> getFillLayerPropertyShorthandValue(CSSPropertyID, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty);
    98     Ref<CSSValueList> getBackgroundShorthandValue();
    99     Ref<CSSValueList> getMaskShorthandValue();
     97    RefPtr<CSSValue> getFillLayerPropertyShorthandValue(CSSPropertyID, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty);
     98    RefPtr<CSSValue> getBackgroundShorthandValue();
     99    RefPtr<CSSValue> getMaskShorthandValue();
    100100    Ref<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&);
    101101
Note: See TracChangeset for help on using the changeset viewer.