If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Implement HTMLFormControlsCollection

RESOLVED FIXED in mozilla27

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

(Depends on: 1 bug, {dev-doc-complete})

Trunk
mozilla27
dev-doc-complete
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Comment hidden (empty)
Keywords: dev-doc-needed
(Assignee)

Comment 1

4 years ago
Created attachment 810713 [details] [diff] [review]
Part a: Rename nsFormControlList and move it to its own files
Attachment #810713 - Flags: review?(dzbarsky)
(Assignee)

Comment 2

4 years ago
Created attachment 810714 [details] [diff] [review]
Part b: Implement HTMLFormControlsCollection and use it for HTMLFormElement.elements
Attachment #810714 - Flags: review?(dzbarsky)
Comment on attachment 810713 [details] [diff] [review]
Part a: Rename nsFormControlList and move it to its own files

Review of attachment 810713 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/html/content/src/HTMLFormControlsCollection.cpp
@@ +75,2 @@
>  {
>    SetIsDOMBinding();

If you're doing this can you also change the colon to be on the next line?  Seems odd otherwise.

::: content/html/content/src/HTMLFormElement.cpp
@@ +979,2 @@
>  {
>    NS_ASSERTION(aElement1 != aElement2, "Comparing a form control to itself");

Why are you changing these?
Attachment #810713 - Flags: review?(dzbarsky) → review+
Comment on attachment 810714 [details] [diff] [review]
Part b: Implement HTMLFormControlsCollection and use it for HTMLFormElement.elements

Review of attachment 810714 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/html/content/src/HTMLFormControlsCollection.cpp
@@ +375,5 @@
> +  if (nsCOMPtr<Element> element = do_QueryInterface(item)) {
> +    aResult.SetValue().SetAsElement() = element;
> +    return;
> +  }
> +  if (nsCOMPtr<nsINodeList> nodelist = do_QueryInterface(item)) {

This seems a little sad, but I guess you have to implement nsIHTMLCollection?

::: content/html/content/test/test_formelements.html
@@ +50,5 @@
>  is(names[7], "y", "Entry 8")
>  is(names[8], "z", "Entry 9")
>  is(names[9], "something", "Entry 10")
> +is(names[10], "namedItem", "Entry 11")
> +is(names[11], "item", "Entry 12")

OOC, what determines the order here?
Attachment #810714 - Flags: review?(dzbarsky) → review+
(Assignee)

Comment 5

4 years ago
(In reply to David Zbarsky (:dzbarsky) from comment #4)
> Comment on attachment 810714 [details] [diff] [review]
> Part b: Implement HTMLFormControlsCollection and use it for
> HTMLFormElement.elements
> 
> Review of attachment 810714 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: content/html/content/src/HTMLFormControlsCollection.cpp
> @@ +375,5 @@
> > +  if (nsCOMPtr<Element> element = do_QueryInterface(item)) {
> > +    aResult.SetValue().SetAsElement() = element;
> > +    return;
> > +  }
> > +  if (nsCOMPtr<nsINodeList> nodelist = do_QueryInterface(item)) {
> 
> This seems a little sad, but I guess you have to implement nsIHTMLCollection?
> 
> ::: content/html/content/test/test_formelements.html
> @@ +50,5 @@
> >  is(names[7], "y", "Entry 8")
> >  is(names[8], "z", "Entry 9")
> >  is(names[9], "something", "Entry 10")
> > +is(names[10], "namedItem", "Entry 11")
> > +is(names[11], "item", "Entry 12")
> 
> OOC, what determines the order here?

I think it walks the proto chain, and then... something.
(Assignee)

Comment 6

4 years ago
https://hg.mozilla.org/mozilla-central/rev/d1ff09ace32b
https://hg.mozilla.org/mozilla-central/rev/0779196218d2
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
(Assignee)

Comment 7

4 years ago
(In reply to David Zbarsky (:dzbarsky) from comment #3)
> Comment on attachment 810713 [details] [diff] [review]
> Part a: Rename nsFormControlList and move it to its own files
> 
> Review of attachment 810713 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: content/html/content/src/HTMLFormElement.cpp
> @@ +979,2 @@
> >  {
> >    NS_ASSERTION(aElement1 != aElement2, "Comparing a form control to itself");
> 
> Why are you changing these?

Seems like I never answered this; because those functions are called from both HTMLFormElement.cpp and HTMLFormControlsCollection.cpp now.
Target Milestone: mozilla27 → ---
Reverting the target milestone as I believe it was removed by error. (and Ms2ger not on IRC to double-check). Remove it again if I'm mistaken.
Target Milestone: --- → mozilla27
Doc updated:
https://developer.mozilla.org/en-US/Firefox/Releases/27
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection.namedItem
Keywords: dev-doc-needed → dev-doc-complete
Depends on: 1096628
You need to log in before you can comment on or make changes to this bug.