propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Apr 2019 16:32:25 +0000 (16:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Apr 2019 16:32:25 +0000 (16:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197303

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-26
Reviewed by Alex Christensen.

Source/WebCore:

Therefore SVGElement::propertyRegistry() was called instead. This means
these two elements will not have access to the properties of the base
class SVGFilterPrimitiveStandardAttributes.

Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg

* svg/SVGElement.cpp:
(WebCore::SVGElement::commitPropertyChange):
* svg/SVGFEFloodElement.h:
* svg/SVGFEMergeElement.h:

LayoutTests:

* svg/dom/SVGFEFloodElement-filter-standard-attributes-expected.svg: Added.
* svg/dom/SVGFEFloodElement-filter-standard-attributes.svg: Added.

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

LayoutTests/ChangeLog
LayoutTests/svg/dom/SVGFEFloodElement-filter-standard-attributes-expected.svg [new file with mode: 0644]
LayoutTests/svg/dom/SVGFEFloodElement-filter-standard-attributes.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGFEFloodElement.h
Source/WebCore/svg/SVGFEMergeElement.h

index c73565e..1d3c56a 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
+        https://bugs.webkit.org/show_bug.cgi?id=197303
+
+        Reviewed by Alex Christensen.
+
+        * svg/dom/SVGFEFloodElement-filter-standard-attributes-expected.svg: Added.
+        * svg/dom/SVGFEFloodElement-filter-standard-attributes.svg: Added.
+
 2019-04-26  Youenn Fablet  <youenn@apple.com>
 
         [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
diff --git a/LayoutTests/svg/dom/SVGFEFloodElement-filter-standard-attributes-expected.svg b/LayoutTests/svg/dom/SVGFEFloodElement-filter-standard-attributes-expected.svg
new file mode 100644 (file)
index 0000000..9d1424d
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <rect x="10" y="10" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/dom/SVGFEFloodElement-filter-standard-attributes.svg b/LayoutTests/svg/dom/SVGFEFloodElement-filter-standard-attributes.svg
new file mode 100644 (file)
index 0000000..cc29ca2
--- /dev/null
@@ -0,0 +1,15 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <defs>
+        <filter id="filter" filterUnits="userSpaceOnUse">
+            <feFlood id="feFlood" x="0" y="0" width="50" height="50" flood-color="green"/>
+        </filter>
+    </defs>
+    <use style="filter: url(#filter);"/>
+    <script>
+        var feFlood = document.querySelector("#feFlood");
+        feFlood.x.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER, 10);
+        feFlood.y.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER, 10);
+        feFlood.width.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER, 100);
+        feFlood.height.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER, 100);
+    </script>
+</svg>
index f5bca95..bf6cada 100644 (file)
@@ -1,3 +1,21 @@
+2019-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
+        https://bugs.webkit.org/show_bug.cgi?id=197303
+
+        Reviewed by Alex Christensen.
+
+        Therefore SVGElement::propertyRegistry() was called instead. This means
+        these two elements will not have access to the properties of the base
+        class SVGFilterPrimitiveStandardAttributes.
+
+        Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg
+
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::commitPropertyChange):
+        * svg/SVGFEFloodElement.h:
+        * svg/SVGFEMergeElement.h:
+
 2019-04-26  Youenn Fablet  <youenn@apple.com>
 
         [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
index 85d7600..cc5b6fd 100644 (file)
@@ -583,6 +583,7 @@ void SVGElement::commitPropertyChange(SVGProperty* property)
 void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty)
 {
     QualifiedName attributeName = propertyRegistry().animatedPropertyAttributeName(animatedProperty);
+    ASSERT(attributeName != nullQName());
 
     // A change in a style property, e.g SVGRectElement::x should be serialized to
     // the attribute immediately. Otherwise it is okay to be lazy in this regard.
index b56135a..b96a43a 100644 (file)
@@ -32,8 +32,13 @@ public:
 private:
     SVGFEFloodElement(const QualifiedName&, Document&);
 
+    using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEFloodElement, SVGFilterPrimitiveStandardAttributes>;
+    const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
+
     bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
+
+    PropertyRegistry m_propertyRegistry { *this };
 };
 
 } // namespace WebCore
index 8433c9a..7450868 100644 (file)
@@ -32,7 +32,12 @@ public:
 private:
     SVGFEMergeElement(const QualifiedName&, Document&);
 
+    using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeElement, SVGFilterPrimitiveStandardAttributes>;
+    const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
+
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
+
+    PropertyRegistry m_propertyRegistry { *this };
 };
 
 } // namespace WebCore