Title: [249040] trunk
Revision
249040
Author
hironori.fu...@sony.com
Date
2019-08-22 19:06:42 -0700 (Thu, 22 Aug 2019)

Log Message

[SVG] -webkit-clip-path treats url(abc#xyz) as url(#xyz) because it checks only URL fragment part
https://bugs.webkit.org/show_bug.cgi?id=201030

Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: svg/clip-path/clip-path-invalid-reference-001-expected.svg
       svg/clip-path/clip-path-invalid-reference-001.svg
       svg/clip-path/clip-path-invalid-reference-002-expected.svg
       svg/clip-path/clip-path-invalid-reference-002.svg

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath): Use
SVGURIReference::fragmentIdentifierFromIRIString to get fragment
identifier from -webkit-clip-path.

LayoutTests:

* svg/clip-path/clip-path-invalid-reference-001-expected.svg: Added.
* svg/clip-path/clip-path-invalid-reference-001.svg: Added.
* svg/clip-path/clip-path-invalid-reference-002-expected.svg: Added.
* svg/clip-path/clip-path-invalid-reference-002.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (249039 => 249040)


--- trunk/LayoutTests/ChangeLog	2019-08-23 01:59:22 UTC (rev 249039)
+++ trunk/LayoutTests/ChangeLog	2019-08-23 02:06:42 UTC (rev 249040)
@@ -1,3 +1,15 @@
+2019-08-22  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [SVG] -webkit-clip-path treats url(abc#xyz) as url(#xyz) because it checks only URL fragment part
+        https://bugs.webkit.org/show_bug.cgi?id=201030
+
+        Reviewed by Ryosuke Niwa.
+
+        * svg/clip-path/clip-path-invalid-reference-001-expected.svg: Added.
+        * svg/clip-path/clip-path-invalid-reference-001.svg: Added.
+        * svg/clip-path/clip-path-invalid-reference-002-expected.svg: Added.
+        * svg/clip-path/clip-path-invalid-reference-002.svg: Added.
+
 2019-08-22  Daniel Bates  <daba...@apple.com>
 
         [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned

Added: trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-001-expected.svg (0 => 249040)


--- trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-001-expected.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-001-expected.svg	2019-08-23 02:06:42 UTC (rev 249040)
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+</svg>

Added: trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-001.svg (0 => 249040)


--- trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-001.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-001.svg	2019-08-23 02:06:42 UTC (rev 249040)
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+  <rect width="100" height="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#not-found)"/>
+</svg>

Added: trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-002-expected.svg (0 => 249040)


--- trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-002-expected.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-002-expected.svg	2019-08-23 02:06:42 UTC (rev 249040)
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+</svg>

Added: trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-002.svg (0 => 249040)


--- trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-002.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-invalid-reference-002.svg	2019-08-23 02:06:42 UTC (rev 249040)
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+</clipPath>
+<rect width="200" height="200" fill="green" style="-webkit-clip-path: url(not-found#clip1)"/>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (249039 => 249040)


--- trunk/Source/WebCore/ChangeLog	2019-08-23 01:59:22 UTC (rev 249039)
+++ trunk/Source/WebCore/ChangeLog	2019-08-23 02:06:42 UTC (rev 249040)
@@ -1,3 +1,20 @@
+2019-08-22  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [SVG] -webkit-clip-path treats url(abc#xyz) as url(#xyz) because it checks only URL fragment part
+        https://bugs.webkit.org/show_bug.cgi?id=201030
+
+        Reviewed by Ryosuke Niwa.
+
+        Tests: svg/clip-path/clip-path-invalid-reference-001-expected.svg
+               svg/clip-path/clip-path-invalid-reference-001.svg
+               svg/clip-path/clip-path-invalid-reference-002-expected.svg
+               svg/clip-path/clip-path-invalid-reference-002.svg
+
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertClipPath): Use
+        SVGURIReference::fragmentIdentifierFromIRIString to get fragment
+        identifier from -webkit-clip-path.
+
 2019-08-22  Andy Estes  <aes...@apple.com>
 
         [watchOS] Disable Content Filtering in the simulator build

Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (249039 => 249040)


--- trunk/Source/WebCore/css/StyleBuilderConverter.h	2019-08-23 01:59:22 UTC (rev 249039)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h	2019-08-23 02:06:42 UTC (rev 249040)
@@ -590,9 +590,9 @@
         auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
         if (primitiveValue.primitiveType() == CSSPrimitiveValue::CSS_URI) {
             String cssURLValue = primitiveValue.stringValue();
-            URL url = ""
+            String fragment = SVGURIReference::fragmentIdentifierFromIRIString(cssURLValue, styleResolver.document());
             // FIXME: It doesn't work with external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=126133)
-            return ReferenceClipPathOperation::create(cssURLValue, url.fragmentIdentifier());
+            return ReferenceClipPathOperation::create(cssURLValue, fragment);
         }
         ASSERT(primitiveValue.valueID() == CSSValueNone);
         return nullptr;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to