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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2566523003: Fix meta-theme-color not working outside <head> (Closed)
Patch Set: update Created 4 years 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 | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index ef948f518c45cd9cd95a1baff6af7c947baaaac2..c2fc48126fc4c47964ec06e48ece916e16d83579 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5397,14 +5397,15 @@ Vector<IconURL> Document::iconURLs(int iconTypesMask) {
}
Color Document::themeColor() const {
- for (HTMLMetaElement* metaElement =
- head() ? Traversal<HTMLMetaElement>::firstChild(*head()) : 0;
- metaElement;
- metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) {
+ auto rootElement = documentElement();
+ if (!rootElement)
+ return Color();
+ for (HTMLMetaElement& metaElement :
+ Traversal<HTMLMetaElement>::descendantsOf(*rootElement)) {
Color color = Color::transparent;
- if (equalIgnoringCase(metaElement->name(), "theme-color") &&
+ if (equalIgnoringCase(metaElement.name(), "theme-color") &&
CSSParser::parseColor(
- color, metaElement->content().getString().stripWhiteSpace(), true))
+ color, metaElement.content().getString().stripWhiteSpace(), true))
return color;
}
return Color();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698