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

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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 0b4277c3be96e0c2a25dc71792fb3cf47fdc8481..06b2158baf114e185d062fc566feb7272b90504c 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,18 @@ Vector<IconURL> Document::iconURLs(int iconTypesMask)
return iconURLs;
}
+HTMLLinkElement* Document::linkManifest() const
+{
+ // The first link element with a manifest rel must be used. Others are ignored.
Inactive 2014/05/08 20:13:29 May be a bit simpler to return early if head() is
Inactive 2014/05/10 00:40:20 Did you disagree with this proposal? It avoided ca
mlamouri (slow - plz ping) 2014/05/10 11:28:45 Eh, sorry about that. I got focused on the tests a
+ for (HTMLLinkElement* linkElement = head() ? Traversal<HTMLLinkElement>::firstChild(*head()) : 0; linkElement; linkElement = Traversal<HTMLLinkElement>::nextSibling(*linkElement)) {
+ if (!linkElement->relAttribute().isManifest())
+ continue;
+ return linkElement;
+ }
+
+ return 0;
+}
+
void Document::setUseSecureKeyboardEntryWhenActive(bool usesSecureKeyboard)
{
if (m_useSecureKeyboardEntryWhenActive == usesSecureKeyboard)

Powered by Google App Engine
This is Rietveld 408576698