[css-masking] Unprefix -webkit-clip-path
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2019 17:07:02 +0000 (17:07 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2019 17:07:02 +0000 (17:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187888

Reviewed by Simon Fraser.

LayoutTests/imported/mozilla:

Integrated test expectations do not match the actual expected
behavior. The reason is that the expectation files reference
resources from different documents - which is not supported by
WebKit. Since unprefixed clip-path wasn't supported either
the test passed.

* svg/svg-integration/clipPath-html-01-expected.xhtml:
* svg/svg-integration/clipPath-html-02-expected.xhtml:
* svg/svg-integration/clipPath-html-02.xhtml:
* svg/svg-integration/clipPath-html-03-expected.xhtml:
* svg/svg-integration/clipPath-html-04-expected.xhtml:
* svg/svg-integration/clipPath-html-05-expected.xhtml:
* svg/svg-integration/clipPath-html-06-expected.xhtml:

LayoutTests/imported/w3c:

Test started passing. Updating test results.

* web-platform-tests/css/css-masking/parsing/clip-path-computed-expected.txt:
* web-platform-tests/css/css-masking/parsing/clip-path-valid-expected.txt:
* web-platform-tests/css/css-shapes/basic-shape-circle-ellipse-serialization-expected.txt:
* web-platform-tests/css/css-shapes/shape-outside/formatting-context/shape-outside-formatting-context.tentative-expected.html:
        Test result is incorrect: Doesn't test the shifing of content when shape-outside is set.
* web-platform-tests/css/css-shapes/shape-outside/formatting-context/shape-outside-formatting-context.tentative.html:

Source/WebCore:

Unprefix -webkit-clip-path. Make clip-path alias the prefixed version.

We already have a wide variaty of pre-/unprexied clip-path tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialShadow):
(WebCore::SVGRenderStyle::y const):
(WebCore::SVGRenderStyle::initialClipperResource): Deleted.
(WebCore::SVGRenderStyle::clipperResource const): Deleted.
(WebCore::SVGRenderStyle::hasClipper const): Deleted.
(WebCore::SVGRenderStyle::setClipperResource): Deleted.
* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleResourceData::StyleResourceData):
(WebCore::StyleResourceData::operator== const):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/style/WillChangeData.cpp:
(WebCore::WillChangeData::propertyCreatesStackingContext):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeResources):
* rendering/svg/SVGResources.cpp:
(WebCore::SVGResources::buildCachedResources):

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

26 files changed:
LayoutTests/imported/mozilla/ChangeLog
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-01-expected.xhtml
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-02-expected.xhtml
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-02.xhtml
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-03-expected.xhtml
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-04-expected.xhtml
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-05-expected.xhtml
LayoutTests/imported/mozilla/svg/svg-integration/clipPath-html-06-expected.xhtml
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/basic-shape-circle-ellipse-serialization-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/shape-outside/formatting-context/shape-outside-formatting-context.tentative-expected.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/rendering/style/SVGRenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
Source/WebCore/rendering/style/SVGRenderStyleDefs.h
Source/WebCore/rendering/style/WillChangeData.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
Source/WebCore/rendering/svg/SVGResources.cpp

index 3f19f125ee92d6918937522d61a52b48677afc1e..7ff1186702d801d919b5ffb75ad8c4c2cc3092b7 100644 (file)
@@ -1,3 +1,24 @@
+2019-10-30  Dirk Schulze  <krit@webkit.org>
+
+        [css-masking] Unprefix -webkit-clip-path
+        https://bugs.webkit.org/show_bug.cgi?id=187888
+
+        Reviewed by Simon Fraser.
+
+        Integrated test expectations do not match the actual expected
+        behavior. The reason is that the expectation files reference
+        resources from different documents - which is not supported by
+        WebKit. Since unprefixed clip-path wasn't supported either
+        the test passed.
+
+        * svg/svg-integration/clipPath-html-01-expected.xhtml:
+        * svg/svg-integration/clipPath-html-02-expected.xhtml:
+        * svg/svg-integration/clipPath-html-02.xhtml:
+        * svg/svg-integration/clipPath-html-03-expected.xhtml:
+        * svg/svg-integration/clipPath-html-04-expected.xhtml:
+        * svg/svg-integration/clipPath-html-05-expected.xhtml:
+        * svg/svg-integration/clipPath-html-06-expected.xhtml:
+
 2019-10-25  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Update WPT tests related to Web Animations and remove imported Mozilla tests
index 7751e5f1fb9ce6390823b70205f1a857b96dd51f..f57d8655a9b0984ae4eab671d559265eb6d03292 100644 (file)
@@ -6,10 +6,6 @@
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">
 <body style="margin:0">
-  <div style="position:absolute; top:0; left:0; clip-path: url(clipPath-html-01.xhtml#c1); width:500px; height:500px; background:lime;"></div>
-  <svg:svg height="0">
-    <!-- use an empty g to force clipPath-html-01.xhtml to load before onload -->
-    <svg:use xlink:href="clipPath-html-01.xhtml#empty" />
-  </svg:svg>
+  <div style="position:absolute; top:0; left:250px; width:250px; height:500px; background:lime;"></div>
 </body>
 </html>
index 433d5d471f5d30afa488a8a8865f0fad9e18b710..b0ec0624ce0bc1e7bedd48833e3cf4311c20e9a2 100644 (file)
@@ -6,13 +6,9 @@
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">
 <body style="margin:0">
-  <div style="clip-path: url(clipPath-html-02.xhtml#c1); width:500px; height:200px; background:lime;">
+  <div style="width:500px; height:200px; background:lime;">
     <div style="height:200px;"/>
     <div style="height:200px; background:blue;"/>
   </div>
-  <svg:svg height="0">
-    <!-- use an empty g to force clipPath-html-02.xhtml to load before onload -->
-    <svg:use xlink:href="clipPath-html-02.xhtml#empty" />
-  </svg:svg>
 </body>
 </html>
index 8429e71c7ad9ba6462e99d08e23b1ffd2796c2e3..452af52a09a48f068b064b22e7efad66984064cb 100644 (file)
@@ -6,7 +6,7 @@
       xmlns:svg="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">
 <body style="margin:0">
-  <div style="clip-path: url(#c1); width:500px; height:200px; background:lime;">
+  <div style="clip-path: url(#c1); width:500px; height:500px; background:lime;">
     <div style="height:200px;"/>
     <div style="height:200px; background:blue;"/>
   </div>
index fb0d8e87cf7f6d7453db6e02c60bfd518da8d9d9..bf450121946ce06690db13b30935e4849fd9cdee 100644 (file)
@@ -6,13 +6,10 @@
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">
 <body style="margin:0">
-  <div style="clip-path: url(clipPath-html-03.xhtml#c1); width:500px; height:200px; background:lime;">
-    <div style="height:200px;"/>
-    <div style="height:200px; background:blue;"/>
-  </div>
-  <svg:svg height="0">
-    <!-- use an empty g to force clipPath-html-03.xhtml to load before onload -->
-    <svg:use xlink:href="clipPath-html-03.xhtml#empty" />
+  <svg:svg width="200" height="300">
+    <svg:rect width="200" height="150" fill="lime"/>
+    <svg:rect x="100" y="150" width="100" height="50" fill="lime"/>
+    <svg:rect x="100" y="200" width="100" height="100" fill="blue"/>
   </svg:svg>
 </body>
 </html>
index 4f35f255bfb0b19740827fd6ea610a4d8f9e1c9d..106b439d2cd7808785d0c29c64ab2408ba26cc9c 100644 (file)
 </head>
 <body style="margin:0; width:350px; line-height:100px;">
   <span class="unit"/><span class="unit"
-  /><span style="clip-path:url(clipPath-html-04.xhtml#c1); background:lime;"><span class="unit"/><span class="unit"
+  /><span style="-webkit-clip-path:polygon(50px 0, 250px 0, 250px 200px, 50px 200px); background:lime;"><span class="unit"/><span class="unit"
   /></span>
-  <svg:svg height="0">
-    <!-- use an empty g to force clipPath-html-04.xhtml to load before onload -->
-    <svg:use xlink:href="clipPath-html-04.xhtml#empty" />
-  </svg:svg>
 </body>
 </html>
index 6d4e7c8972fcf0f4539dd225e90d5ce27e0c7467..a9c32330a3b7c688afbdd1cfbd2ff3aa3f89f90a 100644 (file)
 </head>
 <body style="margin:0; width:350px; line-height:100px;">
   <span class="unit"/><span class="unit"
-  /><span style="clip-path:url(clipPath-html-05.xhtml#c1); background:lime;"><span class="unit"/><span class="unit"
+  /><span style="-webkit-clip-path: polygon(10% 0, 90% 0, 90% 100%, 10% 100%); background:lime;"><span class="unit"/><span class="unit"
   /></span>
-  <svg:svg height="0">
-    <!-- use an empty g to force clipPath-html-05.xhtml to load before onload -->
-    <svg:use xlink:href="clipPath-html-05.xhtml#empty" />
-  </svg:svg>
 </body>
 </html>
index 339bc629a4a59160344099d306c5128b2ebff00d..8e52f85ae811b047f18290b1ace052bb5f8a62bf 100644 (file)
@@ -11,7 +11,7 @@
 </style>
 </head>
 <body style="margin:0">
-  <span style="clip-path: url(clipPath-html-06.xhtml#c1);">
+  <span style="-webkit-clip-path: polygon(0 50%, 50% 50%, 50% 100%, 0 100%);">
     <span class="unit" style="background:lime;"></span>
     <div style="height:200px; width:100px;"/>
     <span class="unit" style="background:lime;"></span>
index fb0340e9e5d13c05684b04f04f533835db932e63..bc3fd7732e0f10380918978feba35279aaa29448 100644 (file)
@@ -1,3 +1,19 @@
+2019-10-30  Dirk Schulze  <krit@webkit.org>
+
+        [css-masking] Unprefix -webkit-clip-path
+        https://bugs.webkit.org/show_bug.cgi?id=187888
+
+        Reviewed by Simon Fraser.
+
+        Test started passing. Updating test results.
+
+        * web-platform-tests/css/css-masking/parsing/clip-path-computed-expected.txt:
+        * web-platform-tests/css/css-masking/parsing/clip-path-valid-expected.txt:
+        * web-platform-tests/css/css-shapes/basic-shape-circle-ellipse-serialization-expected.txt:
+        * web-platform-tests/css/css-shapes/shape-outside/formatting-context/shape-outside-formatting-context.tentative-expected.html:
+                Test result is incorrect: Doesn't test the shifing of content when shape-outside is set.
+        * web-platform-tests/css/css-shapes/shape-outside/formatting-context/shape-outside-formatting-context.tentative.html:
+
 2019-10-30  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, unskip imported/w3c/web-platform-tests/cors/credentials-flag.htm
index c8912a488cc3eb440ccc316e6df7893b4301ab05..bffe2cea367dd67660c80821102b695f9f1f4966 100644 (file)
@@ -1,6 +1,6 @@
 
-FAIL Property clip-path value 'circle(calc(10px + 0.5em) at -50% 50%)' computes to 'circle(30px at -50% 50%)' assert_true: 'circle(calc(10px + 0.5em) at -50% 50%)' is a supported value for clip-path. expected true got false
-FAIL Property clip-path value 'circle(calc(10px - 0.5em) at 50% -50%)' computes to 'circle(0px at 50% -50%)' assert_true: 'circle(calc(10px - 0.5em) at 50% -50%)' is a supported value for clip-path. expected true got false
-FAIL Property clip-path value 'ellipse(at 50% 50%)' computes to 'ellipse(at 50% 50%)' assert_true: 'ellipse(at 50% 50%)' is a supported value for clip-path. expected true got false
-FAIL Property clip-path value 'ellipse(60% closest-side at 50% 50%)' computes to 'ellipse(60% closest-side at 50% 50%)' assert_true: 'ellipse(60% closest-side at 50% 50%)' is a supported value for clip-path. expected true got false
+PASS Property clip-path value 'circle(calc(10px + 0.5em) at -50% 50%)' computes to 'circle(30px at -50% 50%)' 
+PASS Property clip-path value 'circle(calc(10px - 0.5em) at 50% -50%)' computes to 'circle(0px at 50% -50%)' 
+PASS Property clip-path value 'ellipse(at 50% 50%)' computes to 'ellipse(at 50% 50%)' 
+PASS Property clip-path value 'ellipse(60% closest-side at 50% 50%)' computes to 'ellipse(60% closest-side at 50% 50%)' 
 
index eee62f9ad8394e74a06819c8b08ced69650b70ef..26a74708235cf0718a3012dcf961019b34aa8552 100644 (file)
@@ -1,37 +1,37 @@
 
 PASS e.style['clip-path'] = "none" should set the property value 
-FAIL e.style['clip-path'] = "inset(100%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0 1px)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0px 1px 2%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0px 1px 2% 3em)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0px round 100%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0px round 0 1px)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0px round 0px 1px 2%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(0px round 0px 1px 2% 3em)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "inset(10px round 20% / 0px 1px 2% 3em)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle()" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle(1px)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle(closest-side)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle(at 10% 20%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle(farthest-side at center top)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle(4% at top right)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "ellipse()" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "ellipse(1px closest-side)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "ellipse(at 10% 20%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "ellipse(closest-side closest-side at 10% 20%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "ellipse(farthest-side 4% at bottom left)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "polygon(1% 2%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "polygon(nonzero, 1px 2px, 3em 4em)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "polygon(evenodd, 1px 2px, 3em 4em, 5pt 6%)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "border-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "padding-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "content-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "margin-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "fill-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "stroke-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "view-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "circle(7% at 8% 9%) border-box" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['clip-path'] = "border-box circle(7% at 8% 9%)" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['clip-path'] = "inset(100%)" should set the property value 
+PASS e.style['clip-path'] = "inset(0 1px)" should set the property value 
+PASS e.style['clip-path'] = "inset(0px 1px 2%)" should set the property value 
+PASS e.style['clip-path'] = "inset(0px 1px 2% 3em)" should set the property value 
+PASS e.style['clip-path'] = "inset(0px round 100%)" should set the property value 
+PASS e.style['clip-path'] = "inset(0px round 0 1px)" should set the property value 
+PASS e.style['clip-path'] = "inset(0px round 0px 1px 2%)" should set the property value 
+PASS e.style['clip-path'] = "inset(0px round 0px 1px 2% 3em)" should set the property value 
+PASS e.style['clip-path'] = "inset(10px round 20% / 0px 1px 2% 3em)" should set the property value 
+PASS e.style['clip-path'] = "circle()" should set the property value 
+PASS e.style['clip-path'] = "circle(1px)" should set the property value 
+PASS e.style['clip-path'] = "circle(closest-side)" should set the property value 
+PASS e.style['clip-path'] = "circle(at 10% 20%)" should set the property value 
+PASS e.style['clip-path'] = "circle(farthest-side at center top)" should set the property value 
+PASS e.style['clip-path'] = "circle(4% at top right)" should set the property value 
+PASS e.style['clip-path'] = "ellipse()" should set the property value 
+PASS e.style['clip-path'] = "ellipse(1px closest-side)" should set the property value 
+PASS e.style['clip-path'] = "ellipse(at 10% 20%)" should set the property value 
+PASS e.style['clip-path'] = "ellipse(closest-side closest-side at 10% 20%)" should set the property value 
+PASS e.style['clip-path'] = "ellipse(farthest-side 4% at bottom left)" should set the property value 
+PASS e.style['clip-path'] = "polygon(1% 2%)" should set the property value 
+PASS e.style['clip-path'] = "polygon(nonzero, 1px 2px, 3em 4em)" should set the property value 
+PASS e.style['clip-path'] = "polygon(evenodd, 1px 2px, 3em 4em, 5pt 6%)" should set the property value 
+PASS e.style['clip-path'] = "border-box" should set the property value 
+PASS e.style['clip-path'] = "padding-box" should set the property value 
+PASS e.style['clip-path'] = "content-box" should set the property value 
+PASS e.style['clip-path'] = "margin-box" should set the property value 
+PASS e.style['clip-path'] = "fill-box" should set the property value 
+PASS e.style['clip-path'] = "stroke-box" should set the property value 
+PASS e.style['clip-path'] = "view-box" should set the property value 
+PASS e.style['clip-path'] = "circle(7% at 8% 9%) border-box" should set the property value 
+PASS e.style['clip-path'] = "border-box circle(7% at 8% 9%)" should set the property value 
 PASS e.style['clip-path'] = "url(https://example.com/)" should set the property value 
 PASS e.style['clip-path'] = "url(\"https://example.com/\")" should set the property value 
 
index 8e9968219b468678593a9f7281d73d77eade7d90..c79a823f7680d329c06a31ee5c872cca87dc1885 100644 (file)
@@ -1,29 +1,29 @@
 
-FAIL Serialization of basic shapes assert_equals: circle(at left bottom) expected "circle(at 0% 100%)" but got ""
-FAIL Serialization of basic shapes 1 assert_equals: circle(at bottom left) expected "circle(at 0% 100%)" but got ""
-FAIL Serialization of basic shapes 2 assert_equals: circle(at right calc(10% + 5px)) expected "circle(at 100% calc(10% + 5px))" but got ""
-FAIL Serialization of basic shapes 3 assert_equals: ellipse(at left bottom) expected "ellipse(at 0% 100%)" but got ""
-FAIL Serialization of basic shapes 4 assert_equals: ellipse(at bottom left) expected "ellipse(at 0% 100%)" but got ""
-FAIL Serialization of basic shapes 5 assert_equals: ellipse(at right calc(10% + 5px)) expected "ellipse(at 100% calc(10% + 5px))" but got ""
-FAIL Serialization of basic shapes 6 assert_equals: circle() expected "circle(at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 7 assert_equals: circle(0px) expected "circle(0px at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 8 assert_equals: circle(closest-side) expected "circle(at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 9 assert_equals: circle(farthest-side) expected "circle(farthest-side at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 10 assert_equals: ellipse() expected "ellipse(at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 11 assert_equals: ellipse(closest-side farthest-side) expected "ellipse(closest-side farthest-side at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 12 assert_equals: circle(at top 0% right 5px) expected "circle(at right 5px top 0%)" but got ""
-FAIL Serialization of basic shapes 13 assert_equals: ellipse(at top 0% right 10px) expected "ellipse(at right 10px top 0%)" but got ""
-FAIL Serialization of basic shapes 14 assert_equals: circle(closest-side at center) expected "circle(at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 15 assert_equals: ellipse(closest-side closest-side at center) expected "ellipse(at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 16 assert_equals: circle(farthest-side at center) expected "circle(farthest-side at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 17 assert_equals: circle(10px at center) expected "circle(10px at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 18 assert_equals: ellipse(farthest-side 10px at center) expected "ellipse(farthest-side 10px at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 19 assert_equals: ellipse(closest-side farthest-side at 50% 50%) expected "ellipse(closest-side farthest-side at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 20 assert_equals: ellipse(closest-side 10% at 50% 50%) expected "ellipse(closest-side 10% at 50% 50%)" but got ""
-FAIL Serialization of basic shapes 21 assert_equals: circle(at right 5px bottom 10px) expected "circle(at right 5px bottom 10px)" but got ""
-FAIL Serialization of basic shapes 22 assert_equals: ellipse(at right 5px bottom 10px) expected "ellipse(at right 5px bottom 10px)" but got ""
-FAIL Serialization of basic shapes 23 assert_equals: circle(at right 5% top 0px) expected "circle(at 95% 0%)" but got ""
-FAIL Serialization of basic shapes 24 assert_equals: ellipse(at right 5% top 0px) expected "ellipse(at 95% 0%)" but got ""
-FAIL Serialization of basic shapes 25 assert_equals: circle(at right calc(10% + 5px) bottom calc(10% + 5px)) expected "circle(at right calc(10% + 5px) bottom calc(10% + 5px))" but got ""
-FAIL Serialization of basic shapes 26 assert_equals: ellipse(at right calc(10% + 5px) bottom calc(10% + 5px)) expected "ellipse(at right calc(10% + 5px) bottom calc(10% + 5px))" but got ""
+PASS Serialization of basic shapes 
+PASS Serialization of basic shapes 1 
+PASS Serialization of basic shapes 2 
+PASS Serialization of basic shapes 3 
+PASS Serialization of basic shapes 4 
+PASS Serialization of basic shapes 5 
+PASS Serialization of basic shapes 6 
+PASS Serialization of basic shapes 7 
+PASS Serialization of basic shapes 8 
+PASS Serialization of basic shapes 9 
+PASS Serialization of basic shapes 10 
+PASS Serialization of basic shapes 11 
+PASS Serialization of basic shapes 12 
+PASS Serialization of basic shapes 13 
+PASS Serialization of basic shapes 14 
+PASS Serialization of basic shapes 15 
+PASS Serialization of basic shapes 16 
+PASS Serialization of basic shapes 17 
+PASS Serialization of basic shapes 18 
+PASS Serialization of basic shapes 19 
+PASS Serialization of basic shapes 20 
+PASS Serialization of basic shapes 21 
+PASS Serialization of basic shapes 22 
+PASS Serialization of basic shapes 23 
+PASS Serialization of basic shapes 24 
+PASS Serialization of basic shapes 25 
+PASS Serialization of basic shapes 26 
 
index a59bc3767dadbd36a345ceb0bc04fdc8b08389e6..5e380a27a088e1e8e67bd12e7dfab6ba18a974d8 100644 (file)
@@ -1,3 +1,43 @@
+2019-10-30  Dirk Schulze  <krit@webkit.org>
+
+        [css-masking] Unprefix -webkit-clip-path
+        https://bugs.webkit.org/show_bug.cgi?id=187888
+
+        Reviewed by Simon Fraser.
+
+        Unprefix -webkit-clip-path. Make clip-path alias the prefixed version.
+
+        We already have a wide variaty of pre-/unprexied clip-path tests.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
+        * css/CSSProperties.json:
+        * css/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::svgPropertyValue):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * rendering/style/SVGRenderStyle.h:
+        (WebCore::SVGRenderStyle::initialShadow):
+        (WebCore::SVGRenderStyle::y const):
+        (WebCore::SVGRenderStyle::initialClipperResource): Deleted.
+        (WebCore::SVGRenderStyle::clipperResource const): Deleted.
+        (WebCore::SVGRenderStyle::hasClipper const): Deleted.
+        (WebCore::SVGRenderStyle::setClipperResource): Deleted.
+        * rendering/style/SVGRenderStyleDefs.cpp:
+        (WebCore::StyleResourceData::StyleResourceData):
+        (WebCore::StyleResourceData::operator== const):
+        * rendering/style/SVGRenderStyleDefs.h:
+        * rendering/style/WillChangeData.cpp:
+        (WebCore::WillChangeData::propertyCreatesStackingContext):
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
+        * rendering/svg/SVGRenderTreeAsText.cpp:
+        (WebCore::writeResources):
+        * rendering/svg/SVGResources.cpp:
+        (WebCore::SVGResources::buildCachedResources):
+
 2019-10-30  Philippe Normand  <philn@igalia.com>
 
         REGRESSION(r249428): [GStreamer] VP9 video rendered green
index 1cae3b5bc423f483557b863bd7bab89684b0fb4c..51fa59c041c3b925e1a349a64fe65025ddd1a3eb 100644 (file)
@@ -3542,7 +3542,7 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty
             return counterToCSSValue(style, propertyID);
         case CSSPropertyCounterReset:
             return counterToCSSValue(style, propertyID);
-        case CSSPropertyWebkitClipPath: {
+        case CSSPropertyClipPath: {
             auto* operation = style.clipPath();
             if (!operation)
                 return cssValuePool.createIdentifierValue(CSSValueNone);
@@ -3843,7 +3843,6 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty
 #endif
 
         case CSSPropertyBufferedRendering:
-        case CSSPropertyClipPath:
         case CSSPropertyClipRule:
         case CSSPropertyMask:
         case CSSPropertyEnableBackground:
index 92ebc0bba76f148b73c68a95c4c532a109619b47..bbc9beed06f2ef7a3d094a552fd0ef6d71f7926d 100644 (file)
                 "url": "https://www.w3.org/TR/CSS22/visufx.html#propdef-clip"
             }
         },
-        "-webkit-clip-path": {
-            "codegen-properties": {
-                "converter": "ClipPath"
-            }
-        },
         "clip-path": {
             "codegen-properties": {
-                "name-for-methods": "ClipperResource",
-                "converter": "SVGURIReference",
-                "svg": true
-            },
-            "specification": {
-                "category": "css-masking",
-                "url": "https://www.w3.org/TR/css-masking-1/#the-clip-path"
+                "aliases": [
+                    "-webkit-clip-path"
+                ],
+                "converter": "ClipPath"
             }
         },
         "clip-rule": {
index 58271b347238a05c1e4ca15ed1bd45b86cf850fb..13515441e5c44ff74b573952edc85e986cf91c0b 100644 (file)
@@ -120,10 +120,6 @@ RefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID property
         return CSSPrimitiveValue::create(svgStyle.dominantBaseline());
     case CSSPropertyTextAnchor:
         return CSSPrimitiveValue::create(svgStyle.textAnchor());
-    case CSSPropertyClipPath:
-        if (!svgStyle.clipperResource().isEmpty())
-            return CSSPrimitiveValue::create(svgStyle.clipperResource(), CSSPrimitiveValue::CSS_URI);
-        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
     case CSSPropertyMask:
         if (!svgStyle.maskerResource().isEmpty())
             return CSSPrimitiveValue::create(svgStyle.maskerResource(), CSSPrimitiveValue::CSS_URI);
index f5098e309d873ad62e1bdac6fa8794fd755cd751..a4f28990cc7bf529d741c82630145a01cc28d635 100644 (file)
@@ -2586,7 +2586,7 @@ static RefPtr<CSSValue> consumeBasicShapeOrBox(CSSParserTokenRange& range, const
     return list;
 }
     
-static RefPtr<CSSValue> consumeWebkitClipPath(CSSParserTokenRange& range, const CSSParserContext& context)
+static RefPtr<CSSValue> consumeClipPath(CSSParserTokenRange& range, const CSSParserContext& context)
 {
     if (range.peek().id() == CSSValueNone)
         return consumeIdent(range);
@@ -4074,7 +4074,6 @@ RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS
     case CSSPropertyMarkerStart:
     case CSSPropertyMarkerMid:
     case CSSPropertyMarkerEnd:
-    case CSSPropertyClipPath:
     case CSSPropertyMask:
         return consumeNoneOrURI(m_range);
     case CSSPropertyFlexBasis:
@@ -4146,8 +4145,8 @@ RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS
         return consumeVerticalAlign(m_range, m_context.mode);
     case CSSPropertyShapeOutside:
         return consumeShapeOutside(m_range, m_context);
-    case CSSPropertyWebkitClipPath:
-        return consumeWebkitClipPath(m_range, m_context);
+    case CSSPropertyClipPath:
+        return consumeClipPath(m_range, m_context);
     case CSSPropertyJustifyContent:
         // justify-content property does not allow the <baseline-position> values.
         if (isBaselineKeyword(m_range.peek().id()))
index 6f64cc6ea8d6a238064c3c31f3be79e747d11b1e..5991bf7b96f73074835a5abc96694d1c76a28eba 100644 (file)
@@ -1646,7 +1646,7 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
 #endif
         new PropertyWrapperFilter(CSSPropertyAppleColorFilter, &RenderStyle::appleColorFilter, &RenderStyle::setAppleColorFilter),
 
-        new PropertyWrapperClipPath(CSSPropertyWebkitClipPath, &RenderStyle::clipPath, &RenderStyle::setClipPath),
+        new PropertyWrapperClipPath(CSSPropertyClipPath, &RenderStyle::clipPath, &RenderStyle::setClipPath),
 
         new PropertyWrapperShape(CSSPropertyShapeOutside, &RenderStyle::shapeOutside, &RenderStyle::setShapeOutside),
         new LengthPropertyWrapper(CSSPropertyShapeMargin, &RenderStyle::shapeMargin, &RenderStyle::setShapeMargin),
index 9532129af2d07966be9839218d54399184c20d7f..fe3f1dbc8fa3975f5786c28ffc81814f45398b48 100644 (file)
@@ -76,7 +76,6 @@ public:
     static Color initialFloodColor() { return Color(0, 0, 0); }
     static Color initialLightingColor() { return Color(255, 255, 255); }
     static ShadowData* initialShadow() { return nullptr; }
-    static String initialClipperResource() { return String(); }
     static String initialMaskerResource() { return String(); }
     static String initialMarkerStartResource() { return String(); }
     static String initialMarkerMidResource() { return String(); }
@@ -126,7 +125,6 @@ public:
     void setShadow(std::unique_ptr<ShadowData>&& data) { m_shadowData.access().shadow = WTFMove(data); }
 
     // Setters for non-inherited resources
-    void setClipperResource(const String&);
     void setMaskerResource(const String&);
 
     // Setters for inherited resources
@@ -174,7 +172,6 @@ public:
     const Length& ry() const { return m_layoutData->ry; }
     const Length& x() const { return m_layoutData->x; }
     const Length& y() const { return m_layoutData->y; }
-    const String& clipperResource() const { return m_nonInheritedResourceData->clipper; }
     const String& maskerResource() const { return m_nonInheritedResourceData->masker; }
     const String& markerStartResource() const { return m_inheritedResourceData->markerStart; }
     const String& markerMidResource() const { return m_inheritedResourceData->markerMid; }
@@ -189,7 +186,6 @@ public:
     const String& visitedLinkStrokePaintUri() const { return m_strokeData->visitedLinkPaintUri; }
 
     // convenience
-    bool hasClipper() const { return !clipperResource().isEmpty(); }
     bool hasMasker() const { return !maskerResource().isEmpty(); }
     bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); }
     bool hasStroke() const { return strokePaintType() != SVGPaintType::None; }
@@ -404,12 +400,6 @@ inline void SVGRenderStyle::setBaselineShiftValue(const SVGLengthValue& shiftVal
         m_miscData.access().baselineShiftValue = shiftValue;
 }
 
-inline void SVGRenderStyle::setClipperResource(const String& resource)
-{
-    if (!(m_nonInheritedResourceData->clipper == resource))
-        m_nonInheritedResourceData.access().clipper = resource;
-}
-
 inline void SVGRenderStyle::setMaskerResource(const String& resource)
 {
     if (!(m_nonInheritedResourceData->masker == resource))
index d3fa92789be48fcc95e87be8d1d5e09725d962dc..49cda841edbc3ee5fc720d58a629d2f36c5e58b7 100644 (file)
@@ -217,14 +217,12 @@ bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
 }
 
 StyleResourceData::StyleResourceData()
-    : clipper(SVGRenderStyle::initialClipperResource())
-    , masker(SVGRenderStyle::initialMaskerResource())
+    : masker(SVGRenderStyle::initialMaskerResource())
 {
 }
 
 inline StyleResourceData::StyleResourceData(const StyleResourceData& other)
     : RefCounted<StyleResourceData>()
-    , clipper(other.clipper)
     , masker(other.masker)
 {
 }
@@ -236,8 +234,7 @@ Ref<StyleResourceData> StyleResourceData::copy() const
 
 bool StyleResourceData::operator==(const StyleResourceData& other) const
 {
-    return clipper == other.clipper
-        && masker == other.masker;
+    return masker == other.masker;
 }
 
 StyleInheritedResourceData::StyleInheritedResourceData()
@@ -508,7 +505,6 @@ TextStream& operator<<(TextStream& ts, const StyleShadowSVGData& data)
 
 TextStream& operator<<(TextStream& ts, const StyleResourceData& data)
 {
-    ts.dumpProperty("clipper", data.clipper);
     ts.dumpProperty("masker", data.masker);
     return ts;
 }
index ee0e7037b18d5fcd90188a123a6f4456233a7bcc..ab7436c5c7e6bf61fefec39ff85df19af13bfd1c 100644 (file)
@@ -286,7 +286,6 @@ public:
         return !(*this == other);
     }
 
-    String clipper;
     String masker;
 
 private:
index 169fe67c013884e0ba749982f19c24993b6842b3..f7d8c363b26d1b7e990122c421c352c64db64acc 100644 (file)
@@ -70,7 +70,6 @@ bool WillChangeData::propertyCreatesStackingContext(CSSPropertyID property)
     case CSSPropertyTransformStyle:
     case CSSPropertyWebkitTransformStyle:
     case CSSPropertyClipPath:
-    case CSSPropertyWebkitClipPath:
     case CSSPropertyMask:
     case CSSPropertyOpacity:
     case CSSPropertyPosition:
index 2cf86e25f626ee2bde25859659fc1e06676e00f5..cf5d35b58841dbccf2c27a6e5cd3921cb4adc6a6 100644 (file)
@@ -76,7 +76,7 @@ bool RenderSVGResourceClipper::applyResource(RenderElement& renderer, const Rend
 bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext& context, const AffineTransform& animatedLocalTransform, const FloatRect& objectBoundingBox)
 {
     // If the current clip-path gets clipped itself, we have to fallback to masking.
-    if (!style().svgStyle().clipperResource().isEmpty())
+    if (style().clipPath())
         return false;
     WindRule clipRule = WindRule::NonZero;
     Path clipPath = Path();
@@ -101,7 +101,7 @@ bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext& context, const
              continue;
         const SVGRenderStyle& svgStyle = style.svgStyle();
         // Current shape in clip-path gets clipped too. Fallback to masking.
-        if (!svgStyle.clipperResource().isEmpty())
+        if (style.clipPath())
             return false;
         // Fallback to masking, if there is more than one clipping path.
         if (clipPath.isEmpty()) {
index cc4f068ae4beddbcba5999e2acd8fdfb1328638a..0e73fa4ec9a7b49269b183e86215c333656a06af 100644 (file)
@@ -563,10 +563,12 @@ void writeResources(TextStream& ts, const RenderObject& renderer, OptionSet<Rend
             ts << " " << masker->resourceBoundingBox(renderer) << "\n";
         }
     }
-    if (!svgStyle.clipperResource().isEmpty()) {
-        if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), svgStyle.clipperResource())) {
+    if (style.clipPath() && is<ReferenceClipPathOperation>(style.clipPath())) {
+        auto resourceClipPath = downcast<ReferenceClipPathOperation>(style.clipPath());
+        AtomString id = resourceClipPath->fragment();
+        if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), id)) {
             ts << indent << " ";
-            writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
+            writeNameAndQuotedValue(ts, "clipPath", resourceClipPath->fragment());
             ts << " ";
             writeStandardPrefix(ts, *clipper, behavior, WriteIndentOrNot::No);
             ts << " " << clipper->resourceBoundingBox(renderer) << "\n";
index 9c737caff8b9276cc410602f579a9f364e5a08b8..880cbba04c8ed0b7bf3b8d29535142c5277cbaaf 100644 (file)
@@ -215,13 +215,7 @@ bool SVGResources::buildCachedResources(const RenderElement& renderer, const Ren
 
     bool foundResources = false;
     if (clipperFilterMaskerTags().contains(tagName)) {
-        if (svgStyle.hasClipper()) {
-            AtomString id(svgStyle.clipperResource());
-            if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
-                foundResources = true;
-            else
-                registerPendingResource(extensions, id, element);
-        } else if (is<ReferenceClipPathOperation>(style.clipPath())) {
+        if (is<ReferenceClipPathOperation>(style.clipPath())) {
             // FIXME: -webkit-clip-path should support external resources
             // https://bugs.webkit.org/show_bug.cgi?id=127032
             auto& clipPath = downcast<ReferenceClipPathOperation>(*style.clipPath());