-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove legacycaller from two collections #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7081,7 +7081,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d | |
| // inherits <span data-x="dom-HTMLCollection-length">length</span> and 'getter' | ||
| <span>Element</span>? <span data-x="dom-HTMLAllCollection-item">item</span>(unsigned long index); | ||
| (<span>HTMLCollection</span> or <span>Element</span>)? <span data-x="dom-HTMLAllCollection-item-string">item</span>(DOMString name); | ||
| legacycaller getter (<span>HTMLCollection</span> or <span>Element</span>)? <span data-x="dom-HTMLAllCollection-namedItem">namedItem</span>(DOMString name); // shadows inherited namedItem() | ||
| legacycaller getter (<span>HTMLCollection</span> or <span>Element</span>)? <span data-x="dom-HTMLAllCollection-namedItem">namedItem</span>(DOMString name); // shadows inherited <span data-x="dom-HTMLCollection-namedItem">namedItem()</span> | ||
| };</pre> | ||
|
|
||
| <dl class="domintro"> | ||
|
|
@@ -7199,7 +7199,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d | |
|
|
||
| <pre class="idl">interface <dfn>HTMLFormControlsCollection</dfn> : <span>HTMLCollection</span> { | ||
| // inherits <span data-x="dom-HTMLCollection-length">length</span> and <span data-x="dom-HTMLCollection-item">item</span>() | ||
| legacycaller getter (<span>RadioNodeList</span> or <span>Element</span>)? <span data-x="dom-HTMLFormControlsCollection-namedItem">namedItem</span>(DOMString name); // shadows inherited namedItem() | ||
| getter (<span>RadioNodeList</span> or <span>Element</span>)? <span data-x="dom-HTMLFormControlsCollection-namedItem">namedItem</span>(DOMString name); // shadows inherited <span data-x="dom-HTMLCollection-namedItem">namedItem()</span> | ||
| }; | ||
|
|
||
| interface <dfn>RadioNodeList</dfn> : <span>NodeList</span> { | ||
|
|
@@ -7221,8 +7221,8 @@ interface <dfn>RadioNodeList</dfn> : <span>NodeList</span> { | |
|
|
||
| <dt><var>element</var> = <var>collection</var> . <code subdfn data-x="dom-HTMLFormControlsCollection-namedItem">namedItem</code>(<var>name</var>)</dt> | ||
| <dt><var>radioNodeList</var> = <var>collection</var> . <code data-x="dom-HTMLFormControlsCollection-namedItem">namedItem</code>(<var>name</var>)</dt> | ||
| <dt><var>collection</var>[<var>name</var>]</dt> | ||
| <dt><var>collection</var>(<var>name</var>)</dt> | ||
| <dt><var>element</var> = <var>collection</var>[<var>name</var>]</dt> | ||
| <dt><var>radioNodeList</var> = <var>collection</var>[<var>name</var>]</dt> | ||
| <dd> | ||
| <p>Returns the item with <span data-x="concept-id">ID</span> or <code data-x="attr-fe-name">name</code> <var>name</var> from the collection.</p> | ||
| <p>If there are multiple matching items, then a <code>RadioNodeList</code> object containing all those elements is returned.</p> | ||
|
|
@@ -7339,9 +7339,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. | |
| attributes and methods that manipulate that element's descendants.</p> | ||
|
|
||
| <pre class="idl">interface <dfn>HTMLOptionsCollection</dfn> : <span>HTMLCollection</span> { | ||
| // inherits <span data-x="dom-HTMLCollection-item">item</span>() | ||
| attribute unsigned long <span data-x="dom-HTMLOptionsCollection-length">length</span>; // shadows inherited length | ||
| <span data-x="dom-HTMLOptionsCollection-namedItem">legacycaller</span> <span>HTMLOptionElement</span>? (DOMString name); | ||
| // inherits <span data-x="dom-HTMLCollection-item">item</span>(), <span data-x="dom-HTMLCollection-namedItem">namedItem</span>() | ||
| attribute unsigned long <span data-x="dom-HTMLOptionsCollection-length">length</span>; // shadows inherited <span data-x="dom-HTMLCollection-length">length</span> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Broken; should be data-x not data-
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
| <span data-x="dom-HTMLOptionsCollection-setter">setter</span> void (unsigned long index, <span>HTMLOptionElement</span>? option); | ||
| void <span data-x="dom-HTMLOptionsCollection-add">add</span>((<span>HTMLOptionElement</span> or <span>HTMLOptGroupElement</span>) element, optional (<span>HTMLElement</span> or long)? before = null); | ||
| void <span data-x="dom-HTMLOptionsCollection-remove">remove</span>(long index); | ||
|
|
@@ -7363,10 +7362,17 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. | |
| <p>Returns the item with index <var>index</var> from the collection. The items are sorted in <span>tree order</span>.</p> | ||
| </dd> | ||
|
|
||
| <dt><var>collection</var>[<var>index</var>] = <var>element</var></dt> | ||
| <dd> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should update this with a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess so. Seems like it'd be nice to fix it while you're there since part of this commit is already fixup work in the non-normative sections. Alternately you could make this commit entirely about removing legacycaller, and do a follow-up with the non-normative fixes.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair, will attempt to fix. Are you bothered by the IDL and the non-normative section not being in the same order? I was thinking of fixing that, but it makes the diff harder to read.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't bother me; it seems like the non-normative section is trying to do some sort of logical grouping, which seems fine I guess.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| <p>When <var>index</var> is a greater number than the number of items in the collection, adds | ||
| new blank <code>option</code> elements in the corresponding container. | ||
| <p>When set to null, removes the item at index <var>index</var> from the collection.</p> | ||
| <p>When set to an <code>option</code> element, adds or replaces it at index <var>index</var> | ||
| from the collection.</p> | ||
| </dd> | ||
|
|
||
| <dt><var>element</var> = <var>collection</var> . <code subdfn data-x="dom-HTMLOptionsCollection-namedItem">namedItem</code>(<var>name</var>)</dt> | ||
| <dt><var>nodeList</var> = <var>collection</var> . <code data-x="dom-HTMLOptionsCollection-namedItem">namedItem</code>(<var>name</var>)</dt> | ||
| <dt><var>collection</var>[<var>name</var>]</dt> | ||
| <dt><var>collection</var>(<var>name</var>)</dt> | ||
| <dt><var>element</var> = <var>collection</var>[<var>name</var>]</dt> | ||
| <dd> | ||
| <p>Returns the item with <span data-x="concept-id">ID</span> or <code data-x="attr-option-name">name</code> <var>name</var> from the collection.</p> | ||
| <p>If there are multiple matching items, then the first is returned.</p> | ||
|
|
@@ -7381,6 +7387,11 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. | |
| <p>This method will throw a <code>HierarchyRequestError</code> exception if <var>element</var> is an ancestor of the element into which it is to be inserted.</p> | ||
| </dd> | ||
|
|
||
| <dt><var>collection</var> . <code subdfn data-x="dom-HTMLOptionsCollection-remove">remove</code>(<var>index</var>)</dt> | ||
| <dd> | ||
| <p>Removes the item with index <var>index</var> from the collection.</p> | ||
| </dd> | ||
|
|
||
| <dt><var>collection</var> . <code subdfn data-x="dom-HTMLOptionsCollection-selectedIndex">selectedIndex</code> [ = <var>value</var> ]</dt> | ||
|
|
||
| <dd> | ||
|
|
@@ -7423,11 +7434,6 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. | |
|
|
||
| <p>The properties exposed in this way must be <span>unenumerable</span>.</p> | ||
|
|
||
| <p>The <dfn data-x="dom-HTMLOptionsCollection-namedItem">legacy caller</dfn> of the | ||
| <code>HTMLOptionsCollection</code> interface must act like the <code | ||
| data-x="dom-HTMLCollection-namedItem">namedItem()</code> method on the ancestor | ||
| <code>HTMLCollection</code> interface.</p> | ||
|
|
||
| <p>When the user agent is to <dfn data-x="dom-HTMLOptionsCollection-setter">set the value of a new | ||
| indexed property or set the value of an existing indexed property</dfn> for a given property index | ||
| <var>index</var> to a new value <var>value</var>, it must run the following | ||
|
|
@@ -7532,7 +7538,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. | |
|
|
||
| <pre class="idl">interface <dfn>HTMLPropertiesCollection</dfn> : <span>HTMLCollection</span> { | ||
| // inherits <span data-x="dom-HTMLCollection-length">length</span> and <span data-x="dom-HTMLCollection-item">item</span>() | ||
| getter <span>PropertyNodeList</span>? <span data-x="dom-HTMLPropertiesCollection-namedItem">namedItem</span>(DOMString name); // shadows inherited namedItem() | ||
| getter <span>PropertyNodeList</span>? <span data-x="dom-HTMLPropertiesCollection-namedItem">namedItem</span>(DOMString name); // shadows inherited <span data-x="dom-HTMLCollection-namedItem">namedItem()</span> | ||
| [SameObject] readonly attribute DOMString[] <span data-x="dom-HTMLPropertiesCollection-names">names</span>; | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, these are a pretty big mess too. The comment says you inherit the "getter" but how does that even work. And item is shadowed by two overloads, but doesn't have a comment, even though namedItem does. So confusing.
I guess not any different than before though, so it doesn't need to be addressed in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems what Gecko does here is just have a distinct class for this collection. We could do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm same in Chrome. Edge inherits from HTMLCollection though. Interesting.