[CSS21] [4.2 Rules for handling parsing errors] Unexpected end of string questions

Hello,

I am more and more unsure and unconvinced about a test submitted
http://test.csswg.org/suites/css2.1/20110323/html4/unterminated-string-001.htm
and then modified/corrected
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/unterminated-string-001.htm

I am unsure and unconvinced about the "corrected" test.



First, here's what the CSS 2.1 spec - everything quoted between ** -
states in section 4.2 Rules for handling parsing errors
o Unexpected end of string.
http://www.w3.org/TR/CSS21/syndata.html#parsing-errors


**

Unexpected end of string.

User agents must close strings upon reaching the end of a line (i.e.,
before an unescaped line feed, carriage return or form feed character),
but then drop the construct (declaration or rule) in which the string was
found. For example:


      p {
        color: green;
        font-family: 'Courier New Times
        color: red;
        color: green;
      }

...would be treated the same as:


      p { color: green; color: green; }

...because the second declaration (from 'font-family' to the semicolon
after 'color: red') is invalid and is dropped.


**

Quoted excerpt from
section 4.2 Rules for handling parsing errors
o Unexpected end of string.
http://www.w3.org/TR/CSS21/syndata.html#parsing-errors

Notice - and this is very important - that the font-family declaration
block in the example does not have a closing semi-colon (";"). So, the
declaration block starts with/from 'font-family and ends with the
semicolon after red.

Now, if we look at

http://test.csswg.org/suites/css2.1/20110323/html4/unterminated-string-001.htm

then the declaration block which should have been dropped, according to
section 4.2, is and only is
font-family: 'Courier;

That test was incorrect regardless/anyway.

The modified test - and this is my mistake - looks/seems now still doubtful:

http://test.csswg.org/suites/css2.1/nightly-unstable/html4/unterminated-string-001.htm


div
            {
                color: green;
                font-family: 'Courier;
                color: red;
            }


If I understand the parsing rules, error handling rules, the declaration
block
font-family: 'Courier;
should be dropped and only such declaration block (which ends with a
semicolon). The
color: red;
declaration block should *not* be dropped. And therefore, the div's text
should be red!

Is my reasoning correct?

The test would be much better (in as for parsing errors and error
handling) and more precise if it had/if it was:

div
            {
                color: green;
                font-family: 'Courier
                color: red;
            }

Am I correct ?


regards, Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Friday, 17 August 2012 04:35:12 UTC