- From: Mark S. Miller <erights@google.com>
- Date: Fri, 18 Oct 2013 06:14:09 -0700
- To: Simon Pieters <simonp@opera.com>
- Cc: James Graham <james@hoppipolla.co.uk>, Domenic Denicola <domenic@domenicdenicola.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
- Message-ID: <CABHxS9hOcQPWc37zLwq6pZ7KipOeDcPM5Usp41jJDRgrhWpEug@mail.gmail.com>
Does anything need DOMRectReadOnly, or would DOMRect and AbstractRect
satisfy all current needs?
On Fri, Oct 18, 2013 at 1:37 AM, Simon Pieters <simonp@opera.com> wrote:
> On Fri, 18 Oct 2013 04:23:24 +0200, Mark S. Miller <erights@google.com>
> wrote:
>
> https://dvcs.w3.org/hg/csswg/****raw-file/748437d8a1dc/cssom-****<https://dvcs.w3.org/hg/csswg/**raw-file/748437d8a1dc/cssom-**>
>>> view/Overview.html#domrect<htt**ps://dvcs.w3.org/hg/csswg/raw-**
>>> file/748437d8a1dc/cssom-view/**Overview.html#domrect<https://dvcs.w3.org/hg/csswg/raw-file/748437d8a1dc/cssom-view/Overview.html#domrect>
>>> >
>>>
>>> or
>>>
>>> https://dvcs.w3.org/hg/csswg/****raw-file/3c529183812b/cssom-****<https://dvcs.w3.org/hg/csswg/**raw-file/3c529183812b/cssom-**>
>>> view/Overview.html#domrect<htt**ps://dvcs.w3.org/hg/csswg/raw-**
>>> file/3c529183812b/cssom-view/**Overview.html#domrect<https://dvcs.w3.org/hg/csswg/raw-file/3c529183812b/cssom-view/Overview.html#domrect>
>>> >
>>>
>>>
>>> A drawback here is that if one wants to check if an object is a "rect",
>>> you need to do two instanceof checks.
>>>
>>
>>
>> For the webidl at the first link, aren't you naming the common supertype
>> AbstractRect? That would be fine with me.
>>
>
> Not really, they are equivalent in the JS binding. Note
> [NoInterfaceObject] and implements.
>
>
> For both, it seems like DOMRectAny is also a common supertype, specified
>> as
>> a union type rather than by "implements".
>>
>
> No, a typedef isn't a supertype, it's just convenience for the spec
> itself. It's not reflected in the JS binding.
>
>
> I don't love the name but it is
>> non-objectionable. So only the second design needs two instanceof checks?
>> For the first, you can just "... instanceof AbstractRect"?
>>
>
> No, both need two instanceof checks. AbstractRect isn't visible to JS.
>
> We could use a real common interface, but I recall objections against
> having a bazillion interfaces and stuff for a single "thing".
>
>
> Aren't you also missing a subtype for an immutable DOMRect?
>>
>
> No, it's intentionally omitted because nothing needs it yet.
>
>
> --
> Simon Pieters
> Opera Software
>
--
Cheers,
--MarkM
Received on Friday, 18 October 2013 13:14:36 UTC