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

Unified Diff: Source/core/dom/ViewportArguments.cpp

Issue 22908011: Change viewport error messages in preparation for use with @viewport rule (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
« no previous file with comments | « Source/core/dom/ViewportArguments.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ViewportArguments.cpp
diff --git a/Source/core/dom/ViewportArguments.cpp b/Source/core/dom/ViewportArguments.cpp
index 72a64ebe4a5bffde8b2bc26d1fe4a13c9709c0b4..0a2708dd1f07b1b02f760d61f5acb4d501683393 100644
--- a/Source/core/dom/ViewportArguments.cpp
+++ b/Source/core/dom/ViewportArguments.cpp
@@ -396,11 +396,12 @@ void setViewportFeature(const String& keyString, const String& valueString, Docu
static const char* viewportErrorMessageTemplate(ViewportErrorCode errorCode)
{
static const char* const errors[] = {
- "Viewport argument key \"%replacement1\" not recognized and ignored.",
- "Viewport argument value \"%replacement1\" for key \"%replacement2\" is invalid, and has been ignored.",
- "Viewport argument value \"%replacement1\" for key \"%replacement2\" was truncated to its numeric prefix.",
- "Viewport maximum-scale cannot be larger than 10.0. The maximum-scale will be set to 10.0.",
- "Viewport target-densitydpi is not supported.",
+ "Note that ';' is not a key-value pair separator. The list should be comma-separated.",
+ "The key \"%replacement1\" is not recognized and ignored.",
+ "The value \"%replacement1\" for key \"%replacement2\" is invalid, and has been ignored.",
+ "The value \"%replacement1\" for key \"%replacement2\" was truncated to its numeric prefix.",
+ "The value for key \"maximum-scale\" is out of bounds and the value has been clamped.",
+ "The key \"target-densitydpi\" is not supported.",
};
return errors[errorCode];
@@ -409,6 +410,7 @@ static const char* viewportErrorMessageTemplate(ViewportErrorCode errorCode)
static MessageLevel viewportErrorMessageLevel(ViewportErrorCode errorCode)
{
switch (errorCode) {
+ case InvalidKeyValuePairSeparatorError:
case TruncatedViewportArgumentValueError:
case TargetDensityDpiUnsupported:
return WarningMessageLevel;
@@ -434,9 +436,6 @@ void reportViewportWarning(Document* document, ViewportErrorCode errorCode, cons
if (!replacement2.isNull())
message.replace("%replacement2", replacement2);
- if ((errorCode == UnrecognizedViewportArgumentValueError || errorCode == TruncatedViewportArgumentValueError) && replacement1.find(';') != WTF::notFound)
- message.append(" Note that ';' is not a separator in viewport values. The list should be comma-separated.");
-
// FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
document->addConsoleMessage(RenderingMessageSource, viewportErrorMessageLevel(errorCode), message);
}
« no previous file with comments | « Source/core/dom/ViewportArguments.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698