Skip to content

Commit

Permalink
Comment out query/queryAll/Elements for now
Browse files Browse the repository at this point in the history
The multiple notes pointing out the issues that needed to be resolved
before they can be implemented were not sufficient to avoid confusing
folks.
  • Loading branch information
annevk committed Mar 29, 2016
1 parent ce331fd commit 10b6cf1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 89 deletions.
23 changes: 12 additions & 11 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2090,15 +2090,17 @@ interface ParentNode {
[Unscopeable] void prepend((Node or DOMString)... nodes);
[Unscopeable] void append((Node or DOMString)... nodes);

[Unscopeable] Element? query(DOMString relativeSelectors);
[NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
Element? querySelector(DOMString selectors);
[NewObject] NodeList querySelectorAll(DOMString selectors);
};
Document implements ParentNode;
DocumentFragment implements ParentNode;
Element implements ParentNode;
</pre>
<!--
[Unscopeable] Element? query(DOMString relativeSelectors);
[NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
-->

<dl class=domintro>
<dt><code><var>collection</var> = <var>node</var> . {{ParentNode/children}}</code>
Expand Down Expand Up @@ -2136,7 +2138,7 @@ Element implements ParentNode;
<a>node tree</a> are violated.
<!-- "NotFoundError" is impossible -->

<dt><code><var>node</var> . <a method for=ParentNode lt="query()">query</a>(<var>relativeSelectors</var>)</code>
<!--<dt><code><var>node</var> . <a method for=ParentNode lt="query()">query</a>(<var>relativeSelectors</var>)</code>
<dd>
Returns the first <a for="/">element</a> that is a
<a>descendant</a> of <var>node</var> that
Expand All @@ -2146,7 +2148,7 @@ Element implements ParentNode;
<dd>
Returns all <a for="/">element</a>
<a>descendants</a> of <var>node</var> that
match <var>relativeSelectors</var>.
match <var>relativeSelectors</var>.-->

<dt><code><var>node</var> . <a method for=ParentNode lt="querySelector()">querySelector</a>(<var>selectors</var>)</code>
<dd>
Expand Down Expand Up @@ -2204,15 +2206,15 @@ method must run these steps:
<var>node</var> to the <a>context object</a>.
</ol>

The <dfn method for=ParentNode><code>query(<var>relativeSelectors</var>)</code></dfn>
<!--The <dfn method for=ParentNode><code>query(<var>relativeSelectors</var>)</code></dfn>
method, when invoked, must return the first result of running
<a>match a relative selectors string</a> <var>relativeSelectors</var> against
a set consisting of <a>context object</a>, and null if the result is an empty list.

The <dfn method for=ParentNode><code>queryAll(<var>relativeSelectors</var>)</code></dfn>
method, when invoked, must return an {{Elements}} array initialized with the result of
running <a>match a relative selectors string</a> <var>relativeSelectors</var> against
a set consisting of <a>context object</a>.
a set consisting of <a>context object</a>.-->

The <dfn method for=ParentNode><code>querySelector(<var>selectors</var>)</code></dfn>
method, when invoked, must return the first result of running
Expand Down Expand Up @@ -2407,7 +2409,7 @@ Text implements Slotable;
the result of <a>find a slot</a> given <a>context object</a> and with the <i>open flag</i> set.</p>


<h4 id=element-collections>Collections: {{Elements}}</h4>
<!--<h4 id=element-collections>Collections: {{Elements}}</h4>

<pre class='idl' data-no-idl>
class <dfn interface>Elements</dfn> extends Array {
Expand Down Expand Up @@ -2448,7 +2450,7 @@ The <dfn method for=Elements><code>queryAll(<var>relativeSelectors</var>)</code>
method, when invoked, must return the result of running
<code class='lang-javascript'>this.constructor</code> with the result of running
<a>match a relative selectors string</a> <var>relativeSelectors</var> against the
<a>context object</a>.
<a>context object</a>.-->


<h4 id=old-style-collections>Old-style collections: {{NodeList}} and {{HTMLCollection}}</h4>
Expand Down Expand Up @@ -2536,9 +2538,8 @@ interface HTMLCollection {

<p>An {{HTMLCollection}} object is a <a>collection</a> of <a for="/">elements</a>.

<p class="note no-backref">{{Elements}} is the better solution for representing a
<a>collection</a> of <a for="/">elements</a>. {{HTMLCollection}} is an historical artifact we
cannot rid the web of.
<p class="note no-backref">{{HTMLCollection}} is an historical artifact we cannot rid the web of.
Please do not use it in new APIs.

<dl class=domintro>
<dt><var>collection</var> . {{HTMLCollection/length}}
Expand Down
Loading

7 comments on commit 10b6cf1

@ArkadiuszMichalski
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@annevk is there any place to read discuss about this or watch future and progress of this new collection?

@annevk
Copy link
Member Author

@annevk annevk commented on 10b6cf1 Mar 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArkadiuszMichalski there's been some discussion on the www-dom mailing list and maybe public-webapps in the past. Not a whole lot though. But the whole thing depends on proper subclassing support in IDL.

@ArkadiuszMichalski
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@annevk This is related bug for that functionality https://www.w3.org/Bugs/Public/show_bug.cgi?id=20020 ?

@annevk
Copy link
Member Author

@annevk annevk commented on 10b6cf1 Mar 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@WebReflection
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From developers point of view, nobody I could talk with was confused and everyone was waiting for this native. My dpm4 poly also has offered this for years now and never had issues filed. Which "folk" was confused and why are you ruling out developer friendly APIs due IDL problems?

@WebReflection
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dom4

@annevk
Copy link
Member Author

@annevk annevk commented on 10b6cf1 May 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WebReflection several implementers as well as developers. I'm not ruling out this API, I'm simply waiting for it to become feasible. Browsers don't have sufficient subclassing support yet. And it's even less likely to see a native implementation soonish if there's no IDL support.

Please sign in to comment.