<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>18604</bug_id>
          
          <creation_ts>2008-04-18 17:55:34 -0700</creation_ts>
          <short_desc>Backslash escape (\) for splitting CSS rules into a couple of lines fails in WebKit</short_desc>
          <delta_ts>2012-09-27 19:44:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.hixie.ch/tests/evil/css/css21/contributions/incoming/00003.xht</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="jasneet">jasneet</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>glenn</cc>
    
    <cc>jasneet</cc>
    
    <cc>seikwon.kim</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78194</commentid>
    <comment_count>0</comment_count>
    <who name="jasneet">jasneet</who>
    <bug_when>2008-04-18 17:55:34 -0700</bug_when>
    <thetext>I Steps:
Go to 
http://www.hixie.ch/tests/evil/css/css21/contributions/incoming/00003.xht

II Issue:
The text appears red instead of green as backslash parsing fails.

III Conclusion:
issue with backslash parsing

IV Other browsers:
IE7: not ok; link does not open
FF3: ok
Opera9.24: ok

V Nightly tested: 32005

Another link with same issue: 
http://www.hixie.ch/tests/evil/css/css21/contributions/incoming/00006.xht 
(this test passes in Opera)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82104</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-06-02 04:19:29 -0700</bug_when>
    <thetext>I can confirm the bug. It violates the definition of CSS 2.1 CR:
&quot;It is possible to break strings over several lines, for esthetic or other reasons, but in such a case the newline itself has to be escaped with a backslash (\). For instance, the following two selectors are exactly the same:

a[title=&quot;a not s\
o very long title&quot;] {/*...*/}
a[title=&quot;a not so very long title&quot;] {/*...*/}&quot; [http://www.w3.org/TR/CSS21/syndata.html#strings]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82105</commentid>
    <comment_count>2</comment_count>
      <attachid>21458</attachid>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-06-02 04:20:01 -0700</bug_when>
    <thetext>Created attachment 21458
minimal test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190857</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-02-16 19:08:24 -0800</bug_when>
    <thetext>See also: bug 28885.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>730163</commentid>
    <comment_count>4</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2012-09-27 19:44:06 -0700</bug_when>
    <thetext>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:

&quot;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).&quot;

[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 &lt;DELIM NL&gt;

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

ruleset &lt;= &apos;h1 {background: white; color: red}&apos;
ruleset &lt;= &apos;\ zzz, h1 {color: green}&apos;

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</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>21458</attachid>
            <date>2008-06-02 04:20:01 -0700</date>
            <delta_ts>2008-06-02 04:20:01 -0700</delta_ts>
            <desc>minimal test case</desc>
            <filename>CSS 2.1 Test Suite: Backslash parsing.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>369</size>
            <attacher name="Robert Blaut">webkit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIveGh0bWwxMS9EVEQveGh0bWwxMS5kdGQiPgo8aHRtbCB4bWxucz0iaHR0
cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCI+CiA8aGVhZD4KICA8dGl0bGU+Q1NTIDIuMSBUZXN0
IFN1aXRlOiBCYWNrc2xhc2ggcGFyc2luZzwvdGl0bGU+CiAgCiAgPHN0eWxlIHR5cGU9InRleHQv
Y3NzIj4KaDEge2JhY2tncm91bmQ6IHdoaXRlOyBjb2xvcjogcmVkfVwKenp6LCBoMSB7Y29sb3I6
IGdyZWVufQogIDwvc3R5bGU+CiA8L2hlYWQ+CiA8Ym9keT4KICA8aDE+VGhpcyBzaG91bGQgYmUg
Z3JlZW48L2gxPgogPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>