W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2010

[whatwg] getElementById

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Mon, 10 May 2010 20:54:14 -0700
Message-ID: <AANLkTikFunHjQksT3nBmi7Ob_BR5F5-vtdaQyf-1deb_@mail.gmail.com>
On Mon, May 10, 2010 at 8:28 PM, Perry Smith <pedzsan at gmail.com> wrote:
>
> On May 10, 2010, at 7:04 PM, Garrett Smith wrote:
>
>> On Mon, May 10, 2010 at 4:55 PM, Perry Smith <pedzsan at gmail.com> wrote:
>>>
>>> On May 10, 2010, at 5:12 PM, Garrett Smith wrote:
>>>
>>>> On Mon, May 10, 2010 at 2:27 PM, Perry Smith <pedzsan at gmail.com> wrote:
>>>>>
>>>>> On May 10, 2010, at 3:06 PM, timeless wrote:
>>>>>
>>>>>> On Mon, May 10, 2010 at 9:10 PM, Perry Smith <pedzsan at gmail.com> wrote:
>>>>>>> I see places that explicitly state that the same object is returned on some operations. ?For example, the element.style has that clause.

[...]

>> The browser can do whatever it wants with that property. Take a look
>> at MSIE document.expando.
>
> Wow. ?I happened to pull down the ECMAScript 5 doc this past weekend to understand exactly how an event handler is called. ?html5 refers to functions defined in the ECMAScript doc. ?But I've never heard of "host objects". ?The first hit in the EMCAScript 5 doc for host object tells all. ?These guys did not learn from the mistakes of Pascal. ?An utterly hopeless feeling came over me.
>

I see you've put our discussion back on list. I'm OK with that.

HTML 5 refers to ECMAScript for defining Function.

However ECMAScript does not specify anything about event handlers,
document, or any other host objects.  An addition to the 5th edition,
and a very good one, is the requirement for host objects to implement
many of the semantics defined in the specification (see table 8).

The ECMAScript committee has some incredibly smart and hard working
individuals for whom I have a good deal of respect.

One thing not specified yet in ECMAScript is catchalls, and that is
necessary to implement some existing browser behavior that is
partially specified by HTML 5. Catchalls is an active proposal.

To learn more about Ecmascript, the es-discuss mailing list and
comp.lang.javascript may be of interest.

The pertinent section of the FAQ:
http://www.jibbering.com/faq/#objects

> So, how about this?
>
> As part of HTMLElement, have a defined bucket, maybe call it elementObject which is defined to be a native ECMAScript object. ?If X denotes a particular DOM element, then X.elementObject is defined to return the same native ECMAScript object each time. ?More details could be added perhaps to define how the object is created (i.e. which prototype to use, etc). ?I'm thinking making it the same as {}.
>

WebIDL could require DOM objects to be implemented as native ECMAScript objects.
Received on Monday, 10 May 2010 20:54:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:23 UTC