Changeset 30034 in webkit
- Timestamp:
- Feb 5, 2008 8:36:31 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r30003 r30034 1 2008-02-05 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Fix for http://bugs.webkit.org/show_bug.cgi?id=8080 6 NodeList (and other DOM lists) items are not enumeratable using for..in 7 8 * JavaScriptCore.exp: 9 1 10 2008-02-05 Mark Rowe <mrowe@apple.com> 2 11 -
trunk/JavaScriptCore/JavaScriptCore.exp
r29943 r30034 181 181 __ZN3KJS7UString3Rep4nullE 182 182 __ZN3KJS7UString3Rep7destroyEv 183 __ZN3KJS7UString4fromEj 183 184 __ZN3KJS7UString6appendERKS0_ 184 185 __ZN3KJS7UStringC1EPKNS_5UCharEi -
trunk/LayoutTests/ChangeLog
r30033 r30034 1 2008-02-05 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Test for http://bugs.webkit.org/show_bug.cgi?id=8080 6 NodeList (and other DOM lists) items are not enumeratable using for..in 7 8 * fast/dom/domListEnumeration-expected.txt: Added. 9 * fast/dom/domListEnumeration.html: Added. 10 * fast/dom/resources/domListEnumeration.js: Added. 11 1 12 2008-02-05 Nikolas Zimmermann <zimmermann@kde.org> 2 13 -
trunk/WebCore/ChangeLog
r30032 r30034 1 2008-02-05 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Fix for http://bugs.webkit.org/show_bug.cgi?id=8080 6 NodeList (and other DOM lists) items are not enumeratable using for..in 7 8 - Match Firefox when enumerating DOM interfaces with indexGetters (support for 9 the array bracket, nodeList[0], notation) by including all the items in the 10 list before the attributes and methods of the interface. 11 12 Test: fast/dom/domListEnumeration.html 13 14 * ForwardingHeaders/kjs/PropertyNameArray.h: Added. 15 * bindings/js/JSDOMWindowCustom.cpp: 16 (WebCore::JSDOMWindow::customGetPropertyNames): Use the new custom method model. 17 * bindings/js/JSHistoryCustom.cpp: 18 (WebCore::JSHistory::customGetPropertyNames): ditto. 19 * bindings/scripts/CodeGeneratorJS.pm: Instead of just adding a declaration of 20 getProperyNames and implementing the method in the Custom.cpp, move to a the 21 model used by generated getOwnPropertySlot() and put() where the custom code 22 is written in a separate customGetPropertyNames which returns a bool indicating 23 whether to call up to the base class. This enables adding the list indexes 24 to the PropertyNameArray for interfaces with indexGetters automatically. 25 1 26 2008-02-05 Samuel Weinig <sam@webkit.org> 2 27 -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r30032 r30034 126 126 } 127 127 128 void JSDOMWindow::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)128 bool JSDOMWindow::customGetPropertyNames(ExecState* exec, PropertyNameArray&) 129 129 { 130 130 // Only allow the window to enumerated by frames in the same origin. 131 131 if (!allowsAccessFrom(exec)) 132 return ;133 Base::getPropertyNames(exec, propertyNames);132 return true; 133 return false; 134 134 } 135 135 -
trunk/WebCore/bindings/js/JSHistoryCustom.cpp
r30032 r30034 85 85 } 86 86 87 void JSHistory::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)87 bool JSHistory::customGetPropertyNames(ExecState* exec, PropertyNameArray&) 88 88 { 89 89 // Only allow the history object to enumerated by frames in the same origin. 90 90 if (!allowsAccessFromFrame(exec, impl()->frame())) 91 return ;92 Base::getPropertyNames(exec, propertyNames);91 return true; 92 return false; 93 93 } 94 94 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r30032 r30034 370 370 371 371 # Custom getPropertyNames function 372 push(@headerContent, " virtual void getPropertyNames(KJS::ExecState*, KJS::PropertyNameArray&);\n") if $dataNode->extendedAttributes->{"CustomGetPropertyNames"}; 372 push(@headerContent, " virtual void getPropertyNames(KJS::ExecState*, KJS::PropertyNameArray&);\n") if ($dataNode->extendedAttributes->{"CustomGetPropertyNames"} || $dataNode->extendedAttributes->{"HasIndexGetter"}); 373 push(@headerContent, " bool customGetPropertyNames(KJS::ExecState*, KJS::PropertyNameArray&);\n") if $dataNode->extendedAttributes->{"CustomGetPropertyNames"}; 373 374 374 375 # Constructor object getter … … 587 588 push(@implContentHeader, "#include \"$className.h\"\n\n"); 588 589 push(@implContentHeader, "#include <wtf/GetPtr.h>\n\n"); 590 591 push(@implContentHeader, "#include <kjs/PropertyNameArray.h>\n") if $dataNode->extendedAttributes->{"HasIndexGetter"}; 589 592 590 593 AddIncludesForType($interfaceName); … … 1056 1059 } 1057 1060 1061 if ($dataNode->extendedAttributes->{"CustomGetPropertyNames"} || $dataNode->extendedAttributes->{"HasIndexGetter"}) { 1062 push(@implContent, "void ${className}::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)\n"); 1063 push(@implContent, "{\n"); 1064 if ($dataNode->extendedAttributes->{"CustomGetPropertyNames"}) { 1065 push(@implContent, " if (customGetPropertyNames(exec, propertyNames))\n"); 1066 push(@implContent, " return;\n"); 1067 } 1068 if ($dataNode->extendedAttributes->{"HasIndexGetter"}) { 1069 push(@implContent, " for (unsigned i = 0; i < static_cast<${implClassName}*>(impl())->length(); ++i)\n"); 1070 push(@implContent, " propertyNames.add(Identifier::from(i));\n"); 1071 } 1072 push(@implContent, " Base::getPropertyNames(exec, propertyNames);\n"); 1073 push(@implContent, "}\n\n"); 1074 } 1075 1058 1076 if ($dataNode->extendedAttributes->{"GenerateConstructor"}) { 1059 1077 push(@implContent, "JSValue* ${className}::getConstructor(ExecState* exec)\n{\n"); 1060 1078 push(@implContent, " return KJS::cacheGlobalObject<${className}Constructor>(exec, \"[[${interfaceName}.constructor]]\");\n"); 1061 push(@implContent, "}\n ");1079 push(@implContent, "}\n\n"); 1062 1080 } 1063 1081
Note: See TracChangeset
for help on using the changeset viewer.