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

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

Issue 2566523003: Fix meta-theme-color not working outside <head> (Closed)
Patch Set: 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 | no next file » | 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..1b993609e73df4b89e499f078ef10bfe53d4423d 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5397,15 +5397,22 @@ 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)) {
- Color color = Color::transparent;
- if (equalIgnoringCase(metaElement->name(), "theme-color") &&
- CSSParser::parseColor(
- color, metaElement->content().getString().stripWhiteSpace(), true))
- return color;
+ for (HTMLElement* child =
tkent 2016/12/09 06:07:25 Do you need nested-|for|s? Why don't you do someth
lpy 2016/12/09 08:43:43 Done.
+ documentElement()
+ ? Traversal<HTMLElement>::firstChild(*documentElement())
+ : 0;
+ child; child = Traversal<HTMLElement>::nextSibling(*child)) {
+ for (HTMLMetaElement* metaElement =
+ Traversal<HTMLMetaElement>::firstChild(*child);
+ metaElement;
+ metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) {
+ Color color = Color::transparent;
+ if (equalIgnoringCase(metaElement->name(), "theme-color") &&
+ CSSParser::parseColor(
+ color, metaElement->content().getString().stripWhiteSpace(),
+ true))
+ return color;
+ }
}
return Color();
}
« 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