RE: Explaination request: MS test (IE8, RC1) -- H4\at-rule-001.htm

Hi Arron,


Thanks for the mail, I didn’t realize I was actually looking for the wrong part of the spec.

Now it clear. Maybe such a hint can be appended to the test-file as well (for other people making the same mistake).


Best Regards,

Robert Stam




From: Arron Eicholz [] 
Sent: Sunday, February 22, 2009 8:31 PM
To: Robert Stam;
Subject: RE: Explaination request: MS test (IE8, RC1) -- H4\at-rule-001.htm


I think you are getting your error handling mixed up with @keywords. This is not going into @keyword error handling because of the space right after the @ symbol. Why you ask?


The @ symbol is not followed by an IDENT as required by all @ keywords. And specifically @charset, @import, @page or @media, thus the @ symbol in this case is just an IDENT under the simple_selector rules in Appendix G and it’s an invalid IDENT for that matter. In this case the parsing ends up like this:


@ = invalid IDENT for an element_name

import = valid IDENT, for an element_name

“../../../Support/at-rule-red.css”; = is also attempting to be an IDENT for an element_name which it is also invalid.

Next the div = which is a valid IDENT for an element_name

Then we move onto parsing the { } of the div.


Even assuming that the @ and “…“; were valid element_names you couldn’t match an element on the page with that selector.


This is one of those real tricky cases that tricks your brain into thinking that this is a case that should follow the Invalid at-keyword rules in section 4.2 but it really is a 4.1.7 test case.


So the case is a correct case just a little complicated to determine where the rule is supposed to be handled from a spec perspective.


Arron Eicholz


From: [] On Behalf Of Robert Stam
Sent: Thursday, January 29, 2009 2:15 AM
Subject: Explaination request: MS test (IE8, RC1) -- H4\at-rule-001.htm




Find below the test document.

Please notice that the @ and import identifier are separated by a space.


I expected that the invalid at-keyword would end at the ; after at-rule-red.css";


The specification says: “User agents must ignore <>  an invalid at-keyword together with everything following it, up to and including the next semicolon (;) or block ({...}), whichever comes first.”


This results in a red “Filler Text”, can somebody please give me an explanation why the div rule should be ignored as well?


Thanks in advance.


Best Regards,

Robert Stam




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

<html xmlns="">


        <title>CSS Test: Parser error handling with invalid at-rules: @ invalid selector</title>

        <link rel="author" title="Microsoft" href="" />

        <link rel="help" href="" />

        <meta name="flags" content="invalid" />

        <meta name="assert" content="At-Rules start with an at-keyword (@ followed immediately by an identifier)." />

        <style type="text/css">

            @ import "../../../Support/at-rule-red.css";



                color: red;




                color: green;





        <p>Test passes if the "Filler Text" below is green.</p>

        <div>Filler Text</div>




Received on Friday, 27 February 2009 08:49:35 UTC