W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > July 2008

Re: Bugs in CSS parsing

From: Jo Rabin <jrabin@mtld.mobi>
Date: Thu, 10 Jul 2008 16:29:55 +0100
Message-ID: <48762AF3.9060602@mtld.mobi>
To: Francois Daoust <fd@w3.org>
CC: public-mobileok-checker <public-mobileok-checker@w3.org>

Interesting point. Apparently everything that CSS defines is case 
insensitive: property names values and units in particular. But I 
suppose selectors, font-names, URIs, classes, ids and so on are not. I 
don't think that the latter affects mobileOK processing, though, since 
we make no attempt to match any of these to the document that the CSS is 
applied to - though perhaps we ought to have done in the case of CSS in 
<style> elements. I think we did discuss it and dropped it as an idea, 
another version, maybe.

Space sensitivity is another matter though. In some cases spaces are 
required, in some cases they are optional and in other cases they are 
prohibited ... so is the treatment of space in the way we do a defect in 
the CSS parser, or is it an artefact of using regex to extract some 
parts of the CSS Style?


On 10/07/2008 15:08, Francois Daoust wrote:
> Hi guys,
> Is the lack of support for spaces and case-insensitivity in CSS done on 
> purpose?
>     font-size: 12pt
> should be equivalent to:
>     fONt-Size    :   12PT
> The code in MeasuresTest.java doesn't trap this kind of thing, and I 
> suspect neither does the rest of the code (CSSUtils.java and 
> StyleSheetsSupport.java). Is that intended?
> If done on purpose, there still remains a bug in the parsing done in 
> MeasuresTest to check only the CSS1 properties: spaces are taken into 
> account. For instance:
>   p {  font-size: 12pt; }
> ... the extracted property is " font-size", which fails to match 
> "font-size".
> Francois.
Received on Thursday, 10 July 2008 15:30:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:20 UTC