RE: Bugs in CSS parsing

Hi,
 
This is a collateral behaviour of using regular expresions for
extracting CSS properties. 

By default java regular expressions are case sensitive and if you want
to match them against a text ignoring case you must explicity state it
with a flag. We'll check the code and add this flag on all regular
expresion matchings

We'll also add to the regular expresions the condition of "any number of
white spaces" (\s*) to all suitable cases

Miguel

>>-----Mensaje original-----
>>De: public-mobileok-checker-request@w3.org [mailto:public-mobileok-
>>checker-request@w3.org] En nombre de Jo Rabin
>>Enviado el: jueves, 10 de julio de 2008 17:30
>>Para: Francois Daoust
>>CC: public-mobileok-checker
>>Asunto: 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 16:08:42 UTC