[Bug 15704] New: HTMLFormElement::elements is not compatible with existing UAs

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15704

           Summary: HTMLFormElement::elements is not compatible with
                    existing UAs
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: tkent@chromium.org
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


http://dev.w3.org/html5/spec/Overview.html#dom-form-elements
> The elements IDL attribute must return an HTMLFormControlsCollection rooted at the Document node, whose filter matches listed elements whose form owner is the form element,  ...

The specification says "rooted at the Document", so ::elements fo a <form> not
in the document tree should be empty. However, IE, Firefox, Opera, and WebKit
return non-empty collections for ::elements.

<script>
var f1 = document.createElement('form');
f1.appendChild(document.createElement('input'));
alert(f1.elements.length);
</script>

This code alerts '1' with major browsers though it should be '0' because
<input> is not in the Document tree.

I personally like the current definition of the specification, but it's not
compatible.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 25 January 2012 03:27:20 UTC