RenderMultiColumnFlowThread.cpp [plain text]
#include "config.h"
#include "RenderMultiColumnFlowThread.h"
#include "HitTestResult.h"
#include "LayoutState.h"
#include "RenderIterator.h"
#include "RenderMultiColumnSet.h"
#include "RenderMultiColumnSpannerPlaceholder.h"
#include "RenderView.h"
#include "TransformState.h"
namespace WebCore {
bool RenderMultiColumnFlowThread::gShiftingSpanner = false;
RenderMultiColumnFlowThread::RenderMultiColumnFlowThread(Document& document, PassRef<RenderStyle> style)
: RenderFlowThread(document, WTF::move(style))
, m_lastSetWorkedOn(nullptr)
, m_columnCount(1)
, m_columnWidth(0)
, m_columnHeightAvailable(0)
, m_inLayout(false)
, m_inBalancingPass(false)
, m_needsHeightsRecalculation(false)
, m_progressionIsInline(false)
, m_progressionIsReversed(false)
, m_beingEvacuated(false)
{
setFlowThreadState(InsideInFlowThread);
}
RenderMultiColumnFlowThread::~RenderMultiColumnFlowThread()
{
}
void RenderMultiColumnFlowThread::removeFlowChildInfo(RenderObject* child)
{
RenderFlowThread::removeFlowChildInfo(child);
flowThreadRelativeWillBeRemoved(child);
}
const char* RenderMultiColumnFlowThread::renderName() const
{
return "RenderMultiColumnFlowThread";
}
RenderMultiColumnSet* RenderMultiColumnFlowThread::firstMultiColumnSet() const
{
for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) {
if (sibling->isRenderMultiColumnSet())
return toRenderMultiColumnSet(sibling);
}
return nullptr;
}
RenderMultiColumnSet* RenderMultiColumnFlowThread::lastMultiColumnSet() const
{
for (RenderObject* sibling = multiColumnBlockFlow()->lastChild(); sibling; sibling = sibling->previousSibling()) {
if (sibling->isRenderMultiColumnSet())
return toRenderMultiColumnSet(sibling);
}
return nullptr;
}
RenderBox* RenderMultiColumnFlowThread::firstColumnSetOrSpanner() const
{
if (RenderObject* sibling = nextSibling()) {
ASSERT(sibling->isBox());
ASSERT(sibling->isRenderMultiColumnSet() || findColumnSpannerPlaceholder(toRenderBox(sibling)));
return toRenderBox(sibling);
}
return nullptr;
}
RenderBox* RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf(const RenderBox* child)
{
if (!child)
return nullptr;
if (RenderObject* sibling = child->nextSibling()) {
ASSERT(sibling->isBox());
return toRenderBox(sibling);
}
return nullptr;
}
RenderBox* RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf(const RenderBox* child)
{
if (!child)
return nullptr;
if (RenderObject* sibling = child->previousSibling()) {
ASSERT(sibling->isBox());
if (sibling->isRenderFlowThread())
return nullptr;
return toRenderBox(sibling);
}
return nullptr;
}
void RenderMultiColumnFlowThread::layout()
{
ASSERT(!m_inLayout);
m_inLayout = true;
m_lastSetWorkedOn = nullptr;
if (RenderBox* first = firstColumnSetOrSpanner()) {
if (first->isRenderMultiColumnSet()) {
m_lastSetWorkedOn = toRenderMultiColumnSet(first);
m_lastSetWorkedOn->beginFlow(this);
}
}
RenderFlowThread::layout();
if (RenderMultiColumnSet* lastSet = lastMultiColumnSet()) {
if (!nextColumnSetOrSpannerSiblingOf(lastSet))
lastSet->endFlow(this, logicalHeight());
lastSet->expandToEncompassFlowThreadContentsIfNeeded();
}
m_inLayout = false;
m_lastSetWorkedOn = nullptr;
}
RenderMultiColumnSet* RenderMultiColumnFlowThread::findSetRendering(RenderObject* renderer) const
{
for (RenderMultiColumnSet* multicolSet = firstMultiColumnSet(); multicolSet; multicolSet = multicolSet->nextSiblingMultiColumnSet()) {
if (multicolSet->containsRendererInFlowThread(renderer))
return multicolSet;
}
return nullptr;
}
void RenderMultiColumnFlowThread::populate()
{
RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
ASSERT(!nextSibling());
LayoutStateDisabler layoutStateDisabler(&view());
multicolContainer->moveChildrenTo(this, multicolContainer->firstChild(), this, true);
}
void RenderMultiColumnFlowThread::evacuateAndDestroy()
{
RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
m_beingEvacuated = true;
deleteLines();
LayoutStateDisabler layoutStateDisabler(&view());
multicolContainer->setMultiColumnFlowThread(nullptr);
moveAllChildrenTo(multicolContainer, true);
SpannerMap::iterator it;
while ((it = m_spannerMap.begin()) != m_spannerMap.end()) {
RenderBox* spanner = it->key;
RenderMultiColumnSpannerPlaceholder* placeholder = it->value;
RenderBlockFlow* originalContainer = toRenderBlockFlow(placeholder->parent());
multicolContainer->removeChild(*spanner);
originalContainer->addChild(spanner, placeholder);
placeholder->destroy();
m_spannerMap.remove(it);
}
while (RenderMultiColumnSet* columnSet = firstMultiColumnSet())
columnSet->destroy();
destroy();
}
void RenderMultiColumnFlowThread::addRegionToThread(RenderRegion* renderRegion)
{
RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(renderRegion);
if (RenderMultiColumnSet* nextSet = columnSet->nextSiblingMultiColumnSet()) {
RenderRegionList::iterator it = m_regionList.find(nextSet);
ASSERT(it != m_regionList.end());
m_regionList.insertBefore(it, columnSet);
} else
m_regionList.add(columnSet);
renderRegion->setIsValid(true);
}
void RenderMultiColumnFlowThread::willBeRemovedFromTree()
{
for (RenderMultiColumnSet* columnSet = firstMultiColumnSet(); columnSet; columnSet = columnSet->nextSiblingMultiColumnSet())
columnSet->detachRegion();
multiColumnBlockFlow()->setMultiColumnFlowThread(nullptr);
RenderFlowThread::willBeRemovedFromTree();
}
RenderObject* RenderMultiColumnFlowThread::resolveMovedChild(RenderObject* child) const
{
if (child->style().columnSpan() != ColumnSpanAll || !child->isBox()) {
return child;
}
if (RenderMultiColumnSpannerPlaceholder* placeholder = findColumnSpannerPlaceholder(toRenderBox(child)))
return placeholder;
return child;
}
static bool isValidColumnSpanner(RenderMultiColumnFlowThread* flowThread, RenderObject* descendant)
{
ASSERT(descendant->isDescendantOf(flowThread));
RenderStyle& style = descendant->style();
if (style.columnSpan() != ColumnSpanAll || !descendant->isBox() || descendant->isFloatingOrOutOfFlowPositioned())
return false;
RenderElement* container = descendant->parent();
if (!container->isRenderBlockFlow() || container->childrenInline()) {
return false;
}
RenderFlowThread* enclosingFlowThread = descendant->flowThreadContainingBlock();
if (enclosingFlowThread != flowThread)
return false;
for (RenderBox* ancestor = toRenderBox(descendant)->containingBlock(); ancestor; ancestor = ancestor->containingBlock()) {
if (ancestor->isRenderFlowThread()) {
return ancestor == flowThread;
}
ASSERT(ancestor->style().columnSpan() != ColumnSpanAll || !isValidColumnSpanner(flowThread, ancestor));
if (ancestor->isUnsplittableForPagination())
return false;
}
ASSERT_NOT_REACHED();
return false;
}
RenderObject* RenderMultiColumnFlowThread::processPossibleSpannerDescendant(RenderObject*& subtreeRoot, RenderObject* descendant)
{
RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
RenderObject* nextRendererInFlowThread = descendant->nextInPreOrderAfterChildren(this);
RenderObject* insertBeforeMulticolChild = nullptr;
RenderObject* nextDescendant = descendant;
if (isValidColumnSpanner(this, descendant)) {
RenderBlockFlow* container = toRenderBlockFlow(descendant->parent());
RenderMultiColumnSet* setToSplit = nullptr;
if (nextRendererInFlowThread) {
setToSplit = findSetRendering(descendant);
if (setToSplit) {
setToSplit->setNeedsLayout();
insertBeforeMulticolChild = setToSplit->nextSibling();
}
}
RenderMultiColumnSpannerPlaceholder* placeholder = RenderMultiColumnSpannerPlaceholder::createAnonymous(this, toRenderBox(descendant), &container->style());
container->addChild(placeholder, descendant->nextSibling());
container->removeChild(*descendant);
gShiftingSpanner = true;
multicolContainer->RenderBlock::addChild(descendant, insertBeforeMulticolChild);
gShiftingSpanner = false;
if (subtreeRoot == descendant)
subtreeRoot = placeholder;
nextDescendant = placeholder;
} else {
if (nextRendererInFlowThread && nextRendererInFlowThread->isRenderMultiColumnSpannerPlaceholder()) {
RenderMultiColumnSpannerPlaceholder* placeholder = toRenderMultiColumnSpannerPlaceholder(nextRendererInFlowThread);
if (RenderObject* previous = placeholder->spanner()->previousSibling()) {
if (previous->isRenderMultiColumnSet())
return nextDescendant; }
insertBeforeMulticolChild = placeholder->spanner();
} else if (RenderMultiColumnSet* lastSet = lastMultiColumnSet()) {
if (!lastSet->nextSibling())
return nextDescendant;
}
}
RenderMultiColumnSet* newSet = new RenderMultiColumnSet(*this, RenderStyle::createAnonymousStyleWithDisplay(&multicolContainer->style(), BLOCK));
newSet->initializeStyle();
multicolContainer->RenderBlock::addChild(newSet, insertBeforeMulticolChild);
invalidateRegions();
ASSERT(!previousColumnSetOrSpannerSiblingOf(newSet) || !previousColumnSetOrSpannerSiblingOf(newSet)->isRenderMultiColumnSet());
ASSERT(!nextColumnSetOrSpannerSiblingOf(newSet) || !nextColumnSetOrSpannerSiblingOf(newSet)->isRenderMultiColumnSet());
return nextDescendant;
}
void RenderMultiColumnFlowThread::flowThreadDescendantInserted(RenderObject* descendant)
{
if (gShiftingSpanner || m_beingEvacuated || descendant->isInFlowRenderFlowThread())
return;
RenderObject* subtreeRoot = descendant;
for (; descendant; descendant = (descendant ? descendant->nextInPreOrder(subtreeRoot) : nullptr)) {
if (descendant->isRenderMultiColumnSpannerPlaceholder()) {
RenderMultiColumnSpannerPlaceholder* placeholder = toRenderMultiColumnSpannerPlaceholder(descendant);
if (placeholder->flowThread() != this) {
RenderBox* spanner = placeholder->spanner();
gShiftingSpanner = true;
RenderBlockFlow* ancestorBlock = toRenderBlockFlow(spanner->parent());
ancestorBlock->moveChildTo(placeholder->parentBox(), spanner, placeholder->nextSibling(), true);
gShiftingSpanner = false;
if (subtreeRoot == descendant)
subtreeRoot = spanner;
placeholder->parent()->removeChild(*placeholder);
descendant = processPossibleSpannerDescendant(subtreeRoot, spanner);
continue;
}
ASSERT(!m_spannerMap.get(placeholder->spanner()));
m_spannerMap.add(placeholder->spanner(), placeholder);
ASSERT(!placeholder->firstChild()); continue;
}
descendant = processPossibleSpannerDescendant(subtreeRoot, descendant);
}
}
void RenderMultiColumnFlowThread::handleSpannerRemoval(RenderObject* spanner)
{
if (RenderMultiColumnSpannerPlaceholder* placeholder = m_spannerMap.get(toRenderBox(spanner))) {
placeholder->parent()->removeChild(*placeholder);
m_spannerMap.remove(toRenderBox(spanner));
}
if (RenderObject* next = spanner->nextSibling()) {
if (RenderObject* previous = spanner->previousSibling()) {
if (previous->isRenderMultiColumnSet() && next->isRenderMultiColumnSet()) {
next->destroy();
previous->setNeedsLayout();
}
}
}
}
void RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved(RenderObject* relative)
{
if (m_beingEvacuated)
return;
invalidateRegions();
if (relative->isRenderMultiColumnSpannerPlaceholder()) {
ASSERT(relative->isDescendantOf(this));
m_spannerMap.remove(toRenderMultiColumnSpannerPlaceholder(relative)->spanner());
return;
}
if (relative->style().columnSpan() == ColumnSpanAll) {
if (relative->parent() != parent())
return;
handleSpannerRemoval(relative);
}
}
void RenderMultiColumnFlowThread::flowThreadDescendantBoxLaidOut(RenderBox* descendant)
{
if (!descendant->isRenderMultiColumnSpannerPlaceholder())
return;
RenderMultiColumnSpannerPlaceholder* placeholder = toRenderMultiColumnSpannerPlaceholder(descendant);
RenderBlock* container = placeholder->containingBlock();
for (RenderBox* prev = previousColumnSetOrSpannerSiblingOf(placeholder->spanner()); prev; prev = previousColumnSetOrSpannerSiblingOf(prev)) {
if (prev->isRenderMultiColumnSet()) {
toRenderMultiColumnSet(prev)->endFlow(container, placeholder->logicalTop());
break;
}
}
for (RenderBox* next = nextColumnSetOrSpannerSiblingOf(placeholder->spanner()); next; next = nextColumnSetOrSpannerSiblingOf(next)) {
if (next->isRenderMultiColumnSet()) {
m_lastSetWorkedOn = toRenderMultiColumnSet(next);
m_lastSetWorkedOn->beginFlow(container);
break;
}
}
}
void RenderMultiColumnFlowThread::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
{
computedValues.m_extent = logicalHeight;
computedValues.m_position = logicalTop;
}
LayoutUnit RenderMultiColumnFlowThread::initialLogicalWidth() const
{
return columnWidth();
}
void RenderMultiColumnFlowThread::autoGenerateRegionsToBlockOffset(LayoutUnit offset)
{
(void)offset; ASSERT(toRenderMultiColumnSet(regionAtBlockOffset(0, offset, true, DisallowRegionAutoGeneration)));
}
void RenderMultiColumnFlowThread::setPageBreak(const RenderBlock* block, LayoutUnit offset, LayoutUnit spaceShortage)
{
if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset(block, offset)))
multicolSet->recordSpaceShortage(spaceShortage);
}
void RenderMultiColumnFlowThread::updateMinimumPageHeight(const RenderBlock* block, LayoutUnit offset, LayoutUnit minHeight)
{
if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset(block, offset)))
multicolSet->updateMinimumColumnHeight(minHeight);
}
RenderRegion* RenderMultiColumnFlowThread::regionAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastRegion, RegionAutoGenerationPolicy autoGenerationPolicy)
{
if (!m_inLayout)
return RenderFlowThread::regionAtBlockOffset(box, offset, extendLastRegion, autoGenerationPolicy);
RenderMultiColumnSet* columnSet = m_lastSetWorkedOn ? m_lastSetWorkedOn : firstMultiColumnSet();
if (!columnSet) {
return nullptr;
}
if (offset < columnSet->logicalTopInFlowThread()) {
do {
if (RenderMultiColumnSet* prev = columnSet->previousSiblingMultiColumnSet())
columnSet = prev;
else
break;
} while (offset < columnSet->logicalTopInFlowThread());
} else {
while (offset >= columnSet->logicalBottomInFlowThread()) {
RenderMultiColumnSet* next = columnSet->nextSiblingMultiColumnSet();
if (!next || !next->hasBeenFlowed())
break;
columnSet = next;
}
}
return columnSet;
}
void RenderMultiColumnFlowThread::setRegionRangeForBox(const RenderBox* box, RenderRegion* startRegion, RenderRegion* endRegion)
{
for (RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(startRegion)->previousSiblingMultiColumnSet(); columnSet; columnSet = columnSet->previousSiblingMultiColumnSet()) {
if (columnSet->logicalHeightInFlowThread())
break;
startRegion = columnSet;
}
for (RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(startRegion)->nextSiblingMultiColumnSet(); columnSet; columnSet = columnSet->nextSiblingMultiColumnSet()) {
if (columnSet->logicalHeightInFlowThread())
break;
endRegion = columnSet;
}
RenderFlowThread::setRegionRangeForBox(box, startRegion, endRegion);
}
bool RenderMultiColumnFlowThread::addForcedRegionBreak(const RenderBlock* block, LayoutUnit offset, RenderBox* , bool , LayoutUnit* offsetBreakAdjustment)
{
if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset(block, offset))) {
multicolSet->addForcedBreak(offset);
if (offsetBreakAdjustment)
*offsetBreakAdjustment = pageLogicalHeightForOffset(offset) ? pageRemainingLogicalHeightForOffset(offset, IncludePageBoundary) : LayoutUnit::fromPixel(0);
return true;
}
return false;
}
void RenderMultiColumnFlowThread::computeLineGridPaginationOrigin(LayoutState& layoutState) const
{
if (!progressionIsInline())
return;
const auto lineGrid = layoutState.lineGrid();
if (!lineGrid)
return;
auto lineGridBox = lineGrid->lineGridBox();
if (!lineGridBox)
return;
bool isHorizontalWritingMode = lineGrid->isHorizontalWritingMode();
LayoutUnit lineGridBlockOffset = isHorizontalWritingMode ? layoutState.lineGridOffset().height() : layoutState.lineGridOffset().width();
LayoutUnit gridLineHeight = lineGridBox->lineBottomWithLeading() - lineGridBox->lineTopWithLeading();
if (!gridLineHeight)
return;
LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineTopWithLeading();
if (layoutState.isPaginated() && layoutState.pageLogicalHeight()) {
LayoutUnit pageLogicalTop = isHorizontalWritingMode ? layoutState.pageOffset().height() : layoutState.pageOffset().width();
if (pageLogicalTop > firstLineTopWithLeading) {
LayoutUnit remainder = roundToInt(pageLogicalTop - firstLineTopWithLeading) % roundToInt(gridLineHeight);
LayoutUnit paginationDelta = gridLineHeight - remainder;
if (isHorizontalWritingMode)
layoutState.setLineGridPaginationOrigin(LayoutSize(layoutState.lineGridPaginationOrigin().width(), paginationDelta));
else
layoutState.setLineGridPaginationOrigin(LayoutSize(paginationDelta, layoutState.lineGridPaginationOrigin().height()));
}
}
}
LayoutSize RenderMultiColumnFlowThread::offsetFromContainer(RenderObject* enclosingContainer, const LayoutPoint& physicalPoint, bool* offsetDependsOnPoint) const
{
ASSERT(enclosingContainer == container());
if (offsetDependsOnPoint)
*offsetDependsOnPoint = true;
LayoutPoint translatedPhysicalPoint(physicalPoint);
RenderRegion* region = physicalTranslationFromFlowToRegion(translatedPhysicalPoint);
if (region)
translatedPhysicalPoint.moveBy(region->topLeftLocation());
LayoutSize offset(translatedPhysicalPoint.x(), translatedPhysicalPoint.y());
if (enclosingContainer->isBox())
offset -= toRenderBox(enclosingContainer)->scrolledContentOffset();
return offset;
}
void RenderMultiColumnFlowThread::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
{
parent()->mapAbsoluteToLocalPoint(mode, transformState);
LayoutPoint transformPoint = roundedLayoutPoint(transformState.mappedPoint());
const RenderMultiColumnSet* candidateColumnSet = nullptr;
LayoutPoint candidatePoint;
LayoutSize candidateContainerOffset;
for (const auto& columnSet : childrenOfType<RenderMultiColumnSet>(*parent())) {
candidateContainerOffset = columnSet.offsetFromContainer(parent(), LayoutPoint());
candidatePoint = transformPoint - candidateContainerOffset;
candidateColumnSet = &columnSet;
LayoutUnit pointOffset = isHorizontalWritingMode() ? candidatePoint.y() : candidatePoint.x();
LayoutUnit regionOffset = isHorizontalWritingMode() ? columnSet.topLeftLocation().y() : columnSet.topLeftLocation().x();
if (pointOffset < regionOffset + columnSet.logicalHeight())
break;
}
LayoutSize translationOffset = physicalTranslationFromRegionToFlow(candidateColumnSet, candidatePoint) + candidateContainerOffset;
bool preserve3D = mode & UseTransforms && (parent()->style().preserves3D() || style().preserves3D());
if (mode & UseTransforms && shouldUseTransformFromContainer(parent())) {
TransformationMatrix t;
getTransformFromContainer(parent(), translationOffset, t);
transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
} else
transformState.move(translationOffset.width(), translationOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
}
LayoutSize RenderMultiColumnFlowThread::physicalTranslationFromRegionToFlow(const RenderMultiColumnSet* columnSet, const LayoutPoint& physicalPoint) const
{
LayoutPoint logicalPoint = columnSet->flipForWritingMode(physicalPoint);
LayoutPoint translatedPoint = columnSet->translateRegionPointToFlowThread(logicalPoint);
LayoutPoint physicalTranslatedPoint = columnSet->flipForWritingMode(translatedPoint);
return physicalPoint - physicalTranslatedPoint;
}
RenderRegion* RenderMultiColumnFlowThread::mapFromFlowToRegion(TransformState& transformState) const
{
if (!hasValidRegionInfo())
return nullptr;
LayoutRect boxRect = transformState.mappedQuad().enclosingBoundingBox();
flipForWritingMode(boxRect);
LayoutPoint centerPoint = boxRect.center();
LayoutUnit centerLogicalOffset = isHorizontalWritingMode() ? centerPoint.y() : centerPoint.x();
RenderRegion* renderRegion = const_cast<RenderMultiColumnFlowThread*>(this)->regionAtBlockOffset(this, centerLogicalOffset, true, DisallowRegionAutoGeneration);
if (!renderRegion)
return nullptr;
transformState.move(physicalTranslationOffsetFromFlowToRegion(renderRegion, centerLogicalOffset));
return renderRegion;
}
LayoutSize RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToRegion(const RenderRegion* renderRegion, const LayoutUnit logicalOffset) const
{
const RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(renderRegion);
LayoutPoint translationOffset = columnSet->columnTranslationForOffset(logicalOffset);
if (style().isFlippedBlocksWritingMode()) {
LayoutRect portionRect(columnSet->flowThreadPortionRect());
LayoutRect columnRect = columnSet->columnRectAt(0);
LayoutUnit physicalDeltaFromPortionBottom = logicalHeight() - columnSet->logicalBottomInFlowThread();
if (isHorizontalWritingMode())
columnRect.setHeight(portionRect.height());
else
columnRect.setWidth(portionRect.width());
columnSet->flipForWritingMode(columnRect);
if (isHorizontalWritingMode())
translationOffset.move(0, columnRect.y() - portionRect.y() - physicalDeltaFromPortionBottom);
else
translationOffset.move(columnRect.x() - portionRect.x() - physicalDeltaFromPortionBottom, 0);
}
return LayoutSize(translationOffset.x(), translationOffset.y());
}
RenderRegion* RenderMultiColumnFlowThread::physicalTranslationFromFlowToRegion(LayoutPoint& physicalPoint) const
{
if (!hasValidRegionInfo())
return nullptr;
LayoutPoint logicalPoint = flipForWritingMode(physicalPoint);
LayoutUnit logicalOffset = isHorizontalWritingMode() ? logicalPoint.y() : logicalPoint.x();
RenderRegion* renderRegion = const_cast<RenderMultiColumnFlowThread*>(this)->regionAtBlockOffset(this, logicalOffset, true, DisallowRegionAutoGeneration);
if (!renderRegion)
return nullptr;
LayoutSize translationOffset = physicalTranslationOffsetFromFlowToRegion(renderRegion, logicalOffset);
physicalPoint += translationOffset;
return renderRegion;
}
bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const
{
if (RenderMultiColumnSet* columnSet = lastMultiColumnSet())
return columnSet->columnHeightComputed();
return false;
}
bool RenderMultiColumnFlowThread::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
{
if (hitTestAction == HitTestBlockBackground)
return false;
bool inside = RenderFlowThread::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, hitTestAction);
if (inside && !result.innerNode())
return false;
return inside;
}
bool RenderMultiColumnFlowThread::shouldCheckColumnBreaks() const
{
if (!parent()->isRenderView())
return true;
return view().frameView().pagination().behavesLikeColumns;
}
}