Title: [249416] trunk
Revision
249416
Author
hironori.fu...@sony.com
Date
2019-09-02 18:55:27 -0700 (Mon, 02 Sep 2019)

Log Message

[SVG] fragment-only url 'url(#fragment)' should be resolved against the current document with regardless to HTML <base> element
https://bugs.webkit.org/show_bug.cgi?id=189499
<rdar://problem/44466206>

Reviewed by Said Abou-Hallawa.

Source/WebCore:

Fragment-only URL 'url(#fragment)' should be resolved against the
current document even if HTML <base> element is specified.
Spec: <https://drafts.csswg.org/css-values/#local-urls>

Tests: css3/filters/effect-reference-local-url-with-base.html
       css3/masking/clip-path-reference-local-url-with-base.html
       http/tests/svg/local-url-with-valid-base-and-resource.html
       svg/animations/local-url-target-reference.html
       svg/custom/local-url-reference-clip-path.html
       svg/custom/local-url-reference-fill.html
       svg/custom/local-url-reference-filter.html
       svg/custom/local-url-reference-marker.html
       svg/custom/local-url-reference-mask.html
       svg/custom/local-url-reference-pattern.html
       svg/custom/local-url-reference-radial-gradient.html
       svg/custom/local-url-reference-srcdoc.html
       svg/custom/local-url-reference-stroke.html
       svg/custom/local-url-reference-use.html
       svg/text/textpath-local-url-reference.html

* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::fragmentIdentifierFromIRIString): Return the fragment if the URL starts with '#'.

LayoutTests:

These test cases are imported from Blink's commit, and modified for WebKit.
<https://chromium.googlesource.com/chromium/src/+/e7d7225c33aa7fc42ee390125b01df9167fad106%5E%21/>

* TestExpectations:
* css3/filters/effect-reference-local-url-with-base-expected.html: Added.
* css3/filters/effect-reference-local-url-with-base.html: Added.
* css3/filters/effect-reference.html:
* css3/masking/clip-path-reference-local-url-with-base-expected.html: Added.
* css3/masking/clip-path-reference-local-url-with-base.html: Added.
* http/tests/svg/local-url-with-valid-base-and-resource-expected.html: Added.
* http/tests/svg/local-url-with-valid-base-and-resource.html: Added.
* http/tests/svg/resources/red100x100.svg: Added.
* platform/gtk/TestExpectations: Marked svg/custom/local-url-reference-marker.html as ImageOnlyFailure for Bug 113849.
* platform/wpe/TestExpectations: Ditto.
* svg/animations/local-url-target-reference-expected.html: Added.
* svg/animations/local-url-target-reference.html: Added.
* svg/custom/linking-base-external-reference-expected.txt: Removed. This was a test for old spec.
* svg/custom/linking-base-external-reference.xhtml: Ditto.
* svg/custom/local-url-reference-clip-path-expected.html: Added.
* svg/custom/local-url-reference-clip-path.html: Added.
* svg/custom/local-url-reference-fill-expected.html: Added.
* svg/custom/local-url-reference-fill.html: Added.
* svg/custom/local-url-reference-filter-expected.html: Added.
* svg/custom/local-url-reference-filter.html: Added.
* svg/custom/local-url-reference-marker-expected.html: Added.
* svg/custom/local-url-reference-marker.html: Added.
* svg/custom/local-url-reference-mask-expected.html: Added.
* svg/custom/local-url-reference-mask.html: Added.
* svg/custom/local-url-reference-pattern-expected.html: Added.
* svg/custom/local-url-reference-pattern.html: Added.
* svg/custom/local-url-reference-radial-gradient-expected.html: Added.
* svg/custom/local-url-reference-radial-gradient.html: Added.
* svg/custom/local-url-reference-srcdoc-expected.html: Added.
* svg/custom/local-url-reference-srcdoc.html: Added.
* svg/custom/local-url-reference-stroke-expected.html: Added.
* svg/custom/local-url-reference-stroke.html: Added.
* svg/custom/local-url-reference-use-expected.html: Added.
* svg/custom/local-url-reference-use.html: Added.
* svg/text/textpath-local-url-reference-expected.html: Added.
* svg/text/textpath-local-url-reference.html: Added.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (249415 => 249416)


--- trunk/LayoutTests/ChangeLog	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/LayoutTests/ChangeLog	2019-09-03 01:55:27 UTC (rev 249416)
@@ -1,3 +1,52 @@
+2019-09-02  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [SVG] fragment-only url 'url(#fragment)' should be resolved against the current document with regardless to HTML <base> element
+        https://bugs.webkit.org/show_bug.cgi?id=189499
+        <rdar://problem/44466206>
+
+        Reviewed by Said Abou-Hallawa.
+
+        These test cases are imported from Blink's commit, and modified for WebKit.
+        <https://chromium.googlesource.com/chromium/src/+/e7d7225c33aa7fc42ee390125b01df9167fad106%5E%21/>
+
+        * TestExpectations:
+        * css3/filters/effect-reference-local-url-with-base-expected.html: Added.
+        * css3/filters/effect-reference-local-url-with-base.html: Added.
+        * css3/filters/effect-reference.html:
+        * css3/masking/clip-path-reference-local-url-with-base-expected.html: Added.
+        * css3/masking/clip-path-reference-local-url-with-base.html: Added.
+        * http/tests/svg/local-url-with-valid-base-and-resource-expected.html: Added.
+        * http/tests/svg/local-url-with-valid-base-and-resource.html: Added.
+        * http/tests/svg/resources/red100x100.svg: Added.
+        * platform/gtk/TestExpectations: Marked svg/custom/local-url-reference-marker.html as ImageOnlyFailure for Bug 113849.
+        * platform/wpe/TestExpectations: Ditto.
+        * svg/animations/local-url-target-reference-expected.html: Added.
+        * svg/animations/local-url-target-reference.html: Added.
+        * svg/custom/linking-base-external-reference-expected.txt: Removed. This was a test for old spec.
+        * svg/custom/linking-base-external-reference.xhtml: Ditto.
+        * svg/custom/local-url-reference-clip-path-expected.html: Added.
+        * svg/custom/local-url-reference-clip-path.html: Added.
+        * svg/custom/local-url-reference-fill-expected.html: Added.
+        * svg/custom/local-url-reference-fill.html: Added.
+        * svg/custom/local-url-reference-filter-expected.html: Added.
+        * svg/custom/local-url-reference-filter.html: Added.
+        * svg/custom/local-url-reference-marker-expected.html: Added.
+        * svg/custom/local-url-reference-marker.html: Added.
+        * svg/custom/local-url-reference-mask-expected.html: Added.
+        * svg/custom/local-url-reference-mask.html: Added.
+        * svg/custom/local-url-reference-pattern-expected.html: Added.
+        * svg/custom/local-url-reference-pattern.html: Added.
+        * svg/custom/local-url-reference-radial-gradient-expected.html: Added.
+        * svg/custom/local-url-reference-radial-gradient.html: Added.
+        * svg/custom/local-url-reference-srcdoc-expected.html: Added.
+        * svg/custom/local-url-reference-srcdoc.html: Added.
+        * svg/custom/local-url-reference-stroke-expected.html: Added.
+        * svg/custom/local-url-reference-stroke.html: Added.
+        * svg/custom/local-url-reference-use-expected.html: Added.
+        * svg/custom/local-url-reference-use.html: Added.
+        * svg/text/textpath-local-url-reference-expected.html: Added.
+        * svg/text/textpath-local-url-reference.html: Added.
+
 2019-09-01  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader

Added: trunk/LayoutTests/css3/filters/effect-reference-local-url-with-base-expected.html (0 => 249416)


--- trunk/LayoutTests/css3/filters/effect-reference-local-url-with-base-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/effect-reference-local-url-with-base-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<svg></svg>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/css3/filters/effect-reference-local-url-with-base.html (0 => 249416)


--- trunk/LayoutTests/css3/filters/effect-reference-local-url-with-base.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/effect-reference-local-url-with-base.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<base href=""
+<style>
+#target {
+  width: 100px;
+  height: 100px;
+  background-color: red;
+  filter: url(#filter);
+}
+</style>
+<svg>
+  <filter id="filter" x="0" y="0" width="1" height="1" color-interpolation-filters="sRGB">
+    <feFlood flood-color="green"/>
+  </filter>
+</svg>
+<div id="target"></div>

Added: trunk/LayoutTests/css3/masking/clip-path-reference-local-url-with-base-expected.html (0 => 249416)


--- trunk/LayoutTests/css3/masking/clip-path-reference-local-url-with-base-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-reference-local-url-with-base-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/css3/masking/clip-path-reference-local-url-with-base.html (0 => 249416)


--- trunk/LayoutTests/css3/masking/clip-path-reference-local-url-with-base.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-reference-local-url-with-base.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<base href=""
+<style>
+#target {
+  width: 100px;
+  height: 100px;
+  border-right: 100px solid red;
+  background-color: green;
+  -webkit-clip-path: url(#clip);
+  clip-path: url(#clip);
+}
+</style>
+<div id="target"></div>
+<svg>
+  <clipPath id="clip">
+    <rect width="100" height="100"/>
+  </filter>
+</svg>

Added: trunk/LayoutTests/http/tests/svg/local-url-with-valid-base-and-resource-expected.html (0 => 249416)


--- trunk/LayoutTests/http/tests/svg/local-url-with-valid-base-and-resource-expected.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/svg/local-url-with-valid-base-and-resource-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/http/tests/svg/local-url-with-valid-base-and-resource.html (0 => 249416)


--- trunk/LayoutTests/http/tests/svg/local-url-with-valid-base-and-resource.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/svg/local-url-with-valid-base-and-resource.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <rect id="rect" width="100" height="100" fill="green"/>
+  <use href="" x="100"/>
+</svg>

Added: trunk/LayoutTests/http/tests/svg/resources/red100x100.svg (0 => 249416)


--- trunk/LayoutTests/http/tests/svg/resources/red100x100.svg	                        (rev 0)
+++ trunk/LayoutTests/http/tests/svg/resources/red100x100.svg	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+  <rect id="rect" width="100" height="100" fill="red"/>
+</svg>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (249415 => 249416)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2019-09-03 01:55:27 UTC (rev 249416)
@@ -3020,6 +3020,8 @@
 webkit.org/b/107825 media/nodesFromRect-shadowContent.html [ Failure Crash ]
 webkit.org/b/107825 media/video-controls-fullscreen-volume.html [ Failure ]
 
+webkit.org/b/113849 svg/custom/local-url-reference-marker.html [ ImageOnlyFailure ]
+
 # Test marked in TestExpectations as failing on non-retina displays, passing on GTK port
 webkit.org/b/129113 fast/multicol/newmulticol/clipping.html [ Pass ]
 

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (249415 => 249416)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2019-09-03 01:55:27 UTC (rev 249416)
@@ -1376,6 +1376,7 @@
 webkit.org/b/163831 svg/custom/acid3-test-77.html [ Failure ]
 webkit.org/b/134758 svg/custom/composited-svg-with-opacity.html [ ImageOnlyFailure Pass ]
 webkit.org/b/131347 svg/custom/hidpi-masking-clipping.svg [ Failure ImageOnlyFailure Timeout ]
+webkit.org/b/113849 svg/custom/local-url-reference-marker.html [ ImageOnlyFailure ]
 webkit.org/b/160137 svg/custom/non-scaling-stroke.svg [ Failure Pass ]
 webkit.org/b/160137 svg/custom/non-scaling-stroke-update.svg [ ImageOnlyFailure Pass ]
 webkit.org/b/112228 svg/custom/resources-css-scaled.html [ ImageOnlyFailure ]

Added: trunk/LayoutTests/svg/animations/local-url-target-reference-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/animations/local-url-target-reference-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/local-url-target-reference-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/animations/local-url-target-reference.html (0 => 249416)


--- trunk/LayoutTests/svg/animations/local-url-target-reference.html	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/local-url-target-reference.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <script>
+    var svgRoot = document.querySelector('svg');
+    svgRoot.pauseAnimations();
+    svgRoot.setCurrentTime(1);
+  </script>
+  <defs>
+    <path id="path" d="M100,0z"/>
+  </defs>
+  <rect width="100" height="100" fill="green">
+    <animateMotion dur="0.01" fill="freeze">
+      <mpath href=""
+    </animateMotion>
+  </rect>
+  <rect id="rect" width="100" height="100" fill="red"/>
+  <set attributeName="fill" href="" to="green" dur="indefinite"/>
+</svg>

Deleted: trunk/LayoutTests/svg/custom/linking-base-external-reference-expected.txt (249415 => 249416)


--- trunk/LayoutTests/svg/custom/linking-base-external-reference-expected.txt	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/LayoutTests/svg/custom/linking-base-external-reference-expected.txt	2019-09-03 01:55:27 UTC (rev 249416)
@@ -1,14 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x154
-  RenderBlock {html} at (0,0) size 800x154
-    RenderInline {base} at (0,0) size 0x0
-    RenderText {#text} at (0,0) size 0x0
-    RenderText {#text} at (0,0) size 0x0
-    RenderSVGRoot {svg} at (0,0) size 100x100
-      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
-        RenderSVGResourceLinearGradient {linearGradient} [id="orange_red"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,0)]
-          RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
-          RenderSVGGradientStop {stop} [offset=1.00] [color=#FF0000]
-      RenderSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
-    RenderText {#text} at (0,0) size 0x0

Deleted: trunk/LayoutTests/svg/custom/linking-base-external-reference.xhtml (249415 => 249416)


--- trunk/LayoutTests/svg/custom/linking-base-external-reference.xhtml	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/LayoutTests/svg/custom/linking-base-external-reference.xhtml	2019-09-03 01:55:27 UTC (rev 249416)
@@ -1,18 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <base href=""
-  <!-- There should be no red -->
-  <svg width="100%" height="100%" version="1.1"
-       xmlns="http://www.w3.org/2000/svg" style="height: 100%">
-
-    <defs>
-      <linearGradient id="orange_red" x1="0%" y1="0%" x2="100%" y2="0%">
-        <stop offset="0%" style="stop-color:red;"/>
-        <stop offset="100%" style="stop-color:red;"/>
-      </linearGradient>
-
-    </defs>
-
-    <rect x="0" y="0" width="100" height="100" style="fill: url(#orange_red)"/>
-  </svg>
-</html>

Added: trunk/LayoutTests/svg/custom/local-url-reference-clip-path-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-clip-path-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-clip-path-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-clip-path.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-clip-path.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-clip-path.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <clipPath id="clip">
+    <rect y="50" width="100" height="50"/>
+  </clipPath>
+  <rect width="100" height="50" fill="green"/>
+  <g clip-path="url(#clip)">
+    <rect width="100" height="50" fill="red"/>
+    <rect y="50" width="100" height="50" fill="green"/>
+  </g>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-fill-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-fill-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-fill-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-fill.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-fill.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-fill.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+    <linearGradient id="paint">
+        <stop stop-color="green"/>
+    </linearGradient>
+    <linearGradient id="inheritedPaint" href=""
+    <rect width="100" height="100" fill="url(#paint) red"/>
+    <rect x="100" width="100" height="100" fill="url(#inheritedPaint) red"/>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-filter-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-filter-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-filter-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-filter.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-filter.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-filter.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+    <filter id="filter" x="0" y="0" width="1" height="1" color-interpolation-filters="sRGB">
+        <feFlood flood-color="green"/>
+    </filter>
+    <rect width="100" height="100" fill="red" filter="url(#filter)"/>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-marker-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-marker-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-marker-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 300px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-marker.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-marker.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-marker.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <marker id="marker" refY="0.5">
+    <rect width="1" height="1" fill="green"/>
+  </marker>
+  <polyline points="0,50 100,50 200,50" stroke="red" stroke-width="100"
+            marker-start="url(#marker)" marker-mid="url(#marker)" marker-end="url(#marker)"/>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-mask-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-mask-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-mask-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-mask.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-mask.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-mask.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <mask id="mask">
+    <rect y="50" width="100" height="50" fill="white"/>
+  </mask>
+  <rect width="100" height="50" fill="green"/>
+  <g mask="url(#mask)">
+    <rect width="100" height="50" fill="red"/>
+    <rect y="50" width="100" height="50" fill="green"/>
+  </g>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-pattern-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-pattern-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-pattern-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-pattern.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-pattern.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-pattern.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <pattern id="pattern" width="100" height="100" patternUnits="userSpaceOnUse">
+    <rect width="100" height="100" fill="green"/>
+  </pattern>
+  <pattern id="inheritedPattern" href=""
+  <rect width="100" height="100" fill="url(#inheritedPattern) red"/>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-radial-gradient-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-radial-gradient-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-radial-gradient-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-radial-gradient.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-radial-gradient.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-radial-gradient.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+  <radialGradient id="radial">
+    <stop stop-color="green"/>
+  </radialGradient>
+  <radialGradient id="inheritedRadial" href=""
+  <rect width="100" height="100" fill="url(#inheritedRadial) red"/>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-srcdoc-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-srcdoc-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-srcdoc-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-srcdoc.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-srcdoc.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-srcdoc.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<iframe srcdoc="
+  <!DOCTYPE html>
+  <style>body { margin: 0; }</style>
+  <svg xmlns='http://www.w3.org/2000/svg'>
+    <linearGradient id='gradient'>
+      <stop stop-color='green'/>
+    </linearGradient>
+    <rect width='100' height='100' fill='url(#gradient) red'/>
+  </svg>"
+  style="margin: 0; border: none" scrolling="no">
+</iframe>

Added: trunk/LayoutTests/svg/custom/local-url-reference-stroke-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-stroke-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-stroke-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-stroke.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-stroke.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-stroke.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+    <linearGradient id="paint">
+        <stop stop-color="green"/>
+    </linearGradient>
+    <linearGradient id="inheritedPaint" href=""
+    <rect x="25" y="25" width="50" height="50" stroke="url(#paint) red" stroke-width="50"/>
+    <rect x="125" y="25" width="50" height="50" stroke="url(#inheritedPaint) red" stroke-width="50"/>
+</svg>

Added: trunk/LayoutTests/svg/custom/local-url-reference-use-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-use-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-use-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/custom/local-url-reference-use.html (0 => 249416)


--- trunk/LayoutTests/svg/custom/local-url-reference-use.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/local-url-reference-use.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<base href=""
+<svg>
+    <defs>
+        <rect id="rect" width="100" height="100" fill="green"/>
+    </defs>
+    <use href=""
+</svg>

Added: trunk/LayoutTests/svg/text/textpath-local-url-reference-expected.html (0 => 249416)


--- trunk/LayoutTests/svg/text/textpath-local-url-reference-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/textpath-local-url-reference-expected.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>

Added: trunk/LayoutTests/svg/text/textpath-local-url-reference.html (0 => 249416)


--- trunk/LayoutTests/svg/text/textpath-local-url-reference.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/textpath-local-url-reference.html	2019-09-03 01:55:27 UTC (rev 249416)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<base href=""
+<script src=""
+<svg>
+  <path id="path" d="M0,80h100"/>
+  <text font-size="100" font-family="Ahem" fill="green"><textPath href=""
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (249415 => 249416)


--- trunk/Source/WebCore/ChangeLog	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/Source/WebCore/ChangeLog	2019-09-03 01:55:27 UTC (rev 249416)
@@ -1,5 +1,36 @@
 2019-09-02  Fujii Hironori  <hironori.fu...@sony.com>
 
+        [SVG] fragment-only url 'url(#fragment)' should be resolved against the current document with regardless to HTML <base> element
+        https://bugs.webkit.org/show_bug.cgi?id=189499
+        <rdar://problem/44466206>
+
+        Reviewed by Said Abou-Hallawa.
+
+        Fragment-only URL 'url(#fragment)' should be resolved against the
+        current document even if HTML <base> element is specified.
+        Spec: <https://drafts.csswg.org/css-values/#local-urls>
+
+        Tests: css3/filters/effect-reference-local-url-with-base.html
+               css3/masking/clip-path-reference-local-url-with-base.html
+               http/tests/svg/local-url-with-valid-base-and-resource.html
+               svg/animations/local-url-target-reference.html
+               svg/custom/local-url-reference-clip-path.html
+               svg/custom/local-url-reference-fill.html
+               svg/custom/local-url-reference-filter.html
+               svg/custom/local-url-reference-marker.html
+               svg/custom/local-url-reference-mask.html
+               svg/custom/local-url-reference-pattern.html
+               svg/custom/local-url-reference-radial-gradient.html
+               svg/custom/local-url-reference-srcdoc.html
+               svg/custom/local-url-reference-stroke.html
+               svg/custom/local-url-reference-use.html
+               svg/text/textpath-local-url-reference.html
+
+        * svg/SVGURIReference.cpp:
+        (WebCore::SVGURIReference::fragmentIdentifierFromIRIString): Return the fragment if the URL starts with '#'.
+
+2019-09-02  Fujii Hironori  <hironori.fu...@sony.com>
+
         [Win] Remove a unused PlatformWheelEvent constructor
         https://bugs.webkit.org/show_bug.cgi?id=201398
 

Modified: trunk/Source/WebCore/svg/SVGURIReference.cpp (249415 => 249416)


--- trunk/Source/WebCore/svg/SVGURIReference.cpp	2019-09-03 01:53:00 UTC (rev 249415)
+++ trunk/Source/WebCore/svg/SVGURIReference.cpp	2019-09-03 01:55:27 UTC (rev 249416)
@@ -57,7 +57,10 @@
     if (start == notFound)
         return emptyString();
 
-    URL base = start ? URL(document.baseURL(), url.substring(0, start)) : document.baseURL();
+    if (!start)
+        return url.substring(1);
+
+    URL base = URL(document.baseURL(), url.substring(0, start));
     String fragmentIdentifier = url.substring(start);
     URL kurl(base, fragmentIdentifier);
     if (equalIgnoringFragmentIdentifier(kurl, document.url()))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to