W3C home > Mailing lists > Public > www-svg@w3.org > May 2011

Case sensitive units on CSS/SVG properties

From: Dirk Schulze <vbs85@gmx.de>
Date: Tue, 10 May 2011 10:46:55 +0200
Message-Id: <196B3E5A-C8DA-468B-AAB8-5A1069787951@gmx.de>
To: www-svg List <www-svg@w3.org>

I just realized the new test case types-basic-02-f [1]. The first circle in the second line has a partly red stroke for Firefox and WebKit.

<g xmlns="http://www.w3.org/2000/svg" stroke-width="20">
        <circle r="40" id="swUpperCaseUnitPresAttr" stroke-width="10PX" fill="none" stroke="lime" transform="translate(100 240)"/>

Both, WebKit and Firefox interpret the value for stroke-with as 10px while Opera takes it as invalid data. While Opera is following the spec here [2] it makes more sense IMHO to be more tolerant, since stroke-width is a SVG attribute as well as a CSS property. The following example works for all browsers:

<g xmlns="http://www.w3.org/2000/svg" stroke-width="20">
        <circle r="40" id="swUpperCaseUnitPresAttr" style="stroke-width: 10PX;" fill="none" stroke="lime" transform="translate(100 240)"/>

This is because in the second example the CSS parser allows upper cases for units. Is it possible to use the same parsing rules for the SVG parser and CSS parser on SVG attributes that can be set by CSS? Of course for SVG it would still be necessary to extend the CSS rules for SVG specific units and values.


[1] http://dev.w3.org/SVG/profiles/1.1F2/test/svg/types-basic-02-f.svg
[2] http://www.w3.org/TR/SVG/types.html#DataTypeLength
Received on Tuesday, 10 May 2011 08:54:04 UTC

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