XLinkNames namespace is required before the 'href' attribute of SVG animate elements
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Aug 2019 19:57:00 +0000 (19:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Aug 2019 19:57:00 +0000 (19:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201227

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

To get the animation target element, get the value of the "href" attribute
or the "xlink:href" attribute.

Tests: svg/custom/href-svg-namespace-animate-target.svg

* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):

LayoutTests:

* svg/custom/href-svg-namespace-animate-target-expected.svg: Added.
* svg/custom/href-svg-namespace-animate-target.svg: Added.

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/href-svg-namespace-animate-target-expected.svg [new file with mode: 0644]
LayoutTests/svg/custom/href-svg-namespace-animate-target.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/animation/SVGSMILElement.cpp

index b66259e..00ae54e 100644 (file)
@@ -1,3 +1,13 @@
+2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        XLinkNames namespace is required before the 'href' attribute of SVG animate elements
+        https://bugs.webkit.org/show_bug.cgi?id=201227
+
+        Reviewed by Ryosuke Niwa.
+
+        * svg/custom/href-svg-namespace-animate-target-expected.svg: Added.
+        * svg/custom/href-svg-namespace-animate-target.svg: Added.
+
 2019-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [WHLSL] Matrices need to have correct alignment
diff --git a/LayoutTests/svg/custom/href-svg-namespace-animate-target-expected.svg b/LayoutTests/svg/custom/href-svg-namespace-animate-target-expected.svg
new file mode 100644 (file)
index 0000000..31bf18b
--- /dev/null
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <rect width="100" height="100" fill="green"/>
+    <rect x="110" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/custom/href-svg-namespace-animate-target.svg b/LayoutTests/svg/custom/href-svg-namespace-animate-target.svg
new file mode 100644 (file)
index 0000000..f36a804
--- /dev/null
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <desc>Verify the XLinkNames namespace is not requried before the 'href' attribute of the SVG animate elements.</desc>
+    <rect id="rect1" width="100" height="100" fill="red"/>
+    <set id="set" attributeName="fill" attributeType="CSS" href="#rect1"  to="green" begin="0s" fill="freeze"/> 
+    <rect id="rect2" x="110" width="100" height="100" fill="red"/>
+    <set id="set" attributeName="fill" attributeType="CSS" xlink:href="#rect2"  to="green" begin="0s" fill="freeze"/> 
+</svg>
index f887f7c..1dc1901 100644 (file)
@@ -1,3 +1,18 @@
+2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        XLinkNames namespace is required before the 'href' attribute of SVG animate elements
+        https://bugs.webkit.org/show_bug.cgi?id=201227
+
+        Reviewed by Ryosuke Niwa.
+
+        To get the animation target element, get the value of the "href" attribute
+        or the "xlink:href" attribute.
+
+        Tests: svg/custom/href-svg-namespace-animate-target.svg
+
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::buildPendingResource):
+
 2019-08-28  Truitt Savell  <tsavell@apple.com>
 
         Unreviewed, rolling out r249209.
index 3664c17..afa9329 100644 (file)
@@ -181,7 +181,7 @@ void SVGSMILElement::buildPendingResource()
 
     String id;
     RefPtr<Element> target;
-    auto& href = getAttribute(XLinkNames::hrefAttr);
+    auto& href = getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr);
     if (href.isEmpty())
         target = parentElement();
     else {