summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderRegion.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-22 13:36:28 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-22 13:36:28 +0200
commitc311cf639cc1d6570d67b0a80a8ba04dc992a658 (patch)
tree6e16fefc7ece11ce4ec1e475a58a537a7acebaf8 /Source/WebCore/rendering/RenderRegion.cpp
parent5ef7c8a6a70875d4430752d146bdcb069605d71d (diff)
downloadqtwebkit-c311cf639cc1d6570d67b0a80a8ba04dc992a658.tar.gz
Imported WebKit commit 35255d8c2fd37ba4359e75fe0ebe6aec87687f9c (http://svn.webkit.org/repository/webkit/trunk@126284)
New snapshot that includes MSVC 64-bit build fix
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);