Re: Figuring out easier readonly interfaces

On Wed, Oct 16, 2013 at 3:23 PM, Simon Pieters <simonp@opera.com> wrote:

> On Wed, 16 Oct 2013 22:13:28 +0200, Dirk Schulze <dschulze@adobe.com>
> wrote:
>
>
>> On Oct 14, 2013, at 10:01 PM, Robert O'Callahan <robert@ocallahan.org>
>> wrote:
>>
>>  How about "DOMRectRead"? Is that acceptable to everyone?
>>>
>>
>> If others accept this compromise it is fine with me.
>>
>
> My knee-jerk reaction is: it looks silly, and the argument about the
> semantics of "only" is also silly.
>
> Readonly doesn't mean immutable or constant.
>

No one said it did. That would be silly ;).

Read only means that, through this object, changes to some underlying state
can be observed but not caused. In order for changes to be observed, it
must be possible to cause those changes, but holding this object is not by
itself adequate to cause those changes.


>
> For example, <input readonly> means that the user can only read the value,
> but the value can still be mutated by script or by the UA.
>

Exactly. The "object" in question is the user interface element, and the
"client" whose access restriction is being described it the user. By virtue
of having user-interface access to this input element, the user can observe
changes (that are caused by other means), but this access by itself does
not enable the user to cause these changes.


>
> Node#firstChild is a readonly attribute (WebIDL term), which means that a
> script can't change it by setting Node#firstChild, but the value can change
> by e.g. invoking Node#insertBefore() or by the UA changing the DOM (e.g.
> parsing).
>

Exactly.  Giving you node.firstChild.bind(node) gives you the ability to
sense changes to the node's first child but not the ability to cause these
changes.


>
> SVGRect has a "read only" flag, which means that setting its attributes
> throws, but the values can still be changed. SVGAnimatedRect#animVal
> changes over time while the animation is running, but the SVGRect is "read
> only".


Exactly.



>
>
> --
> Simon Pieters
> Opera Software
>



-- 
    Cheers,
    --MarkM

Received on Wednesday, 16 October 2013 23:22:05 UTC