W3C home > Mailing lists > Public > public-html@w3.org > October 2009

Re: typeof document.all

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 13 Oct 2009 00:09:39 -0700
Cc: HTML WG <public-html@w3.org>
Message-id: <B59C227A-78E8-441F-AF2E-9E4D37E7F645@apple.com>
To: Boris Zbarsky <bzbarsky@mit.edu>

On Oct 12, 2009, at 6:40 PM, Boris Zbarsky wrote:

>> On the other hand, there are many potential performance tradeoffs  
>> to how
>> exactly DOM attributes get implemented. This concern would be  
>> lessened
>> if we could show that it's possible to use a variety of  
>> implementation
>> strategies while getting consistent output from hasOwnProperty() and
>> getOwnPropertyDescriptor().
>
> I should note that I've recently considered making .style end up as  
> a property on nodes directly, instead of being a property on the  
> prototype in Gecko, for performance reasons.  This is almost  
> certainly script-detectable, though, if scripts define getters and  
> setters for .style on nodes directly...

FWIW: In WebKit, (nearly) all DOM methods are on the prototype, and  
(nearly) all DOM attributes are own properties. I don't believe we've  
had a problem with this setup. I do believe people would complain if  
we made methods be own properties though, since we definitely have  
demand for ability to hack the prototype.

More specifically, we don't implement DOM attributes as JS-level  
getters and setters internally, there is a special-purpose mechanism  
for programatically implemented properties, but we are considering  
exposing them that way to getOwnPropertyDescriptor (in which case we'd  
probably make the getter and setter function objects on demand or  
something).

Regards,
Maciej
Received on Tuesday, 13 October 2009 07:10:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:50 GMT