W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2011

Re: [WebIDL] troublesome names, property attributes and related issues

From: Simon Pieters <simonp@opera.com>
Date: Fri, 26 Aug 2011 13:00:36 +0200
To: "Allen Wirfs-Brock" <allen@wirfs-brock.com>, "Jonas Sicking" <jonas@sicking.cc>
Cc: public-script-coord@w3.org
Message-ID: <op.v0th7arwidj3kv@simon-pieterss-macbook.local>
On Fri, 26 Aug 2011 09:15:20 +0200, Jonas Sicking <jonas@sicking.cc> wrote:

> On Thu, Aug 25, 2011 at 10:21 PM, Allen Wirfs-Brock
> <allen@wirfs-brock.com> wrote:
>>
>> On Aug 25, 2011, at 9:40 PM, Jonas Sicking wrote:
>>
>>> On Thu, Aug 25, 2011 at 4:37 PM, Allen Wirfs-Brock
>>> <allen@wirfs-brock.com> wrote:
>>>> 4.5.4 Constants
>>>> This section says that constants must be defined as properties on  
>>>> both the
>>>> interface prototype object and the interface object.  Browsers don't
>>>> currently seem to do this.  Try document.ELEMENT_NODE and
>>>> Document.ELEMENT_NODE
>>>
>>> Both return 1 in Gecko. Haven't checked other browsers though.
>>
>>
>> Are you sure? I just tried evaluating both in FF6 using three different  
>> JS shells (web console, scratchpad, and squarefree).  In each case,  
>> document.NODE_ELEMENT returned 1 and Document.NODE_ELEMENT returned  
>> undefined.

It's ELEMENT_NODE, not NODE_ELEMENT. :-)


> Ah, ELEMENT_NODE doesn't live on the Document interface, it lives on
> the Node interface. So both the Node constructor and all instances of
> the Node interface (such as document) have the ELEMENT_NODE property.
>
> I'm not married to having instances contain constants though. If no
> other browsers do that, then it's likely not required for webcompat
> and could be dropped.

javascript:alert(document.ELEMENT_NODE)

alerts 1 in firefox, chrome and opera. I think it's likely required for  
web compat.

-- 
Simon Pieters
Opera Software
Received on Friday, 26 August 2011 11:01:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC