W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2015

Re: [geometry] Dictionary argument for DOMQuad constructor

From: Robert O'Callahan <robert@ocallahan.org>
Date: Fri, 27 Mar 2015 08:50:08 +1300
Message-ID: <CAOp6jLZX-YWWF2csHLtk=ffaV8X0PDsLz5G-PPzoxfVkzBtL+w@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: "public-fx@w3.org" <public-fx@w3.org>, Domenic Denicola <d@domenic.me>, Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Thu, Mar 26, 2015 at 11:50 PM, Simon Pieters <simonp@opera.com> wrote:

> On Wed, 25 Mar 2015 13:55:04 +0100, Domenic Denicola <d@domenic.me> wrote:
>
>  I think a better solution might be a single constructor (no overloads)
>> plus static factory methods. So something like
>>
>>     [Constructor(optional DOMPointInit p1, ...)]
>>     interface DOMQuad {
>>         ...
>>         static fromRect(optional DOMRectInit);
>>         static fromQuad(optional DOMQuadInit);
>>     }
>>
>
> Thanks. This seems like a better API design and avoids the issues.
> Particularly when dictionaries are involved.
>
> Is Mozilla OK with changing to something like this? Not just for DOMQuad
> but for the rest as well.


Right now we have implemented the DOMPointInit constructor and
Constructor(DOMRectReadOnly rect). Is there any reason not to keep the
latter?

Rob
-- 
oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
owohooo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oioso
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
owohooo
osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro
ooofo
otohoeo ofoioroeo ooofo ohoeololo.
Received on Thursday, 26 March 2015 19:50:39 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 26 March 2015 19:50:41 UTC