No subject


Sun Dec 8 17:39:16 PST 2013


ement/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 o=
nly 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 r=
eflect 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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a=
></li>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCoresvgSVGElementh">trunk/Source/WebCore/sv=
g/SVGElement.h</a></li>
<li><a href=3D"#trunkSourceWebCoresvgSVGScriptElementcpp">trunk/Source/We=
bCore/svg/SVGScriptElement.cpp</a></li>
<li><a href=3D"#trunkSourceWebCoresvgSVGScriptElementh">trunk/Source/WebC=
ore/svg/SVGScriptElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestssvgdomSVGScriptElementscripttypeattribute=
expectedtxt">trunk/LayoutTests/svg/dom/SVGScriptElement/script-type-attri=
bute-expected.txt</a></li>
<li><a href=3D"#trunkLayoutTestssvgdomSVGScriptElementscripttypeattribute=
svg">trunk/LayoutTests/svg/dom/SVGScriptElement/script-type-attribute.svg=
</a></li>
</ul>

</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkLayoutTestsChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160543 =
=3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog	2013-12-13 12:40:06 =
UTC (rev 160543)
+++ trunk/LayoutTests/ChangeLog	2013-12-13 14:13:26 UTC (rev 160544)
</span><span class=3D"lines">@@ -1,3 +1,18 @@
</span><ins>+2013-12-13  Rob Buis  &lt;rob.buis at samsung.com&gt;
+
+        Clean up SVGScriptElement
+        https://bugs.webkit.org/show_bug.cgi?id=3D125527
+
+        Reviewed by Darin Adler.
+
+        Add test to verify the new type getter/setter behavior on SVScri=
ptElement.
+        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 d=
o set the content
+        attribute when setting the JS type property.
+
+        * svg/dom/SVGScriptElement/script-type-attribute-expected.txt: A=
dded.
+        * svg/dom/SVGScriptElement/script-type-attribute.svg: Added.
+
</ins><span class=3D"cx"> 2013-12-13  Micha=C5=82 Paku=C5=82a vel Rutka  =
&lt;m.pakula at samsung.com&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         Unreviewed EFL gardening
</span></span></pre></div>
<a id=3D"trunkLayoutTestssvgdomSVGScriptElementscripttypeattributeexpecte=
dtxt"></a>
<div class=3D"addfile"><h4>Added: trunk/LayoutTests/svg/dom/SVGScriptElem=
ent/script-type-attribute-expected.txt (0 =3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/svg/dom/SVGScriptElement/scrip=
t-type-attribute-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/dom/SVGScriptElement/script-type-attribute-expe=
cted.txt	2013-12-13 14:13:26 UTC (rev 160544)
</span><span class=3D"lines">@@ -0,0 +1,3 @@
</span><ins>+Test that getting/setting the type JS property on SVGScriptE=
lement keeps sync with the type content attribute.
+
+PASS
</ins></span></pre></div>
<a id=3D"trunkLayoutTestssvgdomSVGScriptElementscripttypeattributesvg"></=
a>
<div class=3D"addfile"><h4>Added: trunk/LayoutTests/svg/dom/SVGScriptElem=
ent/script-type-attribute.svg (0 =3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/svg/dom/SVGScriptElement/scrip=
t-type-attribute.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/dom/SVGScriptElement/script-type-attribute.svg	=
2013-12-13 14:13:26 UTC (rev 160544)
</span><span class=3D"lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;svg xmlns=3D&quot;http://www.w3.org/2000/svg&quot; xmlns=
:xhtml=3D&quot;http://www.w3.org/1999/xhtml&quot; onload=3D&quot;test()&q=
uot;&gt;
+&lt;script type=3D&quot;text/javascript&quot;&gt;
+function test() {
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+    }
+
+    var script =3D document.createElementNS(&quot;http://www.w3.org/2000=
/svg&quot;, &quot;svg:script&quot;);
+    script.type =3D &quot;text/javascript&quot;;
+    if (script.type !=3D &quot;text/javascript&quot; || script.getAttrib=
ute(&quot;type&quot;) !=3D &quot;text/javascript&quot;) {
+        document.getElementById(&quot;p0&quot;).innerHTML =3D &quot;FAIL=
&quot;;
+        return;
+    }
+
+    script.setAttribute(&quot;type&quot;, &quot;text/fooscript&quot;);
+    if (script.type !=3D &quot;text/fooscript&quot; || script.getAttribu=
te(&quot;type&quot;) !=3D &quot;text/fooscript&quot;)
+        document.getElementById(&quot;p0&quot;).innerHTML =3D &quot;FAIL=
&quot;;
+}
+&lt;/script&gt;
+&lt;foreignObject&gt;
+&lt;xhtml:p&gt;Test that getting/setting the type JS property on SVGScri=
ptElement keeps sync with the type content attribute.&lt;/xhtml:p&gt;
+&lt;xhtml:span id=3D&quot;p0&quot;&gt;PASS&lt;/xhtml:span&gt;
+&lt;/foreignObject&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1605=
43 =3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog	2013-12-13 12:40:=
06 UTC (rev 160543)
+++ trunk/Source/WebCore/ChangeLog	2013-12-13 14:13:26 UTC (rev 160544)
</span><span class=3D"lines">@@ -1,3 +1,23 @@
</span><ins>+2013-12-13  Rob Buis  &lt;rob.buis at samsung.com&gt;
+
+        Clean up SVGScriptElement
+        https://bugs.webkit.org/show_bug.cgi?id=3D125527
+
+        Reviewed by Darin Adler.
+
+        From the Blink port of this bug it becomes clear that svg/dom/SV=
GScriptElement/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 an=
imatable. However for SVGScriptElement
+        it is not animatable, so make isAnimatableAttribute virtual (not=
e 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:
+
</ins><span class=3D"cx"> 2013-12-13  Carlos Garcia Campos  &lt;cgarcia at i=
galia.com&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         [GTK] Expose also webkit_dom_document_=
get_url
</span></span></pre></div>
<a id=3D"trunkSourceWebCoresvgSVGElementh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.=
h (160543 =3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/svg/SVGElement.h	2013-12-13=
 12:40:06 UTC (rev 160543)
+++ trunk/Source/WebCore/svg/SVGElement.h	2013-12-13 14:13:26 UTC (rev 16=
0544)
</span><span class=3D"lines">@@ -123,7 +123,7 @@
</span><span class=3D"cx">     virtual void synchronizeSystemLanguage() {=
 }
</span><span class=3D"cx">=20
</span><span class=3D"cx"> #ifndef NDEBUG
</span><del>-    bool isAnimatableAttribute(const QualifiedName&amp;) con=
st;
</del><ins>+    virtual bool isAnimatableAttribute(const QualifiedName&am=
p;) const;
</ins><span class=3D"cx"> #endif
</span><span class=3D"cx">=20
</span><span class=3D"cx">     MutableStyleProperties* animatedSMILStyleP=
roperties() const;
</span></span></pre></div>
<a id=3D"trunkSourceWebCoresvgSVGScriptElementcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGScriptEl=
ement.cpp (160543 =3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/svg/SVGScriptElement.cpp	20=
13-12-13 12:40:06 UTC (rev 160543)
+++ trunk/Source/WebCore/svg/SVGScriptElement.cpp	2013-12-13 14:13:26 UTC=
 (rev 160544)
</span><span class=3D"lines">@@ -198,6 +198,16 @@
</span><span class=3D"cx">     return adoptRef(new SVGScriptElement(tagQN=
ame(), document(), false, alreadyStarted()));
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+#ifndef NDEBUG
+bool SVGScriptElement::isAnimatableAttribute(const QualifiedName&amp; na=
me) const
+{
+    if (name =3D=3D SVGNames::typeAttr)
+        return false;
+
+    return SVGElement::isAnimatableAttribute(name);
</ins><span class=3D"cx"> }
</span><ins>+#endif
</ins><span class=3D"cx">=20
</span><ins>+}
+
</ins><span class=3D"cx"> #endif // ENABLE(SVG)
</span></span></pre></div>
<a id=3D"trunkSourceWebCoresvgSVGScriptElementh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGScriptEl=
ement.h (160543 =3D> 160544)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/svg/SVGScriptElement.h	2013=
-12-13 12:40:06 UTC (rev 160543)
+++ trunk/Source/WebCore/svg/SVGScriptElement.h	2013-12-13 14:13:26 UTC (=
rev 160544)
</span><span class=3D"lines">@@ -38,6 +38,9 @@
</span><span class=3D"cx"> public:
</span><span class=3D"cx">     static PassRefPtr&lt;SVGScriptElement&gt; =
create(const QualifiedName&amp;, Document&amp;, bool wasInsertedByParser)=
;
</span><span class=3D"cx">=20
</span><ins>+#ifndef NDEBUG
+    virtual bool isAnimatableAttribute(const QualifiedName&amp;) const;
+#endif
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> private:
</span><span class=3D"cx">     SVGScriptElement(const QualifiedName&amp;,=
 Document&amp;, bool wasInsertedByParser, bool alreadyStarted);
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list