[Bug 8197] New: This design might work for JavaScript, but it won't work well in static-typed languages like Java or C#. Instead of overridding "namedItem", a better design would be to add a new method called "allNamedItems" which always returns an HTMLCollection. "nam

http://www.w3.org/Bugs/Public/show_bug.cgi?id=8197

           Summary: This design might work for JavaScript, but it won't work
                    well in static-typed languages like Java or C#.  Instead
                    of overridding "namedItem", a better design would be to
                    add a new method called "allNamedItems" which always
                    returns an HTMLCollection.  "nam
           Product: HTML WG
           Version: unspecified
          Platform: Other
               URL: http://www.whatwg.org/specs/web-apps/current-
                    work/#htmlallcollection-0
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HTML5 spec bugs
        AssignedTo: dave.null@w3.org
        ReportedBy: contributor@whatwg.org
         QAContact: public-html-bugzilla@w3.org
                CC: ian@hixie.ch, mike@w3.org, public-html@w3.org


Section: http://www.whatwg.org/specs/web-apps/current-work/#htmlallcollection-0

Comment:
This design might work for JavaScript, but it won't work well in static-typed
languages like Java or C#.  Instead of overridding "namedItem", a better design
would be to add a new method called "allNamedItems" which always returns an
HTMLCollection.  "namedItem" returns only the first item.  That way you always
know what you're getting, and calling "namedItem" using even the HTMLCollection
interface (which returns an Element) is guaranteed to work.

Posted from: 72.38.162.215


-- 
Configure bugmail: http://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 Thursday, 5 November 2009 12:55:13 UTC