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

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

Issue 270283007: Implement the logic to find the correct <link> for Manifest in Document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@link_manifest
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 0b4277c3be96e0c2a25dc71792fb3cf47fdc8481..0bb8a126a7ec6e7addc8be7b6aa18467a1819e58 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -718,7 +718,7 @@ DOMImplementation& Document::implementation()
return *m_implementation;
}
-bool Document::hasManifest() const
+bool Document::hasAppCacheManifest() const
{
return isHTMLHtmlElement(documentElement()) && documentElement()->hasAttribute(manifestAttr);
}
@@ -2462,7 +2462,7 @@ void Document::setBody(PassRefPtr<HTMLElement> prpNewBody, ExceptionState& excep
documentElement()->appendChild(newBody.release(), exceptionState);
}
-HTMLHeadElement* Document::head()
+HTMLHeadElement* Document::head() const
{
Node* de = documentElement();
if (!de)
@@ -4686,6 +4686,22 @@ Vector<IconURL> Document::iconURLs(int iconTypesMask)
return iconURLs;
}
+HTMLLinkElement* Document::linkManifest() const
+{
+ HTMLHeadElement* head = this->head();
+ if (!head)
+ return 0;
+
+ // The first link element with a manifest rel must be used. Others are ignored.
+ for (HTMLLinkElement* linkElement = Traversal<HTMLLinkElement>::firstChild(*head); linkElement; linkElement = Traversal<HTMLLinkElement>::nextSibling(*linkElement)) {
+ if (!linkElement->relAttribute().isManifest())
+ continue;
+ return linkElement;
+ }
+
+ return 0;
+}
+
void Document::setUseSecureKeyboardEntryWhenActive(bool usesSecureKeyboard)
{
if (m_useSecureKeyboardEntryWhenActive == usesSecureKeyboard)
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698