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

Unified Diff: Source/core/html/forms/ColorInputType.cpp

Issue 1167793003: Escape all of invalid values in console messages for INPUT elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/html/forms/ColorInputType.cpp
diff --git a/Source/core/html/forms/ColorInputType.cpp b/Source/core/html/forms/ColorInputType.cpp
index eb6276d7c7df16e039d32b8aa9cd7135fd46f843..66a17364cc9711e4feb16ab38114349788037722 100644
--- a/Source/core/html/forms/ColorInputType.cpp
+++ b/Source/core/html/forms/ColorInputType.cpp
@@ -48,6 +48,7 @@
#include "core/layout/LayoutTheme.h"
#include "core/layout/LayoutView.h"
#include "core/page/ChromeClient.h"
+#include "platform/JSONValues.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/UserGestureIndicator.h"
#include "platform/graphics/Color.h"
@@ -190,7 +191,7 @@ void ColorInputType::warnIfValueIsInvalid(const String& value) const
{
if (!equalIgnoringCase(value, element().sanitizeValue(value))) {
element().document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, WarningMessageLevel,
- String::format("The specified value '%s' does not conform to the required format. The format is '#rrggbb' where rr, gg, bb are two-digit hexadecimal numbers.", value.utf8().data())));
+ String::format("The specified value %s does not conform to the required format. The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.", JSONValue::quoteString(value).utf8().data())));
}
}

Powered by Google App Engine
This is Rietveld 408576698