Title: [138277] trunk/Source/WebCore
Revision
138277
Author
[email protected]
Date
2012-12-20 11:16:00 -0800 (Thu, 20 Dec 2012)

Log Message

REGRESSION(r138263): Don't use fastGetAttribute for HTMLNames::classAttr because it breaks on SVGElement
https://bugs.webkit.org/show_bug.cgi?id=105555

Reviewed by Tony Chang.

The code generated generated code that uses fastGetAttribute for the className WebIDL attribute getter.
However, this attribute is animatable in SVG so we cannot use the fast function for it.

No new tests. The assert is no longer hit.

* bindings/scripts/CodeGenerator.pm:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (138276 => 138277)


--- trunk/Source/WebCore/ChangeLog	2012-12-20 19:14:39 UTC (rev 138276)
+++ trunk/Source/WebCore/ChangeLog	2012-12-20 19:16:00 UTC (rev 138277)
@@ -1,3 +1,17 @@
+2012-12-20  Erik Arvidsson  <[email protected]>
+
+        REGRESSION(r138263): Don't use fastGetAttribute for HTMLNames::classAttr because it breaks on SVGElement
+        https://bugs.webkit.org/show_bug.cgi?id=105555
+
+        Reviewed by Tony Chang.
+
+        The code generated generated code that uses fastGetAttribute for the className WebIDL attribute getter.
+        However, this attribute is animatable in SVG so we cannot use the fast function for it.
+
+        No new tests. The assert is no longer hit.
+
+        * bindings/scripts/CodeGenerator.pm:
+
 2012-12-20  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Add API to set a TLS errors policy to WebKit2 GTK+ API

Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (138276 => 138277)


--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2012-12-20 19:14:39 UTC (rev 138276)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2012-12-20 19:16:00 UTC (rev 138277)
@@ -567,10 +567,14 @@
 
 sub CanUseFastAttribute
 {
-    my ($generator, $attribute) = @_;
+    my ($generator, $attribute, $contentAttributeName) = @_;
     my $attributeType = $attribute->signature->type;
     # HTMLNames::styleAttr cannot be used with fast{Get,Has}Attribute but we do not [Reflect] the
     # style attribute.
+
+    # Unfortunately SVG makes class animatable.
+    return 0 if $contentAttributeName eq "WebCore::HTMLNames::classAttr";
+
     return !$generator->IsSVGAnimatedType($attributeType);
 }
 
@@ -589,7 +593,7 @@
         $functionName = "getURLAttribute";
     } elsif ($attribute->signature->type eq "boolean") {
         my $namespace = $generator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
-        if ($generator->CanUseFastAttribute($attribute)) {
+        if ($generator->CanUseFastAttribute($attribute, $contentAttributeName)) {
             $functionName = "fastHasAttribute";
         } else {
             $functionName = "hasAttribute";
@@ -599,7 +603,7 @@
     } elsif ($attribute->signature->type eq "unsigned long") {
         $functionName = "getUnsignedIntegralAttribute";
     } else {
-        if ($generator->CanUseFastAttribute($attribute)) {
+        if ($generator->CanUseFastAttribute($attribute, $contentAttributeName)) {
             $functionName = "fastGetAttribute";
         } else {
             $functionName = "getAttribute";
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to