Re: [cssom-view] Ability to replace points of a DOMQuad

On Thu, Sep 26, 2013 at 6:46 AM, Simon Pieters <simonp@opera.com> wrote:
> The interface for DOMQuad currently in CSSOM View is:
>
> [Constructor(DOMPointLiteral p1, DOMPointLiteral p2, DOMPointLiteral p3,
> DOMPointLiteral p4),
>  Constructor(DOMRectAny rect)]
> interface DOMQuad {
>   [SameObject] readonly attribute DOMPoint p1;
>   [SameObject] readonly attribute DOMPoint p2;
>   [SameObject] readonly attribute DOMPoint p3;
>   [SameObject] readonly attribute DOMPoint p4;
>   [SameObject] readonly attribute DOMRectImmutable bounds;
> };
>
> http://dev.w3.org/csswg/cssom-view/#the-domquad-interface
>
> The points can be modified by setting their attributes, e.g.:
>
> quad.p1.x = 10;
> quad.p1.y = 20;
>
> Do we want to allow the following?
>
> quad.p1 = {x:10, y:20};
> quad.p1 = new DOMPoint(10, 20);
>
> If so, what should they do?
>
> (a) The old DOMPoint object is mutated with the values of the new object.
> (b) A new DOMPoint object is created with the values of the new object and
> replaces the old DOMPoint object.
> (c) The new object replaces the old object, except if it is a
> DOMPointLiteral which acts like (b).
> (d) ???

I vote yes, and (a).

~TJ

Received on Thursday, 26 September 2013 17:57:38 UTC