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

Unified Diff: Source/core/html/HTMLImport.cpp

Issue 135653006: [import] Refactoring: Get rid of BlockedFromCreatingDocument state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/html/HTMLImport.h ('k') | Source/core/html/HTMLImportChild.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImport.cpp
diff --git a/Source/core/html/HTMLImport.cpp b/Source/core/html/HTMLImport.cpp
index c136788fad9fa3ca6f26a3ea432e618fa558537c..abc6da56420b4719149bc322d4037536783c9481 100644
--- a/Source/core/html/HTMLImport.cpp
+++ b/Source/core/html/HTMLImport.cpp
@@ -54,18 +54,16 @@ void HTMLImport::appendChild(HTMLImport* child)
{
if (isBlockedFromRunningScript())
child->blockFromRunningScript();
- if (lastChild() && lastChild()->isBlockingFollowersFromCreatingDocument())
- child->blockFromCreatingDocument();
TreeNode<HTMLImport>::appendChild(child);
if (child->isCreatedByParser())
blockPredecessorsOf(child);
}
-inline bool HTMLImport::isBlockedFromCreatingDocumentByPredecessors() const
+bool HTMLImport::isBlockedFromCreatingDocument() const
{
- ASSERT(isBlockedFromCreatingDocument());
- HTMLImport* elder = previous();
- return (elder && !elder->isDone());
+ if (hasLoader())
+ return false;
+ return previous() && previous()->isBlockingFollowersFromCreatingDocument();
}
bool HTMLImport::isBlockedFromRunningScriptByPredecessors() const
@@ -96,12 +94,6 @@ void HTMLImport::blockFromRunningScript()
m_state = BlockedFromRunningScript;
}
-void HTMLImport::blockFromCreatingDocument()
-{
- if (BlockedFromCreatingDocument < m_state)
- m_state = BlockedFromCreatingDocument;
-}
-
void HTMLImport::becomeReady()
{
if (!isBlocked())
@@ -118,14 +110,6 @@ void HTMLImport::unblockFromRunningScript()
didUnblockFromRunningScript();
}
-void HTMLImport::unblockFromCreatingDocument()
-{
- if (!isBlockedFromCreatingDocument())
- return;
- m_state = BlockedFromRunningScript;
- didUnblockFromCreatingDocument();
-}
-
void HTMLImport::didUnblockFromRunningScript()
{
ASSERT(!isBlockedFromCreatingDocument());
@@ -146,7 +130,6 @@ void HTMLImport::didUnblockFromCreatingDocument()
void HTMLImport::loaderWasResolved()
{
- unblockFromCreatingDocument();
unblockFromRunningScript();
}
@@ -179,9 +162,9 @@ bool HTMLImport::unblock(HTMLImport* import)
{
ASSERT(!import->isBlockedFromRunningScriptByPredecessors());
- if (import->isBlockedFromCreatingDocument() && import->isBlockedFromCreatingDocumentByPredecessors())
+ if (import->isBlockedFromCreatingDocument())
return false;
- import->unblockFromCreatingDocument();
+ import->didUnblockFromCreatingDocument();
for (HTMLImport* child = import->firstChild(); child; child = child->next()) {
if (!unblock(child))
« no previous file with comments | « Source/core/html/HTMLImport.h ('k') | Source/core/html/HTMLImportChild.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698