Re: algorithmic normative conformance requirements, design principles, etc.

On Wed, May 27, 2009 at 6:28 PM, Larry Masinter <masinter@adobe.com> wrote:
> But in fact there is no way to determine if image.width
> and image.height are simultaneously available, because
> 'available' is dynamic. Any program of the form
>
>
>  if (image.width != 0) { ... something using image.height ...
>                          which assumes image.height is non-zero ...}
>
> will not always function properly, if the image becomes
> unavailable between the time image.width is computed
> and when image.height is accessed, because images can
> become "unavailable", because of network congestion,
> server timeout, delay, etc.

If you define that changes to the availability happens on events fired
at the same event loop as what runs the rest of the execution, then
the above program will always work. This is in practice how all
implementations that I know if work already since otherwise you'd need
to have a multi-threaded DOM, something that I haven't heard of anyone
implementing.

But I agree that the spec ideally needs to spell this requirement out.

> My original point was that this was an instance of
> using algorithmic specification rather than using
> language constraint specification. I think there are
> numerous examples of that

As stated before, I suspect that there are things in the current spec
that would be better written using a semantic description than a
algorithmic one. And I also hope and think that Ian would replace
current text with a semantic description if one was submitted to this
list. As long as that description is as exhaustive in the details it
defines and is arguably better (for example by being semantic where
that is appropriate).

So a semantic description of the width/height descriptions discussed
in this thread would still need to be defined to be non-zero if and
only if they both are, such that the code in your example above is
specified to work.

/ Jonas

Received on Thursday, 28 May 2009 07:58:12 UTC