Title: [268158] trunk
Revision
268158
Author
[email protected]
Date
2020-10-07 15:42:21 -0700 (Wed, 07 Oct 2020)

Log Message

background-clip:var(--a) invalidates -webkit-background-clip:text when --a:text
https://bugs.webkit.org/show_bug.cgi?id=199410

Patch by Tyler Wilcock <[email protected]> on 2020-10-07
Reviewed by Darin Adler.

Source/WebCore:

Parse the `text` value (CSSValueText) for the `background-clip`
property.  While the bug this patch is associated with is about CSS
variable interactions, the underlying issue is that we weren't parsing
the `text` value for `background-clip`.

https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-clip

This patch also removes the ability to parse the `-webkit-text` value
for the `background-origin` (CSSPropertyBackgroundOrigin) property by
removing `CSSValueWebkitText` from `consumeBackgroundBox`. Neither
`-webkit-text` nor the unprefixed `text` are valid values for this property.

https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-origin

Updated existing `fast/css/background-clip-text.html` test.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundBox): Removed `CSSValueWebkitText`.
(WebCore::consumeBackgroundClip): Added.
(WebCore::consumeBackgroundComponent): Use `consumeBackgroundClip` for
the `CSSPropertyBackgroundClip` property case.

LayoutTests:

We now parse the `text` value for the `background-clip` property, so
update this test to reflect that.

* fast/css/background-clip-text-expected.txt:
* fast/css/background-clip-text.html: Parse `text` value.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268157 => 268158)


--- trunk/LayoutTests/ChangeLog	2020-10-07 22:41:25 UTC (rev 268157)
+++ trunk/LayoutTests/ChangeLog	2020-10-07 22:42:21 UTC (rev 268158)
@@ -1,5 +1,18 @@
 2020-10-07  Tyler Wilcock  <[email protected]>
 
+        background-clip:var(--a) invalidates -webkit-background-clip:text when --a:text
+        https://bugs.webkit.org/show_bug.cgi?id=199410
+
+        Reviewed by Darin Adler.
+
+        We now parse the `text` value for the `background-clip` property, so
+        update this test to reflect that.
+
+        * fast/css/background-clip-text-expected.txt:
+        * fast/css/background-clip-text.html: Parse `text` value.
+
+2020-10-07  Tyler Wilcock  <[email protected]>
+
         Using CSS wide keywords as a fallback for variable substitution works inconsistently.
         https://bugs.webkit.org/show_bug.cgi?id=197158
 

Modified: trunk/LayoutTests/fast/css/background-clip-text-expected.txt (268157 => 268158)


--- trunk/LayoutTests/fast/css/background-clip-text-expected.txt	2020-10-07 22:41:25 UTC (rev 268157)
+++ trunk/LayoutTests/fast/css/background-clip-text-expected.txt	2020-10-07 22:42:21 UTC (rev 268158)
@@ -8,7 +8,7 @@
 PASS test("background-clip: content-box", "background-clip") is "content-box"
 PASS test("background-clip: padding-box", "background-clip") is "padding-box"
 PASS test("background-clip: border-box", "background-clip") is "border-box"
-PASS test("background-clip: text", "background-clip") is ""
+PASS test("background-clip: text", "background-clip") is "text"
 PASS test("background-clip: text", "-webkit-background-clip") is ""
 PASS test("-webkit-background-clip: -webkit-text", "background-clip") is ""
 PASS test("-webkit-background-clip: -webkit-text", "-webkit-background-clip") is "-webkit-text"
@@ -18,9 +18,13 @@
 PASS test("-webkit-mask: url() ", "background-clip") is ""
 PASS test("background: url() ", "background-clip") is "initial"
 PASS test("background: url() padding-box", "background-clip") is "padding-box"
+PASS test("background: url() text", "background-clip") is "text"
 PASS test("background: url() padding-box border-box", "background-clip") is "border-box"
+PASS test("background: url() padding-box text", "background-clip") is "text"
 PASS test("background: repeat content-box border-box url() ", "background-clip") is "border-box"
+PASS test("background: repeat content-box text url() ", "background-clip") is "text"
 PASS test("background: padding-box blue content-box url() repeat scroll ", "background-clip") is "content-box"
+PASS test("background: padding-box blue text url() repeat scroll ", "background-clip") is "text"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/css/background-clip-text.html (268157 => 268158)


--- trunk/LayoutTests/fast/css/background-clip-text.html	2020-10-07 22:41:25 UTC (rev 268157)
+++ trunk/LayoutTests/fast/css/background-clip-text.html	2020-10-07 22:42:21 UTC (rev 268158)
@@ -27,7 +27,7 @@
 shouldBe('test("background-clip: padding-box", "background-clip")', '"padding-box"');
 shouldBe('test("background-clip: border-box", "background-clip")', '"border-box"');
 
-shouldBeEqualToString('test("background-clip: text", "background-clip")', '');
+shouldBeEqualToString('test("background-clip: text", "background-clip")', 'text');
 shouldBeEqualToString('test("background-clip: text", "-webkit-background-clip")', '');
 
 shouldBeEqualToString('test("-webkit-background-clip: -webkit-text", "background-clip")', '');
@@ -41,9 +41,16 @@
 shouldBe('test("background: url() ", "background-clip")', '"initial"');
 
 shouldBe('test("background: url() padding-box", "background-clip")', '"padding-box"');
+shouldBe('test("background: url() text", "background-clip")', '"text"');
+
 shouldBe('test("background: url() padding-box border-box", "background-clip")', '"border-box"');
+shouldBe('test("background: url() padding-box text", "background-clip")', '"text"');
+
 shouldBe('test("background: repeat content-box border-box url() ", "background-clip")', '"border-box"');
+shouldBe('test("background: repeat content-box text url() ", "background-clip")', '"text"');
+
 shouldBe('test("background: padding-box blue content-box url() repeat scroll ", "background-clip")', '"content-box"');
+shouldBe('test("background: padding-box blue text url() repeat scroll ", "background-clip")', '"text"');
 </script>
 <script src=""
 </body>

Modified: trunk/Source/WebCore/ChangeLog (268157 => 268158)


--- trunk/Source/WebCore/ChangeLog	2020-10-07 22:41:25 UTC (rev 268157)
+++ trunk/Source/WebCore/ChangeLog	2020-10-07 22:42:21 UTC (rev 268158)
@@ -1,5 +1,34 @@
 2020-10-07  Tyler Wilcock  <[email protected]>
 
+        background-clip:var(--a) invalidates -webkit-background-clip:text when --a:text
+        https://bugs.webkit.org/show_bug.cgi?id=199410
+
+        Reviewed by Darin Adler.
+
+        Parse the `text` value (CSSValueText) for the `background-clip`
+        property.  While the bug this patch is associated with is about CSS
+        variable interactions, the underlying issue is that we weren't parsing
+        the `text` value for `background-clip`.
+
+        https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-clip
+
+        This patch also removes the ability to parse the `-webkit-text` value
+        for the `background-origin` (CSSPropertyBackgroundOrigin) property by
+        removing `CSSValueWebkitText` from `consumeBackgroundBox`. Neither
+        `-webkit-text` nor the unprefixed `text` are valid values for this property.
+
+        https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-origin
+
+        Updated existing `fast/css/background-clip-text.html` test.
+
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeBackgroundBox): Removed `CSSValueWebkitText`.
+        (WebCore::consumeBackgroundClip): Added.
+        (WebCore::consumeBackgroundComponent): Use `consumeBackgroundClip` for
+        the `CSSPropertyBackgroundClip` property case.
+
+2020-10-07  Tyler Wilcock  <[email protected]>
+
         Using CSS wide keywords as a fallback for variable substitution works inconsistently.
         https://bugs.webkit.org/show_bug.cgi?id=197158
 

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (268157 => 268158)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2020-10-07 22:41:25 UTC (rev 268157)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2020-10-07 22:42:21 UTC (rev 268158)
@@ -3170,9 +3170,16 @@
 
 static RefPtr<CSSPrimitiveValue> consumeBackgroundBox(CSSParserTokenRange& range)
 {
-    return consumeIdent<CSSValueBorderBox, CSSValuePaddingBox, CSSValueContentBox, CSSValueWebkitText>(range);
+    return consumeIdent<CSSValueBorderBox, CSSValuePaddingBox, CSSValueContentBox>(range);
 }
 
+static RefPtr<CSSPrimitiveValue> consumeBackgroundClip(CSSParserTokenRange& range)
+{
+    if (auto value = consumeBackgroundBox(range))
+        return value;
+    return consumeIdent<CSSValueText, CSSValueWebkitText>(range);
+}
+
 static RefPtr<CSSPrimitiveValue> consumeBackgroundComposite(CSSParserTokenRange& range)
 {
     return consumeIdentRange(range, CSSValueClear, CSSValuePlusLighter);
@@ -3240,7 +3247,7 @@
 {
     switch (property) {
     case CSSPropertyBackgroundClip:
-        return consumeBackgroundBox(range);
+        return consumeBackgroundClip(range);
     case CSSPropertyBackgroundBlendMode:
         return consumeBackgroundBlendMode(range);
     case CSSPropertyBackgroundAttachment:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to