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

Unified Diff: third_party/WebKit/Source/core/html/HTMLHtmlElement.cpp

Issue 2042413002: Notify the HTMLDocumentParser on document element available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: insertedByParser after actual insertion point Created 4 years, 6 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: third_party/WebKit/Source/core/html/HTMLHtmlElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLHtmlElement.cpp b/third_party/WebKit/Source/core/html/HTMLHtmlElement.cpp
index a3690db032890765ce31b5e833ba37d791788f2f..955ee29a9381f3661d0cd5f591adf9a803f75f11 100644
--- a/third_party/WebKit/Source/core/html/HTMLHtmlElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLHtmlElement.cpp
@@ -50,16 +50,27 @@ bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const
void HTMLHtmlElement::insertedByParser()
{
// When parsing a fragment, its dummy document has a null parser.
- if (!document().parser() || !document().parser()->documentWasLoadedAsPartOfNavigation())
+ if (!document().parser())
return;
+ maybeSetupApplicationCache();
+
+ document().parser()->documentElementAvailable();
+ if (document().frame()) {
+ document().frame()->loader().dispatchDocumentElementAvailable();
+ document().frame()->loader().runScriptsAtDocumentElementAvailable();
+ // runScriptsAtDocumentElementAvailable might have invalidated m_document.
+ }
+}
+
+void HTMLHtmlElement::maybeSetupApplicationCache()
+{
if (!document().frame())
return;
DocumentLoader* documentLoader = document().frame()->loader().documentLoader();
- if (!documentLoader)
+ if (!documentLoader || !document().parser()->documentWasLoadedAsPartOfNavigation())
return;
-
const AtomicString& manifest = fastGetAttribute(manifestAttr);
if (manifest.isEmpty())
documentLoader->applicationCacheHost()->selectCacheWithoutManifest();
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLHtmlElement.h ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698