Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: Source/core/css/CSSMarkup.cpp

Issue 1330243002: CSS escape doesn't escape leading hyphen. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch to handle '--' Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/CSSMarkup.cpp
diff --git a/Source/core/css/CSSMarkup.cpp b/Source/core/css/CSSMarkup.cpp
index ce45904ccd859140868b5e7e1aff06edb79062b1..03a3f8910f66615d3012fc57e9e9591d9bc987e8 100644
--- a/Source/core/css/CSSMarkup.cpp
+++ b/Source/core/css/CSSMarkup.cpp
@@ -219,6 +219,8 @@ bool serializeIdentifier(const String& identifier, StringBuilder& appendTo)
if (c <= 0x1f || c == 0x7f || (0x30 <= c && c <= 0x39 && (isFirst || (isSecond && isFirstCharHyphen))))
serializeCharacterAsCodePoint(c, appendTo);
+ else if (c == 0x2d && isFirst && index == identifier.length())
+ serializeCharacter(c, appendTo);
else if (0x80 <= c || c == 0x2d || c == 0x5f || (0x30 <= c && c <= 0x39) || (0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a))
appendTo.append(c);
else
« LayoutTests/css3/escape-dom-api.html ('K') | « LayoutTests/css3/escape-dom-api-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698