JavaScriptCore:
Reviewed by Anders Carlsson.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8080
NodeList (and other DOM lists) items are not enumeratable using for..in
* JavaScriptCore.exp:
WebCore:
Reviewed by Anders Carlsson.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8080
NodeList (and other DOM lists) items are not enumeratable using for..in
- Match Firefox when enumerating DOM interfaces with indexGetters (support for
the array bracket, nodeList[0], notation) by including all the items in the
list before the attributes and methods of the interface.
Test: fast/dom/domListEnumeration.html
* ForwardingHeaders/kjs/PropertyNameArray.h: Added.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::customGetPropertyNames): Use the new custom method model.
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::customGetPropertyNames): ditto.
* bindings/scripts/CodeGeneratorJS.pm: Instead of just adding a declaration of
getProperyNames and implementing the method in the Custom.cpp, move to a the
model used by generated getOwnPropertySlot() and put() where the custom code
is written in a separate customGetPropertyNames which returns a bool indicating
whether to call up to the base class. This enables adding the list indexes
to the PropertyNameArray for interfaces with indexGetters automatically.
LayoutTests:
Reviewed by Anders Carlsson.
Test for http://bugs.webkit.org/show_bug.cgi?id=8080
NodeList (and other DOM lists) items are not enumeratable using for..in
* fast/dom/domListEnumeration-expected.txt: Added.
* fast/dom/domListEnumeration.html: Added.
* fast/dom/resources/domListEnumeration.js: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30034
268f45cc-cd09-0410-ab3c-
d52691b4dbfc