Commit 1e40fdb1 authored by chaopeng's avatar chaopeng Committed by Commit bot

Improve warnings for non-standard meta tag separators

Ignore other warnings when detected semi-colons in viewport tag.

BUG=139428

Review-Url: https://codereview.chromium.org/2312303002
Cr-Commit-Position: refs/heads/master@{#419165}
parent 9a7aa82b
......@@ -56,19 +56,19 @@ public:
private:
explicit HTMLMetaElement(Document&);
static void processViewportKeyValuePair(Document*, const String& key, const String& value, bool viewportMetaZeroValuesQuirk, void* data);
static void processViewportKeyValuePair(Document*, bool reportWarnings, const String& key, const String& value, bool viewportMetaZeroValuesQuirk, void* data);
static void parseContentAttribute(const String& content, void* data, Document*, bool viewportMetaZeroValuesQuirk);
void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicString&) override;
InsertionNotificationRequest insertedInto(ContainerNode*) override;
void didNotifySubtreeInsertionsToDocument() override;
static float parsePositiveNumber(Document*, const String& key, const String& value, bool* ok = 0);
static float parsePositiveNumber(Document*, bool reportWarnings, const String& key, const String& value, bool* ok = 0);
static Length parseViewportValueAsLength(Document*, const String& key, const String& value);
static float parseViewportValueAsZoom(Document*, const String& key, const String& value, bool& computedValueMatchesParsedValue, bool viewportMetaZeroValuesQuirk);
static bool parseViewportValueAsUserZoom(Document*, const String& key, const String& value, bool& computedValueMatchesParsedValue);
static float parseViewportValueAsDPI(Document*, const String& key, const String& value);
static Length parseViewportValueAsLength(Document*, bool reportWarnings, const String& key, const String& value);
static float parseViewportValueAsZoom(Document*, bool reportWarnings, const String& key, const String& value, bool& computedValueMatchesParsedValue, bool viewportMetaZeroValuesQuirk);
static bool parseViewportValueAsUserZoom(Document*, bool reportWarnings, const String& key, const String& value, bool& computedValueMatchesParsedValue);
static float parseViewportValueAsDPI(Document*, bool reportWarnings, const String& key, const String& value);
static void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement1, const String& replacement2);
......
......@@ -2952,27 +2952,11 @@ TEST_F(ViewportTest, viewportWarnings5)
Page* page = webViewHelper.webView()->page();
PageScaleConstraints constraints = runViewportTest(page, 320, 352);
EXPECT_EQ(5U, webFrameClient.messages.size());
EXPECT_EQ(1U, webFrameClient.messages.size());
EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[0].level);
EXPECT_STREQ("The value \"device-width;\" for key \"width\" is invalid, and has been ignored.",
webFrameClient.messages[0].text.utf8().c_str());
EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[1].level);
EXPECT_STREQ("The value \"1.0;\" for key \"initial-scale\" was truncated to its numeric prefix.",
webFrameClient.messages[1].text.utf8().c_str());
EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[2].level);
EXPECT_STREQ("The value \"1.0;\" for key \"maximum-scale\" was truncated to its numeric prefix.",
webFrameClient.messages[2].text.utf8().c_str());
EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[3].level);
EXPECT_STREQ("The value \"0;\" for key \"user-scalable\" was truncated to its numeric prefix.",
webFrameClient.messages[3].text.utf8().c_str());
EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[4].level);
EXPECT_STREQ("Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.",
webFrameClient.messages[4].text.utf8().c_str());
webFrameClient.messages[0].text.utf8().c_str());
EXPECT_NEAR(320.0f, constraints.layoutSize.width(), 0.01);
EXPECT_NEAR(352.0f, constraints.layoutSize.height(), 0.01);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment