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

Unified Diff: Source/core/html/imports/HTMLImportChild.cpp

Issue 249563003: REGRESSION(r171966): Custom elements in async imports don't get upgrade. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/html/imports/HTMLImportChild.cpp
diff --git a/Source/core/html/imports/HTMLImportChild.cpp b/Source/core/html/imports/HTMLImportChild.cpp
index 4309e071e08606f285a5ed65c40f950a1ef3f899..33bf0097961d01b6977ecaa406871d989ad9de76 100644
--- a/Source/core/html/imports/HTMLImportChild.cpp
+++ b/Source/core/html/imports/HTMLImportChild.cpp
@@ -62,11 +62,8 @@ HTMLImportChild::~HTMLImportChild()
// importDestroyed() should be called before the destruction.
ASSERT(!m_loader);
- if (m_customElementMicrotaskStep) {
- // if Custom Elements were blocked, must unblock them before death
- m_customElementMicrotaskStep->importDidFinish();
- m_customElementMicrotaskStep = 0;
- }
+ if (m_customElementMicrotaskStep)
+ m_customElementMicrotaskStep->importWasDestroyed();
if (m_client)
m_client->importChildWasDestroyed(this);
@@ -99,18 +96,25 @@ void HTMLImportChild::didFinish()
if (m_client)
m_client->didFinish();
- if (m_customElementMicrotaskStep) {
- m_customElementMicrotaskStep->importDidFinish();
- m_customElementMicrotaskStep = 0;
- }
+ ASSERT(!m_customElementMicrotaskStep);
}
void HTMLImportChild::didFinishLoading()
{
+ // This triggers closing handshake between CustomElementMicrotaskImportStep.
+ // It eventually tells back through didFinishMicrotask(), then this import becomes "done".
+ if (m_customElementMicrotaskStep)
+ m_customElementMicrotaskStep->importDidLoad(this);
clearResource();
stateWillChange();
}
+void HTMLImportChild::didFinishMicrotask()
+{
+ m_customElementMicrotaskStep = 0;
+ stateWillChange();
+}
+
Document* HTMLImportChild::importedDocument() const
{
if (!m_loader)
@@ -157,7 +161,7 @@ void HTMLImportChild::ensureLoader()
else
createLoader();
- if (isSync() && !isDone()) {
+ if (!isDone() && !formsCycle()) {
ASSERT(!m_customElementMicrotaskStep);
m_customElementMicrotaskStep = CustomElement::didCreateImport(this);
}
@@ -181,7 +185,7 @@ void HTMLImportChild::shareLoader(HTMLImportChild* loader)
bool HTMLImportChild::isDone() const
{
- return m_loader && m_loader->isDone();
+ return m_loader && m_loader->isDone() && !m_customElementMicrotaskStep;
}
bool HTMLImportChild::loaderHasError() const
« Source/core/html/imports/HTMLImportChild.h ('K') | « Source/core/html/imports/HTMLImportChild.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698