Re: Bugs in CSS parsing

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?

Jo

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