Re: [cssom-view] DOMRect with aliases x, y to left, top?

On Thu, 26 Sep 2013 23:34:25 +0200, Dirk Schulze <dschulze@adobe.com>  
wrote:

>
> On Sep 26, 2013, at 11:24 PM, Henrik Andersson <henke@henke37.cjb.net>  
> wrote:
>
>> Dirk Schulze skriver:
>>> Hi,
>>>
>>> Would it be possible to add alias attributes 'x' and 'y' that point to  
>>> 'left' and 'top'? That would make it more compatible with SVGRect and  
>>> the SVG WG could start replacing SVGRect[1] with DOMRect as well for a  
>>> unified platform.
>>>
>>> Greetings,
>>> Dirk
>>>
>>> [1] https://developer.mozilla.org/en-US/docs/Web/API/SVGRect
>>>
>>>
>>
>> I brought it up less than a week ago. The thing is, the x and y
>> properties would work differently than the left and top properties. At
>> least when setting them. The rectangle has an invariant to enforce.
>
> I am asking for aliasing top, left, not have additional attributes.
>
> Anyway, how is your problem different from having left,right to width  
> and top, bottom to height? Setting one of them must change one of the  
> other attributes as well.

So for SVGRect, does setting x change width? AFAICT from the SVG spec it  
doesn't. Setting the left attribute changes the width. So if we want  
DOMRect.x to be compatible with SVGRect.x (and ActionScript's  
Rectangle.x), we need to do what Henrik suggests i.e. not change the width.

-- 
Simon Pieters
Opera Software

Received on Thursday, 26 September 2013 21:50:42 UTC