Don't force CharacterData to override getOwnPropertySlot.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jun 2014 20:49:42 +0000 (20:49 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jun 2014 20:49:42 +0000 (20:49 +0000)
<https://webkit.org/b/133717>

This was preventing us from taking the GetByVal fast path for Text nodes
since they inherit from CharacterData and having a "length" attribute
meant we gave them a custom getOwnPropertySlot, despite not actually
needing it for anything.

Reviewed by Anders Carlsson.

* bindings/scripts/CodeGeneratorJS.pm:
(AttributeShouldBeOnInstance):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

index 453a9e3..3a61e95 100644 (file)
@@ -1,3 +1,18 @@
+2014-06-11  Andreas Kling  <akling@apple.com>
+
+        Don't force CharacterData to override getOwnPropertySlot.
+        <https://webkit.org/b/133717>
+
+        This was preventing us from taking the GetByVal fast path for Text nodes
+        since they inherit from CharacterData and having a "length" attribute
+        meant we gave them a custom getOwnPropertySlot, despite not actually
+        needing it for anything.
+
+        Reviewed by Anders Carlsson.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AttributeShouldBeOnInstance):
+
 2014-06-11  Anders Carlsson  <andersca@apple.com>
 
         Add a script that generates a gperf hash for HTTP header names
index af0ea8e..f3ec49a 100644 (file)
@@ -676,7 +676,7 @@ sub AttributeShouldBeOnInstance
     # objects which also have magic named attributes that can end up being named "length"
     # and so interfere with lookup ordering.  I'm not sure what the correct solution is
     # here.
-    return 1 if ($attribute->signature->name eq "length");
+    return 1 if ($attribute->signature->name eq "length") && $interface->name ne "CharacterData";
     
     # It becomes hard to reason about attributes that require security checks if we push
     # them down the prototype chain, so before we do these we'll need to carefully consider