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

RE: Bugs in CSS parsing

From: Miguel Garcia <miguel.garcia@fundacionctic.org>
Date: Thu, 10 Jul 2008 18:08:08 +0200
Message-ID: <09700B613C4DD84FA9F2FEA52188281903CEC932@ayalga.fundacionctic.org>
To: "Jo Rabin" <jrabin@mtld.mobi>, "Francois Daoust" <fd@w3.org>
Cc: "public-mobileok-checker" <public-mobileok-checker@w3.org>

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


>>-----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
>>applied to - though perhaps we ought to have done in the case of CSS
>><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
>>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
>>> 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
>>> 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

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