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

RE: Exposing constructors of readonly interfaces to web authors

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Tue, 1 Jul 2014 22:16:30 +0000
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: Rik Cabanier <cabanier@gmail.com>, Dirk Schulze <dschulze@adobe.com>, "Ian Hickson" <ian@hixie.ch>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <1404252990816.51557@domenicdenicola.com>
From: rocallahan@gmail.com <rocallahan@gmail.com> on behalf of Robert O'Callahan <robert@ocallahan.org>

> Currently Gecko has an implementation of DOMQuadBounds with no corresponding WebIDL interface. If I understand you correctly, you say that because DOMQuadBounds has its own implementation, it must have its own WebIDL interface in the  spec.

I just checked with Nightly, and indeed the prototype is shared:

Object.getPrototypeOf((new DOMQuad()).bounds) === Object.getPrototypeOf(Object.getPrototypeOf(new DOMRect()))

This is baffling. Even more baffling when you consider that

Object.getOwnPropertyDescriptor(Object.getPrototypeOf((new DOMQuad()).bounds), "x").get === Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new DOMRect())), "x").get

So if I understand correctly, you are saying that there are two different functions being run when I do (new DOMQuad()).bounds.x and when I do (new DOMRect()).x, but to JavaScript, since DOMQuadBounds has a different implementation than DOMRect. But it looks like they are the same function to JavaScript?

How is this possible? It definitely doesn't seem desirable.
Received on Tuesday, 1 July 2014 22:17:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC