Re: Array-with-item in WebIDL

On 6/16/15, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/16/15 10:46 PM, Garrett Smith wrote:
>>   HTMLFormElement objects,
>
> Where, exactly?
>
Did you try any web browsers? Try looking on MDN and W3C docs,

 ...

https://developer.mozilla.org/en-US/docs/Web/API/Node/contains

The node `contains` method has been around since IE5, probably
earlier, and is supported pretty much everywhere, since about 10 years
ago. Buggy in older versions of Safari.

>>   HTMLSelectElement
>
> Again, where?
>
Again, try testing it first…  Console…

 document.createElement("select").contains

or Node.prototype.contains.

Handy for event target hit testing:—

if(element.contains(ev.target)) {
  alert("winner!");
}

> The only other "contains()" I see in the Gecko IDL is the one on Node,
> but Node is not an arraylike thing.
>

SELECT and FORM elements have a contains method. And they are
arraylike in that they have a length and indexed properties. The
SELECT has a special [[Put]], to create OPTION elements.

>> Any HTMLCollection that has a descendent OBJECT whose id is "contains"
>> (nonstandard Firefox extension).
>
> It's totally standard.  See
> https://html.spec.whatwg.org/multipage/embedded-content.html#dom-object-caller
>
> and the corresponding IDL, plus the definition of HTMLCollection.
>
I don't understand that documentation.
-- 
Garrett
@xkit
ChordCycles.wordpress.com
garretts.github.io
personx.tumblr.com

Received on Wednesday, 17 June 2015 06:12:21 UTC