RESOLVED FIXED 48193
HTMLFormElement.elements doesn't include fieldsets
https://bugs.webkit.org/show_bug.cgi?id=48193
Summary HTMLFormElement.elements doesn't include fieldsets
Ms2ger (he/him; ⌚ UTC+1/+2)
Reported 2010-10-23 13:30:24 PDT
Fieldset is a listed element (see $URL). Test: <http://software.hixie.ch/utilities/js/live-dom-viewer/saved/674> Tested with: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7 Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.11 Safari/534.10
Attachments
Patch. (8.16 KB, patch)
2010-11-29 13:35 PST, Yael
darin: review+
Ms2ger (he/him; ⌚ UTC+1/+2)
Comment 1 2010-10-23 13:31:25 PDT
In particular, the test should log "[object HTMLFieldSetElement]" or some such, rather than "undefined".
Yael
Comment 2 2010-11-29 13:35:29 PST
Created attachment 75054 [details] Patch. Added filedset and keygen to HTMLFormElement.elements by making them enumeratable. object element should be listed as well and I will file a separate bug for that.
Darin Adler
Comment 3 2010-11-29 13:40:55 PST
Comment on attachment 75054 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=75054&action=review > WebCore/html/HTMLKeygenElement.h:39 > - virtual bool isEnumeratable() const { return false; } > + virtual bool isEnumeratable() const { return true; } You should instead just remove this member function entirely. The function inherited from HTMLSelectElement already returns true, there is no need to override. > LayoutTests/fast/forms/script-tests/form-collection-elements.js:2 > +debug("This test does not add object element as a listed element. Separate bug will be filed for that."); I don’t think “separate bug will be filed” makes sense in a comment in the test. Maybe you mean we’ll test that with a separate test?
Alexey Proskuryakov
Comment 4 2010-11-29 13:41:21 PST
Do the test results match Firefox and/or IE exactly?
Yael
Comment 5 2010-11-29 13:45:11 PST
(In reply to comment #4) > Do the test results match Firefox and/or IE exactly? Firefox and Opera do list keygen, fieldset and object. I am still testing on IE. Will have the results before committing this patch. Firefox does not list output element though.
Yael
Comment 6 2010-11-29 13:46:26 PST
(In reply to comment #3) > (From update of attachment 75054 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=75054&action=review > > > WebCore/html/HTMLKeygenElement.h:39 > > - virtual bool isEnumeratable() const { return false; } > > + virtual bool isEnumeratable() const { return true; } > > You should instead just remove this member function entirely. The function inherited from HTMLSelectElement already returns true, there is no need to override. > > > LayoutTests/fast/forms/script-tests/form-collection-elements.js:2 > > +debug("This test does not add object element as a listed element. Separate bug will be filed for that."); > > I don’t think “separate bug will be filed” makes sense in a comment in the test. Maybe you mean we’ll test that with a separate test? Thank you for the review. I will make the adjustments before committing. Since object elemnt is not as straightforward as keygen and fieldset, I filed https://bugs.webkit.org/show_bug.cgi?id=50179 to fix that.
Yael
Comment 7 2010-11-29 14:21:01 PST
(In reply to comment #4) > Do the test results match Firefox and/or IE exactly? IE9 Beta does not support keygen element, but it does list fieldset in HTMLFormElement.elements .
Yael
Comment 8 2010-11-29 14:46:58 PST
Note You need to log in before you can comment on or make changes to this bug.