https://bugs.webkit.org/show_bug.cgi?id=193647
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-01-22
Reviewed by Simon Fraser.
Source/WebCore:
Changing a style attribute of an SVGELement needs to call invalidateInstances().
Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
* svg/SVGElement.cpp:
(WebCore::SVGElement::attributeChanged):
LayoutTests:
* svg/custom/svg-use-style-dynamic-change-invalidate-expected.svg: Added.
* svg/custom/svg-use-style-dynamic-change-invalidate.svg: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240305
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2019-01-22 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
+ https://bugs.webkit.org/show_bug.cgi?id=193647
+
+ Reviewed by Simon Fraser.
+
+ * svg/custom/svg-use-style-dynamic-change-invalidate-expected.svg: Added.
+ * svg/custom/svg-use-style-dynamic-change-invalidate.svg: Added.
+
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, skip all resource load statistics tests on GTK
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect width="100" height="100" fill="green"/>
+ <rect x="110" width="100" height="100" fill="green"/>
+ <rect x="220" width="100" height="100" fill="green"/>
+ <rect x="330" width="100" height="100" fill="green"/>
+</svg>
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <symbol id="symbol">
+ <rect id="symbol-rect" width="100%" height="100%" fill="red"/>
+ </symbol>
+ <defs>
+ <rect id="defs-rect" width="100" height="100" fill="red"/>
+ </defs>
+ <rect id="rect" width="100" height="100" fill="red"/>
+ <use x="110" width="100" height="100" xlink:href="#symbol"/>
+ <use x="220" width="100" height="100" xlink:href="#defs-rect"/>
+ <use x="330" width="100" height="100" xlink:href="#rect"/>
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ setTimeout(function(){
+ document.getElementById("symbol-rect").setAttribute("style", "fill: green");
+ document.getElementById("defs-rect").setAttribute("style", "fill: green");
+ document.getElementById("rect").setAttribute("style", "fill: green");
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ </script>
+</svg>
+2019-01-22 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
+ https://bugs.webkit.org/show_bug.cgi?id=193647
+
+ Reviewed by Simon Fraser.
+
+ Changing a style attribute of an SVGELement needs to call invalidateInstances().
+
+ Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
+
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::attributeChanged):
+
2019-01-22 Alex Christensen <achristensen@webkit.org>
Fix more builds.
document().accessSVGExtensions().rebuildAllElementReferencesForTarget(*this);
// Changes to the style attribute are processed lazily (see Element::getAttribute() and related methods),
- // so we don't want changes to the style attribute to result in extra work here.
- if (name != HTMLNames::styleAttr)
+ // so we don't want changes to the style attribute to result in extra work here except invalidateInstances().
+ if (name == HTMLNames::styleAttr)
+ invalidateInstances();
+ else
svgAttributeChanged(name);
}