W3C home > Mailing lists > Public > www-svg@w3.org > July 2006

Re: SVG12: conversion to float vs NaN

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Wed, 26 Jul 2006 19:53:15 +0200
To: nandini <Nandini.Ramani@Sun.COM>
Cc: www-svg@w3.org
Message-ID: <ag7fc2lp16f7tp0n9gol215570ek1g08d1@hive.bjoern.hoehrmann.de>

* nandini wrote:
>For a property, when you getTrait, it already has the computed value,

That is incorrect.

>This was discussed within the working group and several implementors 
>agreed that there are cases where getFloatTrait method will raise an 
>exception for non-float values and hence we do not see the need to 
>change the specification. I hope this clarifies your questions.

I, too, agree there are such cases, as the latest draft specifically
mentions two of these cases. It does not, however, provide guidance on
how getFloatTrait and friends behave for other cases, for example:

  * <rect height="100%"
  * <rect height="1.00000"
  * <rect height="1.00001"
  * <rect height="1E999999999999"
  * <rect height="Hello World"
  * attributes not in SVG Tiny 1.2
  * attributes for which trait access
    is not required in SVG Tiny 1.2

The latest draft requires "Implementations that support multiple
versions of svg must allow trait access to the most extensive set and
support the types supported by each trait in the most extensive set",
so the draft needs to define what it means for a trait that it "cannot
be converted to a float".

I note that you

  * first told me it's completely unreasonable to assume NaN might
    ever be returned for it's not a proper value when performing

  * then told me what happens if NaN is returned

  * then told me again what happens if NaN is returned

  * and now you are just telling me there are cases where an ex-
    ception is raised

Only the first answer actually relates to my concern, and that
answer turned out to be incorrect. It therefore remains unclear to
me how to write tests that can reasonably considered to ensure that
the required exception is thrown if and only if that is required by
the specification. The draft I originally commented on in fact did
not even mention the <svg width="10%" height="10%" case it covers
now. My concern would easily be addressed by adding something like

  * getFloatTrait and friends must not return values that are not
    equivalent to a real number, specifically NaN and Infinities
    must not be returned.

Though that of course would leave open the question what should be
done instead. As I do not know what should be done, I cannot pro-
pose any text for that.
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Wednesday, 26 July 2006 17:53:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:09 UTC