Closed
Bug 1013316
Opened 12 years ago
Closed 12 years ago
Implement HTMLAllCollection::GetSupportedNames
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: Ms2ger, Assigned: bzbarsky)
References
Details
Attachments
(1 file, 1 obsolete file)
|
10.01 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•12 years ago
|
||
This also fixes the GetSupportedNames on nsContentList HTMLCollections to follow the spec.
Attachment #8425856 -
Flags: review?(bugs)
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
| Assignee | ||
Updated•12 years ago
|
Whiteboard: [need review]
| Assignee | ||
Comment 2•12 years ago
|
||
This also fixes the GetSupportedNames on nsContentList HTMLCollections to follow the spec.
Attachment #8425963 -
Flags: review?(bugs)
| Assignee | ||
Updated•12 years ago
|
Attachment #8425856 -
Attachment is obsolete: true
Attachment #8425856 -
Flags: review?(bugs)
Comment 3•12 years ago
|
||
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+
| Assignee | ||
Comment 4•12 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need review]
Comment 5•12 years ago
|
||
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
| Reporter | ||
Comment 6•12 years ago
|
||
(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.
| Assignee | ||
Comment 7•12 years ago
|
||
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.
| Assignee | ||
Comment 8•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8ceaed67eda4 with that test fixed.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•