Closed Bug 1013316 Opened 12 years ago Closed 12 years ago

Implement HTMLAllCollection::GetSupportedNames

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: Ms2ger, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
This also fixes the GetSupportedNames on nsContentList HTMLCollections to follow the spec.
Attachment #8425856 - Flags: review?(bugs)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: [need review]
This also fixes the GetSupportedNames on nsContentList HTMLCollections to follow the spec.
Attachment #8425963 - Flags: review?(bugs)
Attachment #8425856 - Attachment is obsolete: true
Attachment #8425856 - Flags: review?(bugs)
Comment on attachment 8425963 [details] [diff] [review] Implement GetSupportedNames on HTMLAllCollection > static bool >+IsAllNamedElement(nsIContent* aContent) >+{ >+ nsIAtom* tag = aContent->Tag(); >+ return >+ tag == nsGkAtoms::a || >+ tag == nsGkAtoms::applet || >+ tag == nsGkAtoms::button || >+ tag == nsGkAtoms::embed || >+ tag == nsGkAtoms::form || >+ tag == nsGkAtoms::iframe || >+ tag == nsGkAtoms::img || >+ tag == nsGkAtoms::input || >+ tag == nsGkAtoms::map || >+ tag == nsGkAtoms::meta || >+ tag == nsGkAtoms::object || >+ tag == nsGkAtoms::select || >+ tag == nsGkAtoms::textarea; This list should have also frame and frameset >+ nsGenericHTMLElement* el = nsGenericHTMLElement::FromContent(content); >+ if (el) { >+ // Note: nsINode::HasName means the name is exposed on the document, >+ // which is false for options, so we don't check it here. >+ const nsAttrValue* val = el->GetParsedAttr(nsGkAtoms::name); >+ if (val && val->Type() == nsAttrValue::eAtom && >+ IsAllNamedElement(content)) { Not sure which is faster here. GetParsedAttr or IsAllNamedElement. I guess this is fine.
Attachment #8425963 - Flags: review?(bugs) → review+
Flags: in-testsuite+
Whiteboard: [need review]
Hi Boris, sorry had to backout this change in https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=919fcf9baa00 since one of this 2 csets caused test failures like https://tbpl.mozilla.org/php/getParsedLog.php?id=40160645&tree=Mozilla-Inbound on all platforms
(In reply to Olli Pettay [:smaug] from comment #3) > Comment on attachment 8425963 [details] [diff] [review] > Implement GetSupportedNames on HTMLAllCollection > > > > static bool > >+IsAllNamedElement(nsIContent* aContent) > >+{ > >+ nsIAtom* tag = aContent->Tag(); > >+ return > >+ tag == nsGkAtoms::a || > >+ tag == nsGkAtoms::applet || > >+ tag == nsGkAtoms::button || > >+ tag == nsGkAtoms::embed || > >+ tag == nsGkAtoms::form || > >+ tag == nsGkAtoms::iframe || > >+ tag == nsGkAtoms::img || > >+ tag == nsGkAtoms::input || > >+ tag == nsGkAtoms::map || > >+ tag == nsGkAtoms::meta || > >+ tag == nsGkAtoms::object || > >+ tag == nsGkAtoms::select || > >+ tag == nsGkAtoms::textarea; > > > This list should have also frame and frameset content/html/document/test/test_documentAll.html seems to have disagreed.
Gah, that's what I get for addressing review comments after the try run. ;) > content/html/document/test/test_documentAll.html seems to have disagreed. It also disagrees with the spec, so it's just wrong.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: