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

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

Issue 126313002: Gracefully handle <meta http-equiv name content> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 | « LayoutTests/http/tests/misc/meta-http-equiv-and-name-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMetaElement-in.cpp
diff --git a/Source/core/html/HTMLMetaElement-in.cpp b/Source/core/html/HTMLMetaElement-in.cpp
index 136bc0bdf86387f6c7f7c431f4d103c20d0ea8dc..c1715116dfce720ae8f764fff29f4737e072a856 100644
--- a/Source/core/html/HTMLMetaElement-in.cpp
+++ b/Source/core/html/HTMLMetaElement-in.cpp
@@ -451,24 +451,23 @@ void HTMLMetaElement::process()
return;
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 (!nameValue.isEmpty()) {
+ if (equalIgnoringCase(nameValue, "viewport"))
+ processViewportContentAttribute(contentValue, ViewportDescription::ViewportMeta);
+ else if (equalIgnoringCase(nameValue, "referrer"))
+ document().processReferrerPolicy(contentValue);
+ else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnoringCase(contentValue, "true"))
+ processViewportContentAttribute("width=device-width", ViewportDescription::HandheldFriendlyMeta);
+ else if (equalIgnoringCase(nameValue, "mobileoptimized"))
+ processViewportContentAttribute("width=device-width, initial-scale=1", ViewportDescription::MobileOptimizedMeta);
}
- if (equalIgnoringCase(nameValue, "viewport"))
- processViewportContentAttribute(contentValue, ViewportDescription::ViewportMeta);
- else if (equalIgnoringCase(nameValue, "referrer"))
- document().processReferrerPolicy(contentValue);
- else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnoringCase(contentValue, "true"))
- processViewportContentAttribute("width=device-width", ViewportDescription::HandheldFriendlyMeta);
- 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.isEmpty())
+ document().processHttpEquiv(httpEquivValue, contentValue);
}
const AtomicString& HTMLMetaElement::content() const
« no previous file with comments | « LayoutTests/http/tests/misc/meta-http-equiv-and-name-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698