Bug 48193 - HTMLFormElement.elements doesn't include fieldsets
: HTMLFormElement.elements doesn't include fieldsets
Status: RESOLVED FIXED
: WebKit
HTML DOM
: 528+ (Nightly build)
: All All
: P3 Normal
Assigned To:
: http://www.whatwg.org/html/#category-...
:
:
:
  Show dependency treegraph
 
Reported: 2010-10-23 13:30 PST by
Modified: 2010-11-29 14:46 PST (History)


Attachments
Patch. (8.16 KB, patch)
2010-11-29 13:35 PST, Yael
darin: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-10-23 13:30:24 PST
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
------- Comment #1 From 2010-10-23 13:31:25 PST -------
In particular, the test should log "[object HTMLFieldSetElement]" or some such, rather than "undefined".
------- Comment #2 From 2010-11-29 13:35:29 PST -------
Created an attachment (id=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.
------- Comment #3 From 2010-11-29 13:40:55 PST -------
(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?
------- Comment #4 From 2010-11-29 13:41:21 PST -------
Do the test results match Firefox and/or IE exactly?
------- Comment #5 From 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.
------- Comment #6 From 2010-11-29 13:46:26 PST -------
(In reply to comment #3)
> (From update of attachment 75054 [details] [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.
------- Comment #7 From 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 .
------- Comment #8 From 2010-11-29 14:46:58 PST -------
Committed r72835: <http://trac.webkit.org/changeset/72835>