Re: Exposing constructors of readonly interfaces to web authors

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