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

Unified Diff: Source/core/html/HTMLMetaElement.cpp

Issue 25728006: Change code order in HTMLMetaElement::process() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed spelling issue Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMetaElement.cpp
diff --git a/Source/core/html/HTMLMetaElement.cpp b/Source/core/html/HTMLMetaElement.cpp
index d84b68b69beff8c9a3f9de0fa963db86d88817ea..4a43932fcff6095705f89dd133084661c9408bf9 100644
--- a/Source/core/html/HTMLMetaElement.cpp
+++ b/Source/core/html/HTMLMetaElement.cpp
@@ -405,24 +405,30 @@ void HTMLMetaElement::process()
if (!inDocument())
return;
+ // All below situations require a content attribute (which can be the empty string).
const AtomicString& contentValue = fastGetAttribute(contentAttr);
if (contentValue.isNull())
return;
- if (equalIgnoringCase(name(), "viewport"))
+ const AtomicString& nameValue = fastGetAttribute(nameAttr);
+ if (nameValue.isNull()) {
+ // Get the document to process the tag, but only if we're actually part of DOM
+ // tree (changing a meta tag while it's not in the tree shouldn't have any effect
+ // on the document)
+ const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr);
+ if (!httpEquivValue.isNull())
+ document().processHttpEquiv(httpEquivValue, contentValue);
+ return;
+ }
+
+ if (equalIgnoringCase(nameValue, "viewport"))
processViewportContentAttribute(contentValue, ViewportDescription::ViewportMeta);
- else if (equalIgnoringCase(name(), "referrer"))
+ else if (equalIgnoringCase(nameValue, "referrer"))
document().processReferrerPolicy(contentValue);
- else if (equalIgnoringCase(name(), "handheldfriendly") && equalIgnoringCase(contentValue, "true"))
+ else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnoringCase(contentValue, "true"))
processViewportContentAttribute("width=device-width", ViewportDescription::HandheldFriendlyMeta);
- else if (equalIgnoringCase(name(), "mobileoptimized"))
+ else if (equalIgnoringCase(nameValue, "mobileoptimized"))
processViewportContentAttribute("width=device-width, initial-scale=1", ViewportDescription::MobileOptimizedMeta);
-
- // Get the document to process the tag, but only if we're actually part of DOM tree (changing a meta tag while
- // it's not in the tree shouldn't have any effect on the document)
- const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr);
- if (!httpEquivValue.isNull())
- document().processHttpEquiv(httpEquivValue, contentValue);
}
String HTMLMetaElement::content() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698