W3C home > Mailing lists > Public > www-svg@w3.org > March 2014

Re: The discrepancy between SVG 'number' and CSS 'number'

From: Paul LeBeau <paul.lebeau@gmail.com>
Date: Fri, 21 Mar 2014 05:44:19 +1300
Message-ID: <CACfsppB+prioHooJbPmLrFxdSV5O75U6ZLdxF2xYkQO0P8Xd_g@mail.gmail.com>
To: Dirk Schulze <dschulze@adobe.com>
Cc: www-svg <www-svg@w3.org>
Ah.  Thanks Dirk

I went back and looked again and finally found that change in the 2.1
errata.

Paul



On 21 March 2014 03:31, Dirk Schulze <dschulze@adobe.com> wrote:

>
> On Mar 20, 2014, at 3:19 PM, Paul LeBeau <paul.lebeau@gmail.com> wrote:
>
> > Hi
> >
> > Has there been any prior discussion between this WG and the CSS WG about
> resolving the discrepancy between the definitions of the SVG and CSS number
> type?  The difference is that SVG number allows exponents and CSS doesn't
>
> That is no longer true. CSS Syntax allows exponents and Firefox
> implemented it already. IE had it in quirks mode for a very very long time.
> Not sure if it is also supported in strict mode.
>
> >
>
> > This becomes an issue with style properties.
> >
> > As an experiment, I tried the following test file on several renderers.
> >
> > <svg width="400" height="400"  xmlns="http://www.w3.org/2000/svg">
> >
> > <style>
> > #one {
> >   opacity: .5;
> > }
> >
> > #two {
> >   opacity: 5E-1;
> > }
> > </style>
> >
> >   <rect x="0" id="one" width="100" height="100" fill="red" opacity=".5"/>
> >   <rect x="101" id="two" width="100" height="100" fill="red"
> opacity="5E-1"/>
> >
> >   <rect x="0" y="101" id="one" width="100" height="100" fill="red"/>
> >   <rect x="101" y="101" id="two" width="100" height="100" fill="red"/>
> >
> >   <rect x="0" y="202" width="100" height="100" fill="red"
> style="opacity: .5" />
> >   <rect x="101" y="202" width="100" height="100" fill="red"
> style="opacity: 5E-1" />
> >
> > </svg>
> >
> >
> > (The "0.5" test is in there because I was testing that for another
> reason.)
> >
> > Anyway, I got varying results.
> >
> >                                               Chrome33    FF28     IE11
>    Safari5.1   Batik1.7
> > opacity=".5"             YES     YES   YES   YES     YES
> > opacity="5E-1"           YES     YES   YES   NO(!)   NO
> > CSS "opacity: .5"        YES     YES   YES   YES     NO(!)
> > CSS "opacity: 5E-1"      NO      NO    YES   NO      ERROR
> > style "opacity: .5"      YES     YES   YES   YES     YES
> > style "opacity: 5E-1"    NO      NO    YES   NO      ERROR
> >
> >
> > If in the future more attributes are to become properties, this
> discrepancy will need to be resolved, won't it?
>
> Presentation attributes had to follow the SVG syntax while CSS definitions
> were following other conventions. That should be fixed in browsers
> eventually and exponents are allowed everywhere.
>
> Greetings,
> Dirk
>
> >
> > Paul
> >
> >
> >
> >
>
>
Received on Thursday, 20 March 2014 16:45:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:51 UTC