Commit 3493ab27 authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org

Clean up SVGScriptElement

https://bugs.webkit.org/show_bug.cgi?id=125527

Reviewed by Darin Adler.

Source/WebCore:

From the Blink port of this bug it becomes clear that svg/dom/SVGScriptElement/script-set-href.svg and
svg/dom/svg-element-attribute-js-null.xhtml still hit an assert in Debug because SVGNames::typeAttr can't
be used with fastGetAttribute in all cases, because it can be animatable. However for SVGScriptElement
it is not animatable, so make isAnimatableAttribute virtual (note Debug only method) and allow typeAttr
in the SVGScriptElement case to be useable for fastGetAttribute.

Test: svg/dom/SVGScriptElement/script-type-attribute.svg

* svg/SVGElement.h:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::isAnimatableAttribute):
* svg/SVGScriptElement.h:

LayoutTests:

Add test to verify the new type getter/setter behavior on SVScriptElement.
Specifically, the old behavior was setting the JS type property did not reflect in
the actual content attribute being set, the new behavior is to do set the content
attribute when setting the JS type property.

* svg/dom/SVGScriptElement/script-type-attribute-expected.txt: Added.
* svg/dom/SVGScriptElement/script-type-attribute.svg: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 35431ffe
2013-12-13 Rob Buis <rob.buis@samsung.com>
Clean up SVGScriptElement
https://bugs.webkit.org/show_bug.cgi?id=125527
Reviewed by Darin Adler.
Add test to verify the new type getter/setter behavior on SVScriptElement.
Specifically, the old behavior was setting the JS type property did not reflect in
the actual content attribute being set, the new behavior is to do set the content
attribute when setting the JS type property.
* svg/dom/SVGScriptElement/script-type-attribute-expected.txt: Added.
* svg/dom/SVGScriptElement/script-type-attribute.svg: Added.
2013-12-13 Michał Pakuła vel Rutka <m.pakula@samsung.com>
Unreviewed EFL gardening
Test that getting/setting the type JS property on SVGScriptElement keeps sync with the type content attribute.
PASS
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" onload="test()">
<script type="text/javascript">
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
}
var script = document.createElementNS("http://www.w3.org/2000/svg", "svg:script");
script.type = "text/javascript";
if (script.type != "text/javascript" || script.getAttribute("type") != "text/javascript") {
document.getElementById("p0").innerHTML = "FAIL";
return;
}
script.setAttribute("type", "text/fooscript");
if (script.type != "text/fooscript" || script.getAttribute("type") != "text/fooscript")
document.getElementById("p0").innerHTML = "FAIL";
}
</script>
<foreignObject>
<xhtml:p>Test that getting/setting the type JS property on SVGScriptElement keeps sync with the type content attribute.</xhtml:p>
<xhtml:span id="p0">PASS</xhtml:span>
</foreignObject>
</svg>
2013-12-13 Rob Buis <rob.buis@samsung.com>
Clean up SVGScriptElement
https://bugs.webkit.org/show_bug.cgi?id=125527
Reviewed by Darin Adler.
From the Blink port of this bug it becomes clear that svg/dom/SVGScriptElement/script-set-href.svg and
svg/dom/svg-element-attribute-js-null.xhtml still hit an assert in Debug because SVGNames::typeAttr can't
be used with fastGetAttribute in all cases, because it can be animatable. However for SVGScriptElement
it is not animatable, so make isAnimatableAttribute virtual (note Debug only method) and allow typeAttr
in the SVGScriptElement case to be useable for fastGetAttribute.
Test: svg/dom/SVGScriptElement/script-type-attribute.svg
* svg/SVGElement.h:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::isAnimatableAttribute):
* svg/SVGScriptElement.h:
2013-12-13 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Expose also webkit_dom_document_get_url
......@@ -123,7 +123,7 @@ public:
virtual void synchronizeSystemLanguage() { }
#ifndef NDEBUG
bool isAnimatableAttribute(const QualifiedName&) const;
virtual bool isAnimatableAttribute(const QualifiedName&) const;
#endif
MutableStyleProperties* animatedSMILStyleProperties() const;
......
......@@ -198,6 +198,16 @@ PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
return adoptRef(new SVGScriptElement(tagQName(), document(), false, alreadyStarted()));
}
#ifndef NDEBUG
bool SVGScriptElement::isAnimatableAttribute(const QualifiedName& name) const
{
if (name == SVGNames::typeAttr)
return false;
return SVGElement::isAnimatableAttribute(name);
}
#endif
}
#endif // ENABLE(SVG)
......@@ -38,6 +38,9 @@ class SVGScriptElement FINAL : public SVGElement
public:
static PassRefPtr<SVGScriptElement> create(const QualifiedName&, Document&, bool wasInsertedByParser);
#ifndef NDEBUG
virtual bool isAnimatableAttribute(const QualifiedName&) const;
#endif
private:
SVGScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment