- From: Dirk Schulze <dschulze@adobe.com>
- Date: Tue, 24 Sep 2013 22:02:09 -0700
- To: Simon Pieters <simonp@opera.com>
- CC: "Robert O'Callahan" <robert@ocallahan.org>, "Tab Atkins Jr." <jackalmage@gmail.com>, Simon Fraser <smfr@me.com>, www-style list <www-style@w3.org>
On Sep 24, 2013, at 11:41 PM, Simon Pieters <simonp@opera.com> wrote: > On Tue, 24 Sep 2013 23:36:37 +0200, Robert O'Callahan > <robert@ocallahan.org> wrote: > >> On Wed, Sep 25, 2013 at 3:06 AM, Simon Pieters <simonp@opera.com> wrote: >> >>> If we want the members of DOMRect to be mutable but only if it's not >>> associated with a DOMQuad's .bounds, that can be specced by having those >>> members check for the association and throw on setting in that case. >>> >> >> We can do that. That's how SVG animated value objects work. I'm not a >> great >> fan of it, since it means DOMRect's attributes can all throw, which is >> confusing in the situations where you have a mutable DOMRect. But it's >> OK I >> guess. >> >> If we're making DOMRect mutable we have to decide what happens when its >> members are modified, since there are options. For example, when "width" >> is >> modified one of "left" and "right" must also change, and we have to >> specify >> which one, or else specify that "width" is actually readonly. >> >> I think the simplest thing to specify is that "right" and "bottom" are >> readonly and the other attributes are mutable and mutating them affects >> "right"/"bottom". > > The simplest thing is to keep all readonly. :-) > > If we're making things mutable for convenience, I think it's reasonable to > allow width/height to be set too, and just have them update bottom and > right. Are we discussing if the attributes(whole object) is immutable in certain situations or in general? I would not agree that DOMRect should always be immutable or that bottom/right should always be immutable. That should only be the case for live DOMRect objects where modifying these two attributes is not possible. And in these situations it is enough to have a prose saying that the returned object is immutable (or certain attributes). Since getClientBoundingRect() does not return a live object, everything on the returned DOMRect should be mutable IMO. Greetings, Dirk > > >>> Is it sane to allow modification of a DOMRect that was returned by e.g. >>> getBoundingClientRect()? >> >> >> Yes. > > Yeah, agree. > > -- > Simon Pieters > Opera Software
Received on Wednesday, 25 September 2013 05:02:53 UTC