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

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

Issue 2566523003: Fix meta-theme-color not working outside <head> (Closed)
Patch Set: Add tests 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
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..8b3bcf8520b65112b0ebe20c25c2aab226e16151 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5397,14 +5397,12 @@ 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)) {
+ for (HTMLMetaElement& metaElement :
+ Traversal<HTMLMetaElement>::descendantsOf(*documentElement())) {
tkent 2016/12/09 08:48:38 Crash if documentElement() is nullptr.
lpy 2016/12/09 09:17:37 Done.
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();

Powered by Google App Engine
This is Rietveld 408576698