summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderRegion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderRegion.cpp')
-rw-r--r--Source/WebCore/rendering/RenderRegion.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp
index b9b33f397..dbdbe83f7 100644
--- a/Source/WebCore/rendering/RenderRegion.cpp
+++ b/Source/WebCore/rendering/RenderRegion.cpp
@@ -191,18 +191,11 @@ void RenderRegion::layout()
// We'll need to expand RenderBoxRegionInfo to also hold left and right overflow values.
}
-void RenderRegion::attachRegion()
+void RenderRegion::installFlowThread()
{
ASSERT(view());
- ASSERT(!m_flowThread);
- // Initialize the flow thread reference and create the flow thread object if needed.
- // The flow thread lifetime is influenced by the number of regions attached to it,
- // and we are attaching the region to the flow thread.
- m_flowThread = view()->flowThreadController()->ensureRenderFlowThreadWithName(style()->regionThread());
- // A region is valid if it is not part of a circular reference, which is checked below
- // and in RenderNamedFlowThread::addRegionToThread.
- setIsValid(false);
+ m_flowThread = view()->flowThreadController()->ensureRenderFlowThreadWithName(style()->regionThread());
// By now the flow thread should already be added to the rendering tree,
// so we go up the rendering parents and check that this region is not part of the same
@@ -214,15 +207,28 @@ void RenderRegion::attachRegion()
m_parentNamedFlowThread = toRenderNamedFlowThread(parentObject);
// Do not take into account a region that links a flow with itself. The dependency
// cannot change, so it is not worth adding it to the list.
- if (m_flowThread == m_parentNamedFlowThread) {
+ if (m_flowThread == m_parentNamedFlowThread)
m_flowThread = 0;
- // This region is not valid for this flow thread (as being part of a circular dependency).
- setIsValid(false);
- return;
- }
break;
}
}
+}
+
+void RenderRegion::attachRegion()
+{
+ if (documentBeingDestroyed())
+ return;
+
+ // A region starts off invalid.
+ setIsValid(false);
+
+ // Initialize the flow thread reference and create the flow thread object if needed.
+ // The flow thread lifetime is influenced by the number of regions attached to it,
+ // and we are attaching the region to the flow thread.
+ installFlowThread();
+
+ if (!m_flowThread)
+ return;
m_flowThread->addRegionToThread(this);