RE: css with regex

> How does this sound to you?

If I had enough hair to raise, it would sound hair raising!

 

I think that it might work, but also think it raises the specter of
pretty printing the CSS just to report the line numbers, rather as we
have discussed the same with reference to XHTML error reporting ...

 

Jo 

 

________________________________

From: Laura Holmes [mailto:holmes@google.com] 
Sent: 17 August 2007 17:49
To: Jo Rabin
Cc: public-mobileok-checker
Subject: Re: css with regex

 

Hi Jo, 
Welcome back. In regards to your concerns about the @media rule, Sean
came up with a solution that might solve both the validation and the
test problems. We can do some preprocessing on the content of the css
files and the embedded style sheets. The processor will search for
irrelevant @media style sections and strike them out. Then we're only
dealing with the style relevant to mobile and then we can continue
testing as before. In order to preserve line numbers, in the place of
removed content, we'll insert the appropriate number of line breaks. 

How does this sound to you?

Cheers, 
Laura

On 8/17/07, Jo Rabin <jrabin@mtld.mobi> wrote: 

Hi Laura

 

Back from vacation unfortunately - but now I have some proper time to do
some checker work.

 

I am concerned about the regex approach. One issue is that it doesn't
handle @media, so for example I could say

@media screen {body {background-image: url(reallyhuge.gif)}}

@media handheld {{body {background-image: url(reallytiny.gif)}}

 

In this case, obviously, the relevant image is reallytiny.gif.

 

Also, it is actually a bit unclear as to exactly what we meant when we
said that the DDC supports @media, but I think we meant that it also
supports the

 

 @import url(...) <medialist>; 

 

syntax of CSS Level 2. In which case the regex needs to take account of
that too.

 

I guess it is possible to fix this up with regex, though I am not
convinced I'd want to be the one to write it.

 

Jo

 

 

________________________________

From: public-mobileok-checker-request@w3.org
[mailto:public-mobileok-checker-request@w3.org] On Behalf Of Laura
Holmes
Sent: 17 August 2007 15:45
To: public-mobileok-checker
Subject: css with regex

 

Hi all, 
Just wanted to let you know I just submitted some code that performs the
CSS tests using regular expressions. Feel free to try it out and let me
know if you encounter any bugs. The only bug we're currently facing is
incorrect line number reporting on embedded and inline style sheets
(although it works for external stylesheets). This error is because
we're pulling the line number from moki document, and the moki
document's version of the original file is a little corrupt due to the
e-mail that I sent out earlier this week. I'll work on getting that
sorted out soon, but any recommendations on the previous e-mail would be
wholeheartedly appreciated. However, this implementation does print out
snippets of offending code for all three style methods. 

If everyone approves of this method, I'm going to comment out the part
of the preprocessor that calls on our version of the css parser. While
using regular expressions, we no longer need it. Any strong objections
to this course of action? 


Go ahead and run the "measures" and "stylesheet support" tests with the
following commands, respectively:

MeasuresTest 1 MEASURES
StyleSheetsSupportTest 1 STYLE_SHEETS_SUPPORT

(for measures, you can run 2 and 3 as well. 1 covers external
stylesheets, 2 is embedded, and 3 is inline)

Also, in order to get successful runs, you might just want to comment
out the code in OneTestTest that compares the moki files and test files
for JUnit tests. There's been some weird variation in the moki document
generation that I'm trying to track down. 

Lastly, the External Resources and DefaultInputMode tests are up and
working. I'll be spending the next day or so writing out some more tests
for these tests in order to iron out any bugs, but pretty much
everything should be there. 

Cheers, 
Laura





 

Received on Friday, 17 August 2007 16:57:55 UTC