[Webkit-unassigned] [Bug 18604] Backslash escape (\) for splitting CSS rules into a couple of lines fails in WebKit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 27 19:43:40 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=18604


Glenn Adams <glenn at skynav.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID
                 CC|                            |glenn at skynav.com,
                   |                            |seikwon.kim at samsung.com




--- Comment #4 from Glenn Adams <glenn at skynav.com>  2012-09-27 19:44:06 PST ---
the analysis of this bug is incorrect; in particular, the attached test case and the test from hixie cited below [1] contain a backslash that is OUTSIDE of a string, and NOT in a string;

[1] http://www.hixie.ch/tests/evil/css/css21/contributions/incoming/00003.xht

the text cited below in comment #1 refers to backslash appearing IN a string; the more complete, relevant text from CSS 2.1 is found in Section 4.1.3 [2] which states:

"First, inside a string, a backslash followed by a newline is ignored (i.e., the string is deemed not to contain either the backslash or the newline). Outside a string, a backslash followed by a newline stands for itself (i.e., a DELIM followed by a newline)."

[2] http://www.w3.org/TR/CSS2/syndata.html

so, in fact, the backslash followed by newline that appears in these tests should be treated as the token sequence <DELIM NL>

according to the general grammar in [3], DELIM matches the 'any' non-terminal, so the attached test should parse as two consecutive rulesets:

ruleset <= 'h1 {background: white; color: red}'
ruleset <= '\ zzz, h1 {color: green}'

where in the second ruleset the selector non-terminal matches DELIM IDENT DELIM IDENT

[3] http://www.w3.org/TR/CSS2/syndata.html#tokenization

now, however, the more restrictive grammar in Appendix G [4] does not admit backslash or DELIM as a token in a selector, so consequently, the second ruleset fails to match the selector non-terminal, and thus the entire second statement is treated as a malformed statement and ignored [5]

[4] http://www.w3.org/TR/CSS2/grammar.html
[5] http://www.w3.org/TR/CSS2/syndata.html#parsing-errors

i checked both Opera and FF and both behave the same as WK

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list