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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2566523003: Fix meta-theme-color not working outside <head> (Closed)
Patch Set: Address comments 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 5379 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 if (firstTouchIcon.m_iconType != InvalidIcon) 5390 if (firstTouchIcon.m_iconType != InvalidIcon)
5391 iconURLs.append(firstTouchIcon); 5391 iconURLs.append(firstTouchIcon);
5392 if (firstTouchPrecomposedIcon.m_iconType != InvalidIcon) 5392 if (firstTouchPrecomposedIcon.m_iconType != InvalidIcon)
5393 iconURLs.append(firstTouchPrecomposedIcon); 5393 iconURLs.append(firstTouchPrecomposedIcon);
5394 for (int i = secondaryIcons.size() - 1; i >= 0; --i) 5394 for (int i = secondaryIcons.size() - 1; i >= 0; --i)
5395 iconURLs.append(secondaryIcons[i]); 5395 iconURLs.append(secondaryIcons[i]);
5396 return iconURLs; 5396 return iconURLs;
5397 } 5397 }
5398 5398
5399 Color Document::themeColor() const { 5399 Color Document::themeColor() const {
5400 for (HTMLMetaElement* metaElement = 5400 auto de = documentElement();
tkent 2016/12/09 09:20:53 'de' isn't a good name. 'rootElement' or somethin
lpy 2016/12/09 17:53:36 Done.
5401 head() ? Traversal<HTMLMetaElement>::firstChild(*head()) : 0; 5401 if (!de)
5402 metaElement; 5402 return Color();
5403 metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) { 5403 for (HTMLMetaElement& metaElement :
5404 Traversal<HTMLMetaElement>::descendantsOf(*de)) {
5404 Color color = Color::transparent; 5405 Color color = Color::transparent;
5405 if (equalIgnoringCase(metaElement->name(), "theme-color") && 5406 if (equalIgnoringCase(metaElement.name(), "theme-color") &&
5406 CSSParser::parseColor( 5407 CSSParser::parseColor(
5407 color, metaElement->content().getString().stripWhiteSpace(), true)) 5408 color, metaElement.content().getString().stripWhiteSpace(), true))
5408 return color; 5409 return color;
5409 } 5410 }
5410 return Color(); 5411 return Color();
5411 } 5412 }
5412 5413
5413 HTMLLinkElement* Document::linkManifest() const { 5414 HTMLLinkElement* Document::linkManifest() const {
5414 HTMLHeadElement* head = this->head(); 5415 HTMLHeadElement* head = this->head();
5415 if (!head) 5416 if (!head)
5416 return 0; 5417 return 0;
5417 5418
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
6589 } 6590 }
6590 6591
6591 void showLiveDocumentInstances() { 6592 void showLiveDocumentInstances() {
6592 WeakDocumentSet& set = liveDocumentSet(); 6593 WeakDocumentSet& set = liveDocumentSet();
6593 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6594 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6594 for (Document* document : set) 6595 for (Document* document : set)
6595 fprintf(stderr, "- Document %p URL: %s\n", document, 6596 fprintf(stderr, "- Document %p URL: %s\n", document,
6596 document->url().getString().utf8().data()); 6597 document->url().getString().utf8().data());
6597 } 6598 }
6598 #endif 6599 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698