WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
35010
Mishandling of \\ in 'content' property
https://bugs.webkit.org/show_bug.cgi?id=35010
Summary
Mishandling of \\ in 'content' property
Simon Fraser (smfr)
Reported
2010-02-16 16:38:18 PST
From: Boris Zbarsky <
bzbarsky@MIT.EDU
> Subject: Re: [css2.1] Content of a string containing a backslash followed immediately by EOF Date: February 16, 2010 4:29:07 PM PST To: Zack Weinberg <
zweinberg@mozilla.com
> Cc:
www-style@w3.org
list <
www-style@w3.org
> Message-Id: <
4B7B3853.6010300@mit.edu
> Not sure about IE, but it looks like Webkit somehow messes up \\ at the end of the before content no matter what. |content: "\\m";| shows a backslash followed by an 'm', but |content: "whatever\\"| shows nothing. And even more clearly, something like this: <style>.a:before { content: "m\\"; } .a { content: "o\\" }</style> <div>a:'<span class="a">'</span></div> Renders as: a:'m\"; } .a { content: ' in Webkit. So it looks like the \\ is somehow managing to escape the '"' in Webkit's parser. -Boris
Attachments
jsFiddle test cases
(28 bytes, text/plain)
2011-07-11 12:13 PDT
,
Han
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Han
Comment 1
2011-07-11 12:13:13 PDT
Created
attachment 100345
[details]
jsFiddle test cases
Han
Comment 2
2011-07-11 15:04:11 PDT
Actually, \\ at the end of the the quoted string works fine as long as there's no more of the same kind of quote (single or double) on the same line. See
http://jsfiddle.net/gfLDV/8/
. This is actually really annoying because that means (the way I discovered it) if every declaration is on it's own like there's no problem, but then CSS compressor removes newlines and suddenly WebKit thinks the content is a gigantic string of compressed CSS up to the last matching quote. (Test case is identical if you replace before with after or the single quotes with double quotes.)
Elliott Sprehn
Comment 3
2012-07-24 04:02:06 PDT
The test case passes in Webkit nightlies/Chrome 20, this was probably fixed a while ago.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug