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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249416
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2019-09-02 Fujii Hironori <Hironori.Fujii@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 <mmaxfield@apple.com>
[WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
--- /dev/null
+<!DOCTYPE html>
+<svg></svg>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://127.0.0.1:8000/svg/resources/red100x100.svg">
+<svg>
+ <rect id="rect" width="100" height="100" fill="green"/>
+ <use href="#rect" x="100"/>
+</svg>
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect id="rect" width="100" height="100" fill="red"/>
+</svg>
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 ]
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 ]
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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="#path"/>
+ </animateMotion>
+ </rect>
+ <rect id="rect" width="100" height="100" fill="red"/>
+ <set attributeName="fill" href="#rect" to="green" dur="indefinite"/>
+</svg>
+++ /dev/null
-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
+++ /dev/null
-<?xml version="1.0" standalone="no"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <base href="http://www.example.com"/>
- <!-- 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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<svg>
+ <linearGradient id="paint">
+ <stop stop-color="green"/>
+ </linearGradient>
+ <linearGradient id="inheritedPaint" href="#paint"/>
+ <rect width="100" height="100" fill="url(#paint) red"/>
+ <rect x="100" width="100" height="100" fill="url(#inheritedPaint) red"/>
+</svg>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 300px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<svg>
+ <pattern id="pattern" width="100" height="100" patternUnits="userSpaceOnUse">
+ <rect width="100" height="100" fill="green"/>
+ </pattern>
+ <pattern id="inheritedPattern" href="#pattern"/>
+ <rect width="100" height="100" fill="url(#inheritedPattern) red"/>
+</svg>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<svg>
+ <radialGradient id="radial">
+ <stop stop-color="green"/>
+ </radialGradient>
+ <radialGradient id="inheritedRadial" href="#radial"/>
+ <rect width="100" height="100" fill="url(#inheritedRadial) red"/>
+</svg>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 200px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<svg>
+ <linearGradient id="paint">
+ <stop stop-color="green"/>
+ </linearGradient>
+ <linearGradient id="inheritedPaint" href="#paint"/>
+ <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>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<svg>
+ <defs>
+ <rect id="rect" width="100" height="100" fill="green"/>
+ </defs>
+ <use href="#rect"/>
+</svg>
--- /dev/null
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background-color: green"></div>
--- /dev/null
+<!DOCTYPE html>
+<base href="http://www.example.com/">
+<script src="../../resources/ahem.js"></script>
+<svg>
+ <path id="path" d="M0,80h100"/>
+ <text font-size="100" font-family="Ahem" fill="green"><textPath href="#path">X</textPath></textPath>
+</svg>
2019-09-02 Fujii Hironori <Hironori.Fujii@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.Fujii@sony.com>
+
[Win] Remove a unused PlatformWheelEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=201398
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()))