summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2017-06-01 15:54:01 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-06-02 14:07:43 +0000
commit0a3506ebe5d7f431f0dd4dffa24ac32063b90ff1 (patch)
treef3d0b92fe7bc5b31426a838c354616fff335e82b /Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
parent881da28418d380042aa95a97f0cbd42560a64f7c (diff)
downloadqtwebkit-0a3506ebe5d7f431f0dd4dffa24ac32063b90ff1.tar.gz
Import WebKit commit 3ca7a25a550e473d60bbbe321475c6c0ef114b31
Change-Id: I480668a0cb8114dccf7a1195190a993282875759 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp')
-rw-r--r--Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp b/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
index b212f632d..06ff8cd3c 100644
--- a/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
@@ -270,10 +270,34 @@ static bool isValidColumnSpanner(RenderMultiColumnFlowThread* flowThread, Render
return false;
}
+static RenderObject* spannerPlacehoderCandidate(const RenderObject& renderer, const RenderMultiColumnFlowThread& stayWithin)
+{
+ // Spanner candidate is a next sibling/ancestor's next child within the flow thread and
+ // it is in the same inflow/out-of-flow layout context.
+ if (renderer.isOutOfFlowPositioned())
+ return nullptr;
+
+ ASSERT(renderer.isDescendantOf(&stayWithin));
+ auto* current = &renderer;
+ while (true) {
+ // Skip to the first in-flow sibling.
+ auto* nextSibling = current->nextSibling();
+ while (nextSibling && nextSibling->isOutOfFlowPositioned())
+ nextSibling = nextSibling->nextSibling();
+ if (nextSibling)
+ return nextSibling;
+ // No sibling candidate, jump to the parent and check its siblings.
+ current = current->parent();
+ if (!current || current == &stayWithin || current->isOutOfFlowPositioned())
+ return nullptr;
+ }
+ return nullptr;
+}
+
RenderObject* RenderMultiColumnFlowThread::processPossibleSpannerDescendant(RenderObject*& subtreeRoot, RenderObject* descendant)
{
RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
- RenderObject* nextRendererInFlowThread = descendant->nextInPreOrderAfterChildren(this);
+ RenderObject* nextRendererInFlowThread = spannerPlacehoderCandidate(*descendant, *this);
RenderObject* insertBeforeMulticolChild = nullptr;
RenderObject* nextDescendant = descendant;