Re: [matrix][cssom-view] DOMRect vs mutability and more

Simon Pieters skriver:
> On Tue, 24 Sep 2013 23:41:46 +0200, Simon Pieters <simonp@opera.com> wrote:
> 
> <snip>
> 
> Done.
> 
> https://dvcs.w3.org/hg/csswg/rev/1787351b91d0
> 
> The details here might change based on what comes out of
> http://lists.w3.org/Archives/Public/www-style/2013Sep/0616.html
> 
> 
> On Wed, 25 Sep 2013 00:14:37 +0200, Henrik Andersson
> <henke@henke37.cjb.net> wrote:
> 
>> If left and right are mutable then the width must change if either is
>> changed.
>>
>> I say that if left change then right remains the same and the same
>> flipped. It is the width that changes.
> 
> That's what I've specced.
> 
>> If you want to set the left position without editing the width (the
>> right position changes instead) then use a property called x.
> 
> On Wed, 25 Sep 2013 01:35:08 +0200, Robert O'Callahan
> <robert@ocallahan.org> wrote:
> 
>> I don't think we should have "left" and "x" properties that behave
>> differently! That is very confusing!
> 
> On Mon, 23 Sep 2013 20:34:04 +0200, Dirk Schulze <dschulze@adobe.com>
> wrote:
> 
>>> I think it should be easy for authors to move a DOMRect by assigning
>>> to its origin, for example.
>>
>> You mean setting the origin? Yes, it probably should be. (As long CSOM
>> allows them to be mutable.)
> 
> What's the use case for moving a DOMRect?
> 
> Currently if you want to move a DOMRect you have to set both left/right
> or left/width, and similarly in the other axis.
> 

Good that someone figured out the intent behind my suggestion. x+width
for the viewpoint of a movable rectangle and left+right for edge
positioning.


Since we are on the topic of DOMRect, I'd like to request some utility
methods.

First, a way to check if two DOMRects intersect and if so, a way to find
the resulting intersection area.

Second, a way to check if one DOMRect is fully contained inside another
DOMRect.

Third and finally, a way to check if a DOMPoint/DOMPointLiteral is
contained in the DOMRect.

These are very handy methods to have in a rectangle abstraction and are
easy to implement. Lets not force content authors to implement this.
Better have it right in the interface.

Received on Wednesday, 25 September 2013 13:11:28 UTC