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

Re: Exposing constructors of readonly interfaces to web authors

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 30 Jun 2014 11:11:41 -0400
Message-ID: <53B17E2D.60900@mit.edu>
To: public-script-coord@w3.org
On 6/29/14, 10:55 PM, Robert O'Callahan wrote:
> Are you saying we cannot have a WebIDL interface (DOMRectReadOnly)
> representing a "common base class" for DOMQuad.bounds rectangles and
> mutable DOMRects, because there are separate implementations with
> different internal state?

You can, but it takes some gyrations: effectively defining some sort of 
virtual hooks on the parent class and implementing them in the subclasses.

The main benefit would be that scripts would have a one-stop place to 
hook getters on all rectangles by doing that on 
DOMRectReadOnly.prototype, but it's not terribly clear to me how useful 
that is.

-Boris
Received on Monday, 30 June 2014 15:12:10 UTC

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