Bug 16656 - Acid3 expects form.elements.length == form.elements
Summary: Acid3 expects form.elements.length == form.elements
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-28 21:57 PST by Eric Seidel (no email)
Modified: 2007-12-28 22:43 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-12-28 21:57:39 PST
// test 56: <form> and .elements
      var ok = false;
      test = document.getElementsByTagName('form')[0];
      if (// test.elements === test || // (IE would fail this, but HTML5 might require it)
          test.elements === test.getAttribute('elements') ||
          test.elements.length != 1 ||
          test.elements.length != test.elements)
        ok = false;
      if (ok)
        return 4;

The only part of that test that we fail is "form.elements.length == form.elements"

I'm not sure why that would be expected.  I guess HTMLCollection is supposed to have a special toNumber implementation which returns the number of elements in the collection!?

It would be nice to see a spec to back up that claim.
Comment 1 Eric Seidel (no email) 2007-12-28 21:59:16 PST
http://www.whatwg.org/specs/web-apps/current-work/#htmlcollection

makes no such reference to this expected toNumber implementation.
Comment 2 Ian 'Hixie' Hickson 2007-12-28 22:37:38 PST
See this is why you shouldn't look at the test before it's ready. :-P

It was supposed to test form.elements.length == form.length. Fixed the test. :-)