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

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

Issue 249633002: Detect <link rel='manifest'> and notify embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: error 500 Created 6 years, 8 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 86fedec952c8e36adf6b3012c142075b84d6b05c..da299f9025fdfd62c305895b4ca618f9f7eed05b 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -704,7 +704,7 @@ DOMImplementation& Document::implementation()
return *m_implementation;
}
-bool Document::hasManifest() const
+bool Document::hasAppCacheManifest() const
{
return isHTMLHtmlElement(documentElement()) && documentElement()->hasAttribute(manifestAttr);
}
@@ -4670,6 +4670,18 @@ Vector<IconURL> Document::iconURLs(int iconTypesMask)
return iconURLs;
}
+KURL Document::manifestURL()
+{
+ // The first link element with a manifest rel must be used. Others are ignored.
+ for (HTMLLinkElement* linkElement = head() ? Traversal<HTMLLinkElement>::firstChild(*head()) : 0; linkElement; linkElement = Traversal<HTMLLinkElement>::nextSibling(*linkElement)) {
+ if (!linkElement->relAttribute().isManifest())
+ continue;
+ return linkElement->href();
+ }
+
+ return KURL();
+}
+
void Document::setUseSecureKeyboardEntryWhenActive(bool usesSecureKeyboard)
{
if (m_useSecureKeyboardEntryWhenActive == usesSecureKeyboard)

Powered by Google App Engine
This is Rietveld 408576698