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

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

Issue 19555002: Translate viewport related meta tags into @viewport descriptors as suggested by the CSS Device Adap… (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
Index: Source/core/dom/StyleSheetCollection.cpp
diff --git a/Source/core/dom/StyleSheetCollection.cpp b/Source/core/dom/StyleSheetCollection.cpp
index a665b8074de6d5510f73e4b4e48524d00b0f2cb9..3dff28f66e8d07016bddbb13981b87ce05ee8038 100644
--- a/Source/core/dom/StyleSheetCollection.cpp
+++ b/Source/core/dom/StyleSheetCollection.cpp
@@ -40,6 +40,7 @@
#include "core/dom/shadow/ShadowRoot.h"
#include "core/html/HTMLIFrameElement.h"
#include "core/html/HTMLLinkElement.h"
+#include "core/html/HTMLMetaElement.h"
#include "core/html/HTMLStyleElement.h"
#include "core/page/Settings.h"
#include "core/svg/SVGStyleElement.h"
@@ -217,7 +218,7 @@ void StyleSheetCollectionForDocument::collectStyleSheets(DocumentStyleSheetColle
sheet = pi->sheet();
if (sheet && !sheet->disabled() && sheet->isCSSStyleSheet())
activeSheet = static_cast<CSSStyleSheet*>(sheet);
- } else if ((n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagName(styleTag))) || (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))) {
+ } else if ((n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagName(styleTag) || n->hasTagName(metaTag))) || (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))) {
Element* e = toElement(n);
AtomicString title = e->getAttribute(titleAttr);
bool enabledViaScript = false;
@@ -242,8 +243,10 @@ void StyleSheetCollectionForDocument::collectStyleSheets(DocumentStyleSheetColle
title = nullAtom;
} else if (n->isSVGElement() && n->hasTagName(SVGNames::styleTag)) {
sheet = static_cast<SVGStyleElement*>(n)->sheet();
- } else {
+ } else if (n->hasTagName(styleTag)) {
sheet = static_cast<HTMLStyleElement*>(n)->sheet();
+ } else {
+ sheet = static_cast<HTMLMetaElement*>(n)->sheet();
}
if (sheet && !sheet->disabled() && sheet->isCSSStyleSheet())

Powered by Google App Engine
This is Rietveld 408576698