W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: Web IDL Garden Hose (was: ECMA TC 39 / W3C HTML and WebApps WG coordination)

From: Maciej Stachowiak <mjs@apple.com>
Date: Sat, 26 Sep 2009 16:57:19 -0700
Cc: "Mark S. Miller" <erights@google.com>, Brendan Eich <brendan@mozilla.com>, "public-webapps@w3.org" <public-webapps@w3.org>, Doug Schepers <schepers@w3.org>, HTML WG <public-html@w3.org>, es-discuss <es-discuss@mozilla.org>
Message-id: <5E5A49A6-7417-4A16-8E58-7F02F456289F@apple.com>
To: Oliver Hunt <oliver@apple.com>

On Sep 26, 2009, at 4:41 PM, Oliver Hunt wrote:

> The specific problem is that host objects cannot necessarily match  
> the semantics of ES5, and for that reason the interaction of host  
> objects with the ES5 semantics is unclear.

I think mapping Web IDL behavior to ES5 property descriptors would  
help make this interaction more clear.

>  There are additional concerns -- various es5 features expose the  
> underlying implementation mechanisms of the binding -- for instance  
> using get or set properties on a dom binding would require  
> getOwnPropertyDescriptor to expose that implementation detail.

getOwnPropertyDescriptor risks leaking implementation details (or at  
least implementation differences) in any case. The options for Web IDL  
are:

1) Leave the results of getOwnPropertyDescriptor completely  
implementation-defined, so different implementations may return  
different values.
2) Require getOwnPropertyDescriptor to return specific results that  
expose host object properties as something other than getters or  
setters.
3) Require getOwnPropertyDescriptor to return specific results that  
expose host object properties as getters/setters.

I reluctantly conclude that #3 is best. #1 leaves behavior  
unspecified, this needlessly creates the potential for interop  
problems. #2 conflicts with the way some implementations implement  
their DOM bindings (e.g. Gecko), meaning extra work for them, and is  
outright unimplementable in pure ECMAScript. #3 conflicts with the way  
some implementations implement their DOM bindings (e.g. WebKit) and  
would mean extra work for them.

#3 seems like it has the weakest disadvantages, even though it means  
extra work for us.

However, if we want to allow implementation variance (i.e. policy #1),  
we could still use ES5 getters and setters as the formal model, but  
say that host objects implementations may override [[GetOwnProperty]]  
to give implementation-defined results for host attributes. This would  
change Web IDL from saying that host object implementations MUST  
override internal methods to saying they MAY.

Regard,
Maciej
Received on Saturday, 26 September 2009 23:58:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:33 GMT