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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSMarkup.cpp

Issue 1363233003: Make sure <url>s are being serialized according to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix interpolation tests Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 appendTo.append('\"'); 256 appendTo.append('\"');
257 } 257 }
258 258
259 String serializeString(const String& string) 259 String serializeString(const String& string)
260 { 260 {
261 StringBuilder builder; 261 StringBuilder builder;
262 serializeString(string, builder); 262 serializeString(string, builder);
263 return builder.toString(); 263 return builder.toString();
264 } 264 }
265 265
266 String serializeStringWithoutQuotations(const String& string) 266 String serializeURI(const String& string)
267 { 267 {
268 StringBuilder appendTo; 268 return "url(" + serializeString(string) + ")";
269 unsigned index = 0;
270 while (index < string.length()) {
271 UChar32 c = string.characterStartingAt(index);
272 index += U16_LENGTH(c);
273 if (c <= 0x1f)
274 serializeCharacterAsCodePoint(c, appendTo);
275 else if (c == 0x22 || c == 0x5c)
276 serializeCharacter(c, appendTo);
277 else
278 appendTo.append(c);
279 }
280 return appendTo.toString();
281 } 269 }
282 270
283 } // namespace blink 271 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSMarkup.h ('k') | third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698