WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
patch.txt (text/plain), 162.78 KB, created by
Dave Hyatt
on 2014-05-05 15:32:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dave Hyatt
Created:
2014-05-05 15:32:48 PDT
Size:
162.78 KB
patch
obsolete
>Index: Source/WebCore/dom/Document.cpp >=================================================================== >--- Source/WebCore/dom/Document.cpp (revision 168316) >+++ Source/WebCore/dom/Document.cpp (working copy) >@@ -1099,11 +1099,6 @@ PassRefPtr<Element> Document::createElem > return element.release(); > } > >-bool Document::regionBasedColumnsEnabled() const >-{ >- return settings() && settings()->regionBasedColumnsEnabled(); >-} >- > bool Document::cssRegionsEnabled() const > { > return RuntimeEnabledFeatures::sharedFeatures().cssRegionsEnabled(); >Index: Source/WebCore/dom/Document.h >=================================================================== >--- Source/WebCore/dom/Document.h (revision 168316) >+++ Source/WebCore/dom/Document.h (working copy) >@@ -436,8 +436,6 @@ public: > > NamedFlowCollection* namedFlows(); > >- bool regionBasedColumnsEnabled() const; >- > #if ENABLE(CSS_GRID_LAYOUT) > bool cssGridLayoutEnabled() const; > #endif >Index: Source/WebCore/page/FrameView.cpp >=================================================================== >--- Source/WebCore/page/FrameView.cpp (revision 168316) >+++ Source/WebCore/page/FrameView.cpp (working copy) >@@ -120,7 +120,7 @@ static RenderLayer::UpdateLayerPositions > flags &= ~RenderLayer::CheckForRepaint; > flags |= RenderLayer::NeedsFullRepaintInBacking; > } >- if (isRelayoutingSubtree && (layer->isPaginated() || layer->enclosingPaginationLayer())) >+ if (isRelayoutingSubtree && layer->enclosingPaginationLayer()) > flags |= RenderLayer::UpdatePagination; > return flags; > } >Index: Source/WebCore/page/Settings.in >=================================================================== >--- Source/WebCore/page/Settings.in (revision 168316) >+++ Source/WebCore/page/Settings.in (working copy) >@@ -84,7 +84,7 @@ allowScriptsToCloseWindows initial=false > canvasUsesAcceleratedDrawing initial=false > acceleratedDrawingEnabled initial=false > acceleratedFiltersEnabled initial=false >-regionBasedColumnsEnabled initial=false >+regionBasedColumnsEnabled initial=true > cssGridLayoutEnabled initial=true > useLegacyTextAlignPositionedElementBehavior initial=false > >Index: Source/WebCore/rendering/LayoutState.cpp >=================================================================== >--- Source/WebCore/rendering/LayoutState.cpp (revision 168316) >+++ Source/WebCore/rendering/LayoutState.cpp (working copy) >@@ -26,17 +26,16 @@ > #include "config.h" > #include "LayoutState.h" > >-#include "ColumnInfo.h" > #include "RenderFlowThread.h" > #include "RenderInline.h" > #include "RenderLayer.h" >+#include "RenderMultiColumnFlowThread.h" > #include "RenderView.h" > > namespace WebCore { > >-LayoutState::LayoutState(std::unique_ptr<LayoutState> next, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo) >- : m_columnInfo(columnInfo) >- , m_lineGrid(0) >+LayoutState::LayoutState(std::unique_ptr<LayoutState> next, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged) >+ : m_lineGrid(0) > , m_next(std::move(next)) > #ifndef NDEBUG > , m_renderer(renderer) >@@ -82,7 +81,7 @@ LayoutState::LayoutState(std::unique_ptr > > // If we establish a new page height, then cache the offset to the top of the first page. > // We can compare this later on to figure out what part of the page we're actually on, >- if (pageLogicalHeight || m_columnInfo || renderer->isRenderFlowThread()) { >+ if (pageLogicalHeight || renderer->isRenderFlowThread()) { > m_pageLogicalHeight = pageLogicalHeight; > bool isFlipped = renderer->style().isFlippedBlocksWritingMode(); > m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? renderer->borderLeft() + renderer->paddingLeft() : renderer->borderRight() + renderer->paddingRight()), >@@ -101,23 +100,20 @@ LayoutState::LayoutState(std::unique_ptr > m_pageLogicalHeight = 0; > m_isPaginated = false; > } else >- m_isPaginated = m_pageLogicalHeight || m_next->m_columnInfo || renderer->flowThreadContainingBlock(); >+ m_isPaginated = m_pageLogicalHeight || renderer->flowThreadContainingBlock(); > } > > // Propagate line grid information. > propagateLineGridInfo(renderer); > >- if (!m_columnInfo) >- m_columnInfo = m_next->m_columnInfo; >- > m_layoutDelta = m_next->m_layoutDelta; > #if !ASSERT_DISABLED && ENABLE(SATURATED_LAYOUT_ARITHMETIC) > m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated; > m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated; > #endif > >- if (lineGrid() && (lineGrid()->style().writingMode() == renderer->style().writingMode()) && renderer->isRenderBlock()) >- toRenderBlock(renderer)->computeLineGridPaginationOrigin(*this); >+ if (lineGrid() && (lineGrid()->style().writingMode() == renderer->style().writingMode()) && renderer->isRenderMultiColumnFlowThread()) >+ toRenderMultiColumnFlowThread(renderer)->computeLineGridPaginationOrigin(*this); > > // If we have a new grid to track, then add it to our set. > if (renderer->style().lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow()) >@@ -134,7 +130,6 @@ LayoutState::LayoutState(RenderObject& r > , m_layoutDeltaXSaturated(false) > , m_layoutDeltaYSaturated(false) > #endif >- , m_columnInfo(0) > , m_lineGrid(0) > , m_pageLogicalHeight(0) > #ifndef NDEBUG >@@ -156,7 +151,6 @@ void LayoutState::clearPaginationInforma > { > m_pageLogicalHeight = m_next->m_pageLogicalHeight; > m_pageOffset = m_next->m_pageOffset; >- m_columnInfo = m_next->m_columnInfo; > } > > LayoutUnit LayoutState::pageLogicalOffset(RenderBox* child, LayoutUnit childLogicalOffset) const >@@ -166,13 +160,6 @@ LayoutUnit LayoutState::pageLogicalOffse > return m_layoutOffset.width() + childLogicalOffset - m_pageOffset.width(); > } > >-void LayoutState::addForcedColumnBreak(RenderBox* child, LayoutUnit childLogicalOffset) >-{ >- if (!m_columnInfo || m_columnInfo->columnHeight()) >- return; >- m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); >-} >- > void LayoutState::propagateLineGridInfo(RenderBox* renderer) > { > // Disable line grids for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and >Index: Source/WebCore/rendering/LayoutState.h >=================================================================== >--- Source/WebCore/rendering/LayoutState.h (revision 168316) >+++ Source/WebCore/rendering/LayoutState.h (working copy) >@@ -26,7 +26,6 @@ > #ifndef LayoutState_h > #define LayoutState_h > >-#include "ColumnInfo.h" > #include "LayoutRect.h" > #include <wtf/HashMap.h> > #include <wtf/Noncopyable.h> >@@ -53,7 +52,6 @@ public: > , m_layoutDeltaXSaturated(false) > , m_layoutDeltaYSaturated(false) > #endif >- , m_columnInfo(nullptr) > , m_lineGrid(nullptr) > , m_pageLogicalHeight(0) > #ifndef NDEBUG >@@ -62,18 +60,15 @@ public: > { > } > >- LayoutState(std::unique_ptr<LayoutState> state, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged, ColumnInfo*); >+ LayoutState(std::unique_ptr<LayoutState>, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged); > explicit LayoutState(RenderObject&); > > void clearPaginationInformation(); >- bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->paginationUnit() == ColumnInfo::Column; } > bool isPaginated() const { return m_isPaginated; } > > // The page logical offset is the object's offset from the top of the page in the page progression > // direction (so an x-offset in vertical text and a y-offset for horizontal text). > LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) const; >- >- void addForcedColumnBreak(RenderBox*, LayoutUnit childLogicalOffset); > > LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } > bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } >@@ -93,7 +88,7 @@ private: > void establishLineGrid(RenderBlockFlow*); > > public: >- // Do not add anything apart from bitfields until after m_columnInfo. See https://bugs.webkit.org/show_bug.cgi?id=100173 >+ // Do not add anything apart from bitfields. See https://bugs.webkit.org/show_bug.cgi?id=100173 > bool m_clipped : 1; > bool m_isPaginated : 1; > // If our page height has changed, this will force all blocks to relayout. >@@ -103,8 +98,6 @@ public: > bool m_layoutDeltaYSaturated : 1; > #endif > >- // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation. >- ColumnInfo* m_columnInfo; > // The current line grid that we're snapping to and the offset of the start of the grid. > RenderBlockFlow* m_lineGrid; > std::unique_ptr<LayoutState> m_next; >Index: Source/WebCore/rendering/RenderBlock.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlock.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) >@@ -25,7 +25,6 @@ > #include "RenderBlock.h" > > #include "AXObjectCache.h" >-#include "ColumnInfo.h" > #include "Document.h" > #include "Editor.h" > #include "Element.h" >@@ -54,7 +53,6 @@ > #include "RenderInline.h" > #include "RenderIterator.h" > #include "RenderLayer.h" >-#include "RenderMarquee.h" > #include "RenderNamedFlowFragment.h" > #include "RenderNamedFlowThread.h" > #include "RenderRegion.h" >@@ -86,9 +84,6 @@ struct SameSizeAsRenderBlock : public Re > > COMPILE_ASSERT(sizeof(RenderBlock) == sizeof(SameSizeAsRenderBlock), RenderBlock_should_stay_small); > >-typedef WTF::HashMap<const RenderBox*, std::unique_ptr<ColumnInfo>> ColumnInfoMap; >-static ColumnInfoMap* gColumnInfoMap = 0; >- > static TrackedDescendantsMap* gPositionedDescendantsMap = 0; > static TrackedDescendantsMap* gPercentHeightDescendantsMap = 0; > >@@ -101,8 +96,6 @@ typedef WTF::HashSet<RenderBlock*> Delay > static int gDelayUpdateScrollInfo = 0; > static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0; > >-static bool gColumnFlowSplitEnabled = true; >- > // Allocated only when some of these fields have non-default values > > struct RenderBlockRareData { >@@ -207,8 +200,6 @@ static void removeBlockFromDescendantAnd > > RenderBlock::~RenderBlock() > { >- if (hasColumns()) >- gColumnInfoMap->take(this); > if (gRareDataMap) > gRareDataMap->remove(this); > if (gPercentHeightDescendantsMap) >@@ -347,7 +338,7 @@ RenderBlock* RenderBlock::continuationBe > void RenderBlock::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild) > { > RenderBlock* flow = continuationBefore(beforeChild); >- ASSERT(!beforeChild || beforeChild->parent()->isAnonymousColumnSpanBlock() || beforeChild->parent()->isRenderBlock()); >+ ASSERT(!beforeChild || beforeChild->parent()->isRenderBlock()); > RenderBoxModelObject* beforeChildParent = 0; > if (beforeChild) > beforeChildParent = toRenderBoxModelObject(beforeChild->parent()); >@@ -364,8 +355,6 @@ void RenderBlock::addChildToContinuation > return; > } > >- // A continuation always consists of two potential candidates: a block or an anonymous >- // column span box holding column span children. > bool childIsNormal = newChild->isInline() || !newChild->style().columnSpan(); > bool bcpIsNormal = beforeChildParent->isInline() || !beforeChildParent->style().columnSpan(); > bool flowIsNormal = flow->isInline() || !flow->style().columnSpan(); >@@ -388,96 +377,6 @@ void RenderBlock::addChildToContinuation > beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild); > } > >- >-void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild) >-{ >- ASSERT(!continuation()); // We don't yet support column spans that aren't immediate children of the multi-column block. >- >- // The goal is to locate a suitable box in which to place our child. >- RenderBlock* beforeChildParent = 0; >- if (beforeChild) { >- RenderObject* curr = beforeChild; >- while (curr && curr->parent() != this) >- curr = curr->parent(); >- beforeChildParent = toRenderBlock(curr); >- ASSERT(beforeChildParent); >- ASSERT(beforeChildParent->isAnonymousColumnsBlock() || beforeChildParent->isAnonymousColumnSpanBlock()); >- } else >- beforeChildParent = toRenderBlock(lastChild()); >- >- // If the new child is floating or positioned it can just go in that block. >- if (newChild->isFloatingOrOutOfFlowPositioned()) { >- beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild); >- return; >- } >- >- // See if the child can be placed in the box. >- bool newChildHasColumnSpan = !newChild->isInline() && newChild->style().columnSpan(); >- bool beforeChildParentHoldsColumnSpans = beforeChildParent->isAnonymousColumnSpanBlock(); >- >- if (newChildHasColumnSpan == beforeChildParentHoldsColumnSpans) { >- beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild); >- return; >- } >- >- if (!beforeChild) { >- // Create a new block of the correct type. >- RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock() : createAnonymousColumnsBlock(); >- insertChildInternal(newBox, nullptr, NotifyChildren); >- newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0); >- return; >- } >- >- RenderObject* immediateChild = beforeChild; >- bool isPreviousBlockViable = true; >- while (immediateChild->parent() != this) { >- if (isPreviousBlockViable) >- isPreviousBlockViable = !immediateChild->previousSibling(); >- immediateChild = immediateChild->parent(); >- } >- if (isPreviousBlockViable && immediateChild->previousSibling()) { >- toRenderBlock(immediateChild->previousSibling())->addChildIgnoringAnonymousColumnBlocks(newChild, 0); // Treat like an append. >- return; >- } >- >- // Split our anonymous blocks. >- RenderObject* newBeforeChild = splitAnonymousBoxesAroundChild(beforeChild); >- >- >- // Create a new anonymous box of the appropriate type. >- RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock() : createAnonymousColumnsBlock(); >- insertChildInternal(newBox, newBeforeChild, NotifyChildren); >- newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0); >- return; >-} >- >-RenderBlock* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock) >-{ >- RenderBlock* firstChildIgnoringAnonymousWrappers = 0; >- for (RenderElement* curr = this; curr; curr = curr->parent()) { >- if (!curr->isRenderBlock() || curr->isFloatingOrOutOfFlowPositioned() || curr->isTableCell() || curr->isRoot() || curr->isRenderView() || curr->hasOverflowClip() >- || curr->isInlineBlockOrInlineTable()) >- return 0; >- >- // FIXME: Tables, RenderButtons, and RenderListItems all do special management >- // of their children that breaks when the flow is split through them. Disabling >- // multi-column for them to avoid this problem. >- if (curr->isTable() || curr->isRenderButton() || curr->isListItem()) >- return 0; >- >- RenderBlock* currBlock = toRenderBlock(curr); >- if (!currBlock->createsAnonymousWrapper()) >- firstChildIgnoringAnonymousWrappers = currBlock; >- >- if (currBlock->style().specifiesColumns() && (allowAnonymousColumnBlock || !currBlock->isAnonymousColumnsBlock())) >- return firstChildIgnoringAnonymousWrappers; >- >- if (currBlock->isAnonymousColumnSpanBlock()) >- return 0; >- } >- return 0; >-} >- > RenderPtr<RenderBlock> RenderBlock::clone() const > { > RenderPtr<RenderBlock> cloneBlock; >@@ -568,147 +467,15 @@ void RenderBlock::splitBlocks(RenderBloc > fromBlock->moveChildrenTo(toBlock, currChildNextSibling, 0, true); > } > >-void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox, >- RenderObject* newChild, RenderBoxModelObject* oldCont) >+void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild) > { >- RenderBlock* pre = 0; >- RenderBlock* block = containingColumnsBlock(); >- >- // Delete our line boxes before we do the inline split into continuations. >- block->deleteLines(); >- >- bool madeNewBeforeBlock = false; >- if (block->isAnonymousColumnsBlock()) { >- // We can reuse this block and make it the preBlock of the next continuation. >- pre = block; >- pre->removePositionedObjects(0); >- // FIXME-BLOCKFLOW remove this when splitFlow is moved to RenderBlockFlow. >- if (pre->isRenderBlockFlow()) >- toRenderBlockFlow(pre)->removeFloatingObjects(); >- block = toRenderBlock(block->parent()); >- } else { >- // No anonymous block available for use. Make one. >- pre = block->createAnonymousColumnsBlock(); >- pre->setChildrenInline(false); >- madeNewBeforeBlock = true; >- } >- >- RenderBlock* post = block->createAnonymousColumnsBlock(); >- post->setChildrenInline(false); >- >- RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling(); >- if (madeNewBeforeBlock) >- block->insertChildInternal(pre, boxFirst, NotifyChildren); >- block->insertChildInternal(newBlockBox, boxFirst, NotifyChildren); >- block->insertChildInternal(post, boxFirst, NotifyChildren); >- block->setChildrenInline(false); >- >- if (madeNewBeforeBlock) >- block->moveChildrenTo(pre, boxFirst, 0, true); >- >- splitBlocks(pre, post, newBlockBox, beforeChild, oldCont); >- >- // We already know the newBlockBox isn't going to contain inline kids, so avoid wasting >- // time in makeChildrenNonInline by just setting this explicitly up front. >- newBlockBox->setChildrenInline(false); >- >- // We delayed adding the newChild until now so that the |newBlockBox| would be fully >- // connected, thus allowing newChild access to a renderArena should it need >- // to wrap itself in additional boxes (e.g., table construction). >- newBlockBox->addChild(newChild); >- >- // Always just do a full layout in order to ensure that line boxes (especially wrappers for images) >- // get deleted properly. Because objects moves from the pre block into the post block, we want to >- // make new line boxes instead of leaving the old line boxes around. >- pre->setNeedsLayoutAndPrefWidthsRecalc(); >- block->setNeedsLayoutAndPrefWidthsRecalc(); >- post->setNeedsLayoutAndPrefWidthsRecalc(); >-} >- >-void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild) >-{ >- RenderBlock* pre = 0; >- RenderBlock* post = 0; >- RenderBlock* block = this; // Eventually block will not just be |this|, but will also be a block nested inside |this|. Assign to a variable >- // so that we don't have to patch all of the rest of the code later on. >- >- // Delete the block's line boxes before we do the split. >- block->deleteLines(); >- >- if (beforeChild && beforeChild->parent() != this) >- beforeChild = splitAnonymousBoxesAroundChild(beforeChild); >- >- if (beforeChild != firstChild()) { >- pre = block->createAnonymousColumnsBlock(); >- pre->setChildrenInline(block->childrenInline()); >- } >- >- if (beforeChild) { >- post = block->createAnonymousColumnsBlock(); >- post->setChildrenInline(block->childrenInline()); >- } >- >- RenderObject* boxFirst = block->firstChild(); >- if (pre) >- block->insertChildInternal(pre, boxFirst, NotifyChildren); >- block->insertChildInternal(newBlockBox, boxFirst, NotifyChildren); >- if (post) >- block->insertChildInternal(post, boxFirst, NotifyChildren); >- block->setChildrenInline(false); >- >- // The pre/post blocks always have layers, so we know to always do a full insert/remove (so we pass true as the last argument). >- block->moveChildrenTo(pre, boxFirst, beforeChild, true); >- block->moveChildrenTo(post, beforeChild, 0, true); >- >- // We already know the newBlockBox isn't going to contain inline kids, so avoid wasting >- // time in makeChildrenNonInline by just setting this explicitly up front. >- newBlockBox->setChildrenInline(false); >- >- // We delayed adding the newChild until now so that the |newBlockBox| would be fully >- // connected, thus allowing newChild access to a renderArena should it need >- // to wrap itself in additional boxes (e.g., table construction). >- newBlockBox->addChild(newChild); >- >- // Always just do a full layout in order to ensure that line boxes (especially wrappers for images) >- // get deleted properly. Because objects moved from the pre block into the post block, we want to >- // make new line boxes instead of leaving the old line boxes around. >- if (pre) >- pre->setNeedsLayoutAndPrefWidthsRecalc(); >- block->setNeedsLayoutAndPrefWidthsRecalc(); >- if (post) >- post->setNeedsLayoutAndPrefWidthsRecalc(); >-} >- >-RenderBlock* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild) >-{ >- // FIXME: This function is the gateway for the addition of column-span support. It will >- // be added to in three stages: >- // (1) Immediate children of a multi-column block can span. >- // (2) Nested block-level children with only block-level ancestors between them and the multi-column block can span. >- // (3) Nested children with block or inline ancestors between them and the multi-column block can span (this is when we >- // cross the streams and have to cope with both types of continuations mixed together). >- // This function currently supports (1) and (2). >- RenderBlock* columnsBlockAncestor = 0; >- if (!newChild->isText() && newChild->style().columnSpan() && !newChild->isBeforeOrAfterContent() >- && !newChild->isFloatingOrOutOfFlowPositioned() && !newChild->isInline() && !isAnonymousColumnSpanBlock()) { >- columnsBlockAncestor = containingColumnsBlock(false); >- if (columnsBlockAncestor) { >- // Make sure that none of the parent ancestors have a continuation. >- // If yes, we do not want split the block into continuations. >- RenderElement* curr = this; >- while (curr && curr != columnsBlockAncestor) { >- if (curr->isRenderBlock() && toRenderBlock(curr)->continuation()) { >- columnsBlockAncestor = 0; >- break; >- } >- curr = curr->parent(); >- } >- } >- } >- return columnsBlockAncestor; >+ if (continuation() && !isAnonymousBlock()) >+ addChildToContinuation(newChild, beforeChild); >+ else >+ addChildIgnoringContinuation(newChild, beforeChild); > } > >-void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild) >+void RenderBlock::addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild) > { > if (beforeChild && beforeChild->parent() != this) { > RenderElement* beforeChildContainer = beforeChild->parent(); >@@ -753,36 +520,6 @@ void RenderBlock::addChildIgnoringAnonym > } > } > >- // Check for a spanning element in columns. >- if (gColumnFlowSplitEnabled && !document().regionBasedColumnsEnabled()) { >- RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild); >- if (columnsBlockAncestor) { >- TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled, false); >- // We are placing a column-span element inside a block. >- RenderBlock* newBox = createAnonymousColumnSpanBlock(); >- >- if (columnsBlockAncestor != this && !isRenderFlowThread()) { >- // We are nested inside a multi-column element and are being split by the span. We have to break up >- // our block into continuations. >- RenderBoxModelObject* oldContinuation = continuation(); >- >- // When we split an anonymous block, there's no need to do any continuation hookup, >- // since we haven't actually split a real element. >- if (!isAnonymousBlock()) >- setContinuation(newBox); >- >- splitFlow(beforeChild, newBox, newChild, oldContinuation); >- return; >- } >- >- // We have to perform a split of this block's children. This involves creating an anonymous block box to hold >- // the column-spanning |newChild|. We take all of the children from before |newChild| and put them into >- // one anonymous columns block, and all of the children after |newChild| go into another anonymous block. >- makeChildrenAnonymousColumnBlocks(beforeChild, newBox, newChild); >- return; >- } >- } >- > bool madeBoxesNonInline = false; > > // A block has to either have all of its children inline, or all of its children as blocks. >@@ -827,22 +564,6 @@ void RenderBlock::addChildIgnoringAnonym > // this object may be dead here > } > >-void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild) >-{ >- if (continuation() && !isAnonymousBlock()) >- addChildToContinuation(newChild, beforeChild); >- else >- addChildIgnoringContinuation(newChild, beforeChild); >-} >- >-void RenderBlock::addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild) >-{ >- if (!isAnonymousBlock() && firstChild() && (firstChild()->isAnonymousColumnsBlock() || firstChild()->isAnonymousColumnSpanBlock())) >- addChildToAnonymousColumnBlocks(newChild, beforeChild); >- else >- addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild); >-} >- > static void getInlineRun(RenderObject* start, RenderObject* boundary, > RenderObject*& inlineRunStart, > RenderObject*& inlineRunEnd) >@@ -944,7 +665,7 @@ void RenderBlock::removeLeftoverAnonymou > ASSERT(child->isAnonymousBlock()); > ASSERT(!child->childrenInline()); > >- if (child->continuation() || (child->firstChild() && (child->isAnonymousColumnSpanBlock() || child->isAnonymousColumnsBlock()))) >+ if (child->continuation()) > return; > > RenderObject* firstAnChild = child->firstChild(); >@@ -1019,12 +740,7 @@ static bool canMergeContiguousAnonymousB > if (!canMergeAnonymousBlock(nextAnonymousBlock)) > return false; > } >- if (!previous || !next) >- return true; >- >- // Make sure the types of the anonymous blocks match up. >- return previous->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() >- && previous->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanBlock(); >+ return true; > } > > void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child) >@@ -1054,9 +770,6 @@ void RenderBlock::removeChild(RenderObje > return; > } > >- // This protects against column split flows when anonymous blocks are getting merged. >- TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled, false); >- > // If this child is a block, and if our previous and next siblings are > // both anonymous blocks with inline content, then we can go ahead and > // fold the inline content back together. >@@ -1315,18 +1028,16 @@ void RenderBlock::preparePaginationBefor > flowThread->logicalWidthChangedInRegionsForBlock(this, relayoutChildren); > } > >-bool RenderBlock::updateLogicalWidthAndColumnWidth() >+bool RenderBlock::recomputeLogicalWidth() > { > LayoutUnit oldWidth = logicalWidth(); >- LayoutUnit oldColumnWidth = computedColumnWidth(); >- >+ > updateLogicalWidth(); >- computeColumnCountAndWidth(); >- >+ > bool hasBorderOrPaddingLogicalWidthChanged = m_hasBorderOrPaddingLogicalWidthChanged; > m_hasBorderOrPaddingLogicalWidthChanged = false; > >- return oldWidth != logicalWidth() || oldColumnWidth != computedColumnWidth() || hasBorderOrPaddingLogicalWidthChanged; >+ return oldWidth != logicalWidth() || hasBorderOrPaddingLogicalWidthChanged; > } > > void RenderBlock::layoutBlock(bool, LayoutUnit) >@@ -1337,25 +1048,15 @@ void RenderBlock::layoutBlock(bool, Layo > > void RenderBlock::addOverflowFromChildren() > { >- if (!hasColumns()) { >- if (childrenInline()) >- addOverflowFromInlineChildren(); >- else >- addOverflowFromBlockChildren(); >- >- // If this block is flowed inside a flow thread, make sure its overflow is propagated to the containing regions. >- if (m_overflow) { >- if (RenderFlowThread* containingFlowThread = flowThreadContainingBlock()) >- containingFlowThread->addRegionsVisualOverflow(this, m_overflow->visualOverflowRect()); >- } >- } else { >- ColumnInfo* colInfo = columnInfo(); >- if (columnCount(colInfo)) { >- LayoutRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); >- addLayoutOverflow(lastRect); >- if (!hasOverflowClip()) >- addVisualOverflow(lastRect); >- } >+ if (childrenInline()) >+ addOverflowFromInlineChildren(); >+ else >+ addOverflowFromBlockChildren(); >+ >+ // If this block is flowed inside a flow thread, make sure its overflow is propagated to the containing regions. >+ if (m_overflow) { >+ if (RenderFlowThread* containingFlowThread = flowThreadContainingBlock()) >+ containingFlowThread->addRegionsVisualOverflow(this, m_overflow->visualOverflowRect()); > } > } > >@@ -1445,34 +1146,10 @@ void RenderBlock::addVisualOverflowFromT > flowThread->addRegionsVisualOverflowFromTheme(this); > } > >-bool RenderBlock::isTopLayoutOverflowAllowed() const >-{ >- bool hasTopOverflow = RenderBox::isTopLayoutOverflowAllowed(); >- if (!hasColumns() || style().columnProgression() == NormalColumnProgression) >- return hasTopOverflow; >- >- if (!(isHorizontalWritingMode() ^ !style().hasInlineColumnAxis())) >- hasTopOverflow = !hasTopOverflow; >- >- return hasTopOverflow; >-} >- >-bool RenderBlock::isLeftLayoutOverflowAllowed() const >-{ >- bool hasLeftOverflow = RenderBox::isLeftLayoutOverflowAllowed(); >- if (!hasColumns() || style().columnProgression() == NormalColumnProgression) >- return hasLeftOverflow; >- >- if (isHorizontalWritingMode() ^ !style().hasInlineColumnAxis()) >- hasLeftOverflow = !hasLeftOverflow; >- >- return hasLeftOverflow; >-} >- > bool RenderBlock::expandsToEncloseOverhangingFloats() const > { > return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || (parent() && parent()->isFlexibleBoxIncludingDeprecated()) >- || hasColumns() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isRoot() || isRenderFlowThread(); >+ || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isRoot() || isRenderFlowThread(); > } > > LayoutUnit RenderBlock::computeStartPositionDeltaForChildAvoidingFloats(const RenderBox& child, LayoutUnit childMarginStart, RenderRegion* region) >@@ -1602,7 +1279,7 @@ bool RenderBlock::simplifiedLayout() > if ((!posChildNeedsLayout() && !needsSimplifiedNormalFlowLayout()) || normalChildNeedsLayout() || selfNeedsLayout()) > return false; > >- LayoutStateMaintainer statePusher(view(), *this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode()); >+ LayoutStateMaintainer statePusher(view(), *this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode()); > > if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovementOnly()) > return false; >@@ -1696,9 +1373,6 @@ void RenderBlock::layoutPositionedObject > TrackedRendererListHashSet* positionedDescendants = positionedObjects(); > if (!positionedDescendants) > return; >- >- if (hasColumns()) >- view().layoutState()->clearPaginationInformation(); // Positioned objects are not part of the column flow, so they don't paginate with the columns. > > for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) { > RenderBox& r = **it; >@@ -1758,9 +1432,6 @@ void RenderBlock::layoutPositionedObject > r.layoutIfNeeded(); > } > } >- >- if (hasColumns()) >- view().layoutState()->m_columnInfo = columnInfo(); // FIXME: Kind of gross. We just put this back into the layout state so that pop() will work. > } > > void RenderBlock::markPositionedObjectsForLayout() >@@ -1824,173 +1495,6 @@ void RenderBlock::paint(PaintInfo& paint > layer()->paintOverflowControls(paintInfo.context, roundedIntPoint(adjustedPaintOffset), pixelSnappedIntRect(paintInfo.rect)); > } > >-void RenderBlock::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& paintOffset) >-{ >- if (!hasColumns() || paintInfo.context->paintingDisabled()) >- return; >- >- const Color& ruleColor = style().visitedDependentColor(CSSPropertyWebkitColumnRuleColor); >- bool ruleTransparent = style().columnRuleIsTransparent(); >- EBorderStyle ruleStyle = style().columnRuleStyle(); >- LayoutUnit ruleThickness = style().columnRuleWidth(); >- LayoutUnit colGap = columnGap(); >- bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent; >- if (!renderRule) >- return; >- >- ColumnInfo* colInfo = columnInfo(); >- unsigned colCount = columnCount(colInfo); >- >- bool antialias = shouldAntialiasLines(paintInfo.context); >- >- if (colInfo->progressionIsInline()) { >- bool leftToRight = style().isLeftToRightDirection() ^ colInfo->progressionIsReversed(); >- LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : contentLogicalWidth(); >- LayoutUnit ruleAdd = logicalLeftOffsetForContent(); >- LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : contentLogicalWidth(); >- LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth(); >- BoxSide boxSide = isHorizontalWritingMode() >- ? leftToRight ? BSLeft : BSRight >- : leftToRight ? BSTop : BSBottom; >- >- for (unsigned i = 0; i < colCount; i++) { >- // Move to the next position. >- if (leftToRight) { >- ruleLogicalLeft += inlineDirectionSize + colGap / 2; >- currLogicalLeftOffset += inlineDirectionSize + colGap; >- } else { >- ruleLogicalLeft -= (inlineDirectionSize + colGap / 2); >- currLogicalLeftOffset -= (inlineDirectionSize + colGap); >- } >- >- // Now paint the column rule. >- if (i < colCount - 1) { >- LayoutUnit ruleLeft = isHorizontalWritingMode() ? paintOffset.x() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd : paintOffset.x() + borderLeft() + paddingLeft(); >- LayoutUnit ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleThickness : ruleLeft + contentWidth(); >- LayoutUnit ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd; >- LayoutUnit ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleThickness; >- IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft, ruleTop, ruleRight, ruleBottom); >- drawLineForBoxSide(paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); >- } >- >- ruleLogicalLeft = currLogicalLeftOffset; >- } >- } else { >- bool topToBottom = !style().isFlippedBlocksWritingMode() ^ colInfo->progressionIsReversed(); >- LayoutUnit ruleLeft = isHorizontalWritingMode() >- ? borderLeft() + paddingLeft() >- : colGap / 2 - colGap - ruleThickness / 2 + (!colInfo->progressionIsReversed() ? borderAndPaddingBefore() : borderAndPaddingAfter()); >- LayoutUnit ruleWidth = isHorizontalWritingMode() ? contentWidth() : ruleThickness; >- LayoutUnit ruleTop = isHorizontalWritingMode() >- ? colGap / 2 - colGap - ruleThickness / 2 + (!colInfo->progressionIsReversed() ? borderAndPaddingBefore() : borderAndPaddingAfter()) >- : borderStart() + paddingStart(); >- LayoutUnit ruleHeight = isHorizontalWritingMode() ? ruleThickness : contentHeight(); >- LayoutRect ruleRect(ruleLeft, ruleTop, ruleWidth, ruleHeight); >- >- if (!topToBottom) { >- if (isHorizontalWritingMode()) >- ruleRect.setY(height() - ruleRect.maxY()); >- else >- ruleRect.setX(width() - ruleRect.maxX()); >- } >- >- ruleRect.moveBy(paintOffset); >- >- BoxSide boxSide = isHorizontalWritingMode() >- ? topToBottom ? BSTop : BSBottom >- : topToBottom ? BSLeft : BSRight; >- >- LayoutSize step(0, topToBottom ? colInfo->columnHeight() + colGap : -(colInfo->columnHeight() + colGap)); >- if (!isHorizontalWritingMode()) >- step = step.transposedSize(); >- >- for (unsigned i = 1; i < colCount; i++) { >- ruleRect.move(step); >- IntRect pixelSnappedRuleRect = pixelSnappedIntRect(ruleRect); >- drawLineForBoxSide(paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); >- } >- } >-} >- >-LayoutUnit RenderBlock::initialBlockOffsetForPainting() const >-{ >- ColumnInfo* colInfo = columnInfo(); >- LayoutUnit result = 0; >- if (!colInfo->progressionIsInline() && colInfo->progressionIsReversed()) { >- LayoutRect colRect = columnRectAt(colInfo, 0); >- result = isHorizontalWritingMode() ? colRect.y() : colRect.x(); >- result -= borderAndPaddingBefore(); >- if (style().isFlippedBlocksWritingMode()) >- result = -result; >- } >- return result; >-} >- >-LayoutUnit RenderBlock::blockDeltaForPaintingNextColumn() const >-{ >- ColumnInfo* colInfo = columnInfo(); >- LayoutUnit blockDelta = -colInfo->columnHeight(); >- LayoutUnit colGap = columnGap(); >- if (!colInfo->progressionIsInline()) { >- if (!colInfo->progressionIsReversed()) >- blockDelta = colGap; >- else >- blockDelta -= (colInfo->columnHeight() + colGap); >- } >- if (style().isFlippedBlocksWritingMode()) >- blockDelta = -blockDelta; >- return blockDelta; >-} >- >-void RenderBlock::paintColumnContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset, bool paintingFloats) >-{ >- // We need to do multiple passes, breaking up our child painting into strips. >- GraphicsContext* context = paintInfo.context; >- ColumnInfo* colInfo = columnInfo(); >- unsigned colCount = columnCount(colInfo); >- if (!colCount) >- return; >- LayoutUnit colGap = columnGap(); >- LayoutUnit currLogicalTopOffset = initialBlockOffsetForPainting(); >- LayoutUnit blockDelta = blockDeltaForPaintingNextColumn(); >- for (unsigned i = 0; i < colCount; i++) { >- // For each rect, we clip to the rect, and then we adjust our coords. >- LayoutRect colRect = columnRectAt(colInfo, i); >- flipForWritingMode(colRect); >- >- LayoutUnit logicalLeftOffset = (isHorizontalWritingMode() ? colRect.x() : colRect.y()) - logicalLeftOffsetForContent(); >- LayoutSize offset = isHorizontalWritingMode() ? LayoutSize(logicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, logicalLeftOffset); >- colRect.moveBy(paintOffset); >- PaintInfo info(paintInfo); >- info.rect.intersect(pixelSnappedIntRect(colRect)); >- >- if (!info.rect.isEmpty()) { >- GraphicsContextStateSaver stateSaver(*context); >- LayoutRect clipRect(colRect); >- >- if (i < colCount - 1) { >- if (isHorizontalWritingMode()) >- clipRect.expand(colGap / 2, 0); >- else >- clipRect.expand(0, colGap / 2); >- } >- // Each strip pushes a clip, since column boxes are specified as being >- // like overflow:hidden. >- // FIXME: Content and column rules that extend outside column boxes at the edges of the multi-column element >- // are clipped according to the 'overflow' property. >- context->clip(pixelSnappedIntRect(clipRect)); >- >- // Adjust our x and y when painting. >- LayoutPoint adjustedPaintOffset = paintOffset + offset; >- if (paintingFloats) >- paintFloats(info, adjustedPaintOffset, paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip); >- else >- paintContents(info, adjustedPaintOffset); >- } >- currLogicalTopOffset += blockDelta; >- } >-} >- > void RenderBlock::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { > // Avoid painting descendants of the root element when stylesheets haven't loaded. This eliminates FOUC. >@@ -2139,26 +1643,18 @@ void RenderBlock::paintObject(PaintInfo& > return; > > // 2. paint contents >- if (paintPhase != PaintPhaseSelfOutline) { >- if (hasColumns()) >- paintColumnContents(paintInfo, scrolledOffset); >- else >- paintContents(paintInfo, scrolledOffset); >- } >+ if (paintPhase != PaintPhaseSelfOutline) >+ paintContents(paintInfo, scrolledOffset); > > // 3. paint selection > // FIXME: Make this work with multi column layouts. For now don't fill gaps. > bool isPrinting = document().printing(); >- if (!isPrinting && !hasColumns()) >+ if (!isPrinting) > paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks. > > // 4. paint floats. >- if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) { >- if (hasColumns()) >- paintColumnContents(paintInfo, scrolledOffset, true); >- else >- paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip); >- } >+ if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) >+ paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip); > > // 5. paint outline. > if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style().visibility() == VISIBLE) >@@ -2413,7 +1909,7 @@ GapRects RenderBlock::selectionGaps(Rend > if (!isRenderBlockFlow()) // FIXME: Make multi-column selection gap filling work someday. > return result; > >- if (hasColumns() || hasTransform() || style().columnSpan() == ColumnSpanAll || isInFlowRenderFlowThread()) { >+ if (hasTransform() || style().columnSpan() == ColumnSpanAll || isInFlowRenderFlowThread()) { > // FIXME: We should learn how to gap fill multiple columns and transforms eventually. > lastLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + logicalHeight(); > lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, logicalHeight(), cache); >@@ -2994,18 +2490,12 @@ bool RenderBlock::nodeAtPoint(const HitT > // Hit test descendants first. > LayoutSize scrolledOffset(localOffset - scrolledContentOffset()); > >- // Hit test contents if we don't have columns. >- if (!hasColumns()) { >- if (hitTestContents(request, result, locationInContainer, toLayoutPoint(scrolledOffset), hitTestAction)) { >- updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - localOffset)); >- return true; >- } >- if (hitTestAction == HitTestFloat && hitTestFloats(request, result, locationInContainer, toLayoutPoint(scrolledOffset))) >- return true; >- } else if (hitTestColumns(request, result, locationInContainer, toLayoutPoint(scrolledOffset), hitTestAction)) { >+ if (hitTestContents(request, result, locationInContainer, toLayoutPoint(scrolledOffset), hitTestAction)) { > updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - localOffset)); > return true; > } >+ if (hitTestAction == HitTestFloat && hitTestFloats(request, result, locationInContainer, toLayoutPoint(scrolledOffset))) >+ return true; > } > > // Check if the point is outside radii. >@@ -3030,98 +2520,6 @@ bool RenderBlock::nodeAtPoint(const HitT > return false; > } > >-class ColumnRectIterator { >- WTF_MAKE_NONCOPYABLE(ColumnRectIterator); >-public: >- ColumnRectIterator(const RenderBlock& block) >- : m_block(block) >- , m_colInfo(block.columnInfo()) >- , m_direction(m_block.style().isFlippedBlocksWritingMode() ? 1 : -1) >- , m_isHorizontal(block.isHorizontalWritingMode()) >- , m_logicalLeft(block.logicalLeftOffsetForContent()) >- { >- int colCount = m_colInfo->columnCount(); >- m_colIndex = colCount - 1; >- >- m_currLogicalTopOffset = m_block.initialBlockOffsetForPainting(); >- m_currLogicalTopOffset = colCount * m_block.blockDeltaForPaintingNextColumn(); >- >- update(); >- } >- >- void advance() >- { >- ASSERT(hasMore()); >- m_colIndex--; >- update(); >- } >- >- LayoutRect columnRect() const { return m_colRect; } >- bool hasMore() const { return m_colIndex >= 0; } >- >- void adjust(LayoutSize& offset) const >- { >- LayoutUnit currLogicalLeftOffset = (m_isHorizontal ? m_colRect.x() : m_colRect.y()) - m_logicalLeft; >- offset += m_isHorizontal ? LayoutSize(currLogicalLeftOffset, m_currLogicalTopOffset) : LayoutSize(m_currLogicalTopOffset, currLogicalLeftOffset); >- } >- >-private: >- void update() >- { >- if (m_colIndex < 0) >- return; >- m_colRect = m_block.columnRectAt(const_cast<ColumnInfo*>(m_colInfo), m_colIndex); >- m_block.flipForWritingMode(m_colRect); >- m_currLogicalTopOffset -= m_block.blockDeltaForPaintingNextColumn(); >- } >- >- const RenderBlock& m_block; >- const ColumnInfo* const m_colInfo; >- const int m_direction; >- const bool m_isHorizontal; >- const LayoutUnit m_logicalLeft; >- int m_colIndex; >- LayoutUnit m_currLogicalTopOffset; >- LayoutRect m_colRect; >-}; >- >-bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) >-{ >- // We need to do multiple passes, breaking up our hit testing into strips. >- if (!hasColumns()) >- return false; >- >- for (ColumnRectIterator it(*this); it.hasMore(); it.advance()) { >- LayoutRect hitRect = locationInContainer.boundingBox(); >- LayoutRect colRect = it.columnRect(); >- colRect.moveBy(accumulatedOffset); >- if (locationInContainer.intersects(colRect)) { >- // The point is inside this column. >- // Adjust accumulatedOffset to change where we hit test. >- LayoutSize offset; >- it.adjust(offset); >- LayoutPoint finalLocation = accumulatedOffset + offset; >- if (!result.isRectBasedTest() || colRect.contains(hitRect)) >- return hitTestContents(request, result, locationInContainer, finalLocation, hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, locationInContainer, finalLocation)); >- >- hitTestContents(request, result, locationInContainer, finalLocation, hitTestAction); >- } >- } >- >- return false; >-} >- >-void RenderBlock::adjustForColumnRect(LayoutSize& offset, const LayoutPoint& locationInContainer) const >-{ >- for (ColumnRectIterator it(*this); it.hasMore(); it.advance()) { >- LayoutRect colRect = it.columnRect(); >- if (colRect.contains(locationInContainer)) { >- it.adjust(offset); >- return; >- } >- } >-} >- > bool RenderBlock::hitTestContents(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) > { > if (childrenInline() && !isTable()) >@@ -3272,418 +2670,17 @@ void RenderBlock::offsetForContents(Layo > { > offset = flipForWritingMode(offset); > offset += scrolledContentOffset(); >- >- if (hasColumns()) >- adjustPointToColumnContents(offset); >- > offset = flipForWritingMode(offset); > } > >-LayoutUnit RenderBlock::availableLogicalWidth() const >-{ >- // If we have multiple columns, then the available logical width is reduced to our column width. >- if (hasColumns()) >- return computedColumnWidth(); >- return RenderBox::availableLogicalWidth(); >-} >- >-int RenderBlock::columnGap() const >-{ >- if (style().hasNormalColumnGap()) >- return style().fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins. >- return static_cast<int>(style().columnGap()); >-} >- >-void RenderBlock::computeColumnCountAndWidth() >-{ >- // Calculate our column width and column count. >- // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744 >- unsigned desiredColumnCount = 1; >- LayoutUnit desiredColumnWidth = contentLogicalWidth(); >- >- // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination. >- if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) { >- setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth); >- return; >- } >- >- LayoutUnit availWidth = desiredColumnWidth; >- LayoutUnit colGap = columnGap(); >- LayoutUnit colWidth = std::max<LayoutUnit>(LayoutUnit::fromPixel(1), LayoutUnit(style().columnWidth())); >- int colCount = std::max<int>(1, style().columnCount()); >- >- if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) { >- desiredColumnCount = colCount; >- desiredColumnWidth = std::max<LayoutUnit>(0, (availWidth - ((desiredColumnCount - 1) * colGap)) / desiredColumnCount); >- } else if (!style().hasAutoColumnWidth() && style().hasAutoColumnCount()) { >- desiredColumnCount = std::max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap)); >- desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap; >- } else { >- desiredColumnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1); >- desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap; >- } >- setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth); >-} >- >-bool RenderBlock::requiresColumns(int desiredColumnCount) const >-{ >- // If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating >- // in the RenderView instead. >- bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isRoot() || isBody()); >- >- return firstChild() >- && (desiredColumnCount != 1 || !style().hasAutoColumnWidth() || !style().hasInlineColumnAxis() || isPaginated) >- && !firstChild()->isAnonymousColumnsBlock() >- && !firstChild()->isAnonymousColumnSpanBlock(); >-} >- >-void RenderBlock::setComputedColumnCountAndWidth(int count, LayoutUnit width) >-{ >- bool destroyColumns = !requiresColumns(count); >- if (destroyColumns) { >- if (hasColumns()) { >- gColumnInfoMap->take(this); >- setHasColumns(false); >- } >- } else { >- ColumnInfo* info; >- if (hasColumns()) >- info = gColumnInfoMap->get(this); >- else { >- if (!gColumnInfoMap) >- gColumnInfoMap = new ColumnInfoMap; >- info = new ColumnInfo; >- gColumnInfoMap->add(this, std::unique_ptr<ColumnInfo>(info)); >- setHasColumns(true); >- } >- info->setDesiredColumnCount(count); >- info->setDesiredColumnWidth(width); >- info->setProgressionIsInline(style().hasInlineColumnAxis()); >- info->setProgressionIsReversed(style().columnProgression() == ReverseColumnProgression); >- } >-} >- >-void RenderBlock::updateColumnProgressionFromStyle(RenderStyle* style) >-{ >- if (!hasColumns()) >- return; >- >- ColumnInfo* info = gColumnInfoMap->get(this); >- >- bool needsLayout = false; >- bool oldProgressionIsInline = info->progressionIsInline(); >- bool newProgressionIsInline = style->hasInlineColumnAxis(); >- if (oldProgressionIsInline != newProgressionIsInline) { >- info->setProgressionIsInline(newProgressionIsInline); >- needsLayout = true; >- } >- >- bool oldProgressionIsReversed = info->progressionIsReversed(); >- bool newProgressionIsReversed = style->columnProgression() == ReverseColumnProgression; >- if (oldProgressionIsReversed != newProgressionIsReversed) { >- info->setProgressionIsReversed(newProgressionIsReversed); >- needsLayout = true; >- } >- >- if (needsLayout) >- setNeedsLayoutAndPrefWidthsRecalc(); >-} >- >-LayoutUnit RenderBlock::computedColumnWidth() const >-{ >- if (!hasColumns()) >- return contentLogicalWidth(); >- return gColumnInfoMap->get(this)->desiredColumnWidth(); >-} >- >-unsigned RenderBlock::computedColumnCount() const >-{ >- if (!hasColumns()) >- return 1; >- return gColumnInfoMap->get(this)->desiredColumnCount(); >-} >- >-ColumnInfo* RenderBlock::columnInfo() const >-{ >- if (!hasColumns()) >- return 0; >- return gColumnInfoMap->get(this); >-} >- >-unsigned RenderBlock::columnCount(ColumnInfo* colInfo) const >-{ >- ASSERT(hasColumns()); >- ASSERT(gColumnInfoMap->get(this) == colInfo); >- return colInfo->columnCount(); >-} >- >-LayoutRect RenderBlock::columnRectAt(ColumnInfo* colInfo, unsigned index) const >-{ >- ASSERT(hasColumns() && gColumnInfoMap->get(this) == colInfo); >- >- // Compute the appropriate rect based off our information. >- LayoutUnit colLogicalWidth = colInfo->desiredColumnWidth(); >- LayoutUnit colLogicalHeight = colInfo->columnHeight(); >- LayoutUnit colLogicalTop = borderAndPaddingBefore(); >- LayoutUnit colLogicalLeft = logicalLeftOffsetForContent(); >- LayoutUnit colGap = columnGap(); >- if (colInfo->progressionIsInline()) { >- if (style().isLeftToRightDirection() ^ colInfo->progressionIsReversed()) >- colLogicalLeft += index * (colLogicalWidth + colGap); >- else >- colLogicalLeft += contentLogicalWidth() - colLogicalWidth - index * (colLogicalWidth + colGap); >- } else { >- if (!colInfo->progressionIsReversed()) >- colLogicalTop += index * (colLogicalHeight + colGap); >- else >- colLogicalTop += contentLogicalHeight() - colLogicalHeight - index * (colLogicalHeight + colGap); >- } >- >- if (isHorizontalWritingMode()) >- return LayoutRect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight); >- return LayoutRect(colLogicalTop, colLogicalLeft, colLogicalHeight, colLogicalWidth); >-} >- >-void RenderBlock::adjustPointToColumnContents(LayoutPoint& point) const >-{ >- // Just bail if we have no columns. >- if (!hasColumns()) >- return; >- >- ColumnInfo* colInfo = columnInfo(); >- if (!columnCount(colInfo)) >- return; >- >- // Determine which columns we intersect. >- LayoutUnit colGap = columnGap(); >- LayoutUnit halfColGap = colGap / 2; >- LayoutPoint columnPoint(columnRectAt(colInfo, 0).location()); >- LayoutUnit logicalOffset = 0; >- for (unsigned i = 0; i < colInfo->columnCount(); i++) { >- // Add in half the column gap to the left and right of the rect. >- LayoutRect colRect = columnRectAt(colInfo, i); >- flipForWritingMode(colRect); >- if (isHorizontalWritingMode() == colInfo->progressionIsInline()) { >- LayoutRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height()); >- if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.maxX()) { >- if (colInfo->progressionIsInline()) { >- // FIXME: The clamping that follows is not completely right for right-to-left >- // content. >- // Clamp everything above the column to its top left. >- if (point.y() < gapAndColumnRect.y()) >- point = gapAndColumnRect.location(); >- // Clamp everything below the column to the next column's top left. If there is >- // no next column, this still maps to just after this column. >- else if (point.y() >= gapAndColumnRect.maxY()) { >- point = gapAndColumnRect.location(); >- point.move(0, gapAndColumnRect.height()); >- } >- } else { >- if (point.x() < colRect.x()) >- point.setX(colRect.x()); >- else if (point.x() >= colRect.maxX()) >- point.setX(colRect.maxX() - 1); >- } >- >- // We're inside the column. Translate the x and y into our column coordinate space. >- if (colInfo->progressionIsInline()) >- point.move(columnPoint.x() - colRect.x(), (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset)); >- else >- point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.x() + borderLeft() + paddingLeft(), 0); >- return; >- } >- >- // Move to the next position. >- logicalOffset += colInfo->progressionIsInline() ? colRect.height() : colRect.width(); >- } else { >- LayoutRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap); >- if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.maxY()) { >- if (colInfo->progressionIsInline()) { >- // FIXME: The clamping that follows is not completely right for right-to-left >- // content. >- // Clamp everything above the column to its top left. >- if (point.x() < gapAndColumnRect.x()) >- point = gapAndColumnRect.location(); >- // Clamp everything below the column to the next column's top left. If there is >- // no next column, this still maps to just after this column. >- else if (point.x() >= gapAndColumnRect.maxX()) { >- point = gapAndColumnRect.location(); >- point.move(gapAndColumnRect.width(), 0); >- } >- } else { >- if (point.y() < colRect.y()) >- point.setY(colRect.y()); >- else if (point.y() >= colRect.maxY()) >- point.setY(colRect.maxY() - 1); >- } >- >- // We're inside the column. Translate the x and y into our column coordinate space. >- if (colInfo->progressionIsInline()) >- point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset), columnPoint.y() - colRect.y()); >- else >- point.move(0, (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.y() + borderTop() + paddingTop()); >- return; >- } >- >- // Move to the next position. >- logicalOffset += colInfo->progressionIsInline() ? colRect.width() : colRect.height(); >- } >- } >-} >- >-void RenderBlock::adjustRectForColumns(LayoutRect& r) const >-{ >- // Just bail if we have no columns. >- if (!hasColumns()) >- return; >- >- ColumnInfo* colInfo = columnInfo(); >- >- // Determine which columns we intersect. >- unsigned colCount = columnCount(colInfo); >- if (!colCount) >- return; >- >- // Begin with a result rect that is empty. >- LayoutRect result; >- >- bool isHorizontal = isHorizontalWritingMode(); >- LayoutUnit beforeBorderPadding = borderAndPaddingBefore(); >- LayoutUnit colHeight = colInfo->columnHeight(); >- if (!colHeight) >- return; >- >- LayoutUnit startOffset = std::max(isHorizontal ? r.y() : r.x(), beforeBorderPadding); >- LayoutUnit endOffset = std::max(std::min<LayoutUnit>(isHorizontal ? r.maxY() : r.maxX(), beforeBorderPadding + colCount * colHeight), beforeBorderPadding); >- >- // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744 >- unsigned startColumn = (startOffset - beforeBorderPadding) / colHeight; >- unsigned endColumn = (endOffset - beforeBorderPadding) / colHeight; >- >- if (startColumn == endColumn) { >- // The rect is fully contained within one column. Adjust for our offsets >- // and repaint only that portion. >- LayoutUnit logicalLeftOffset = logicalLeftOffsetForContent(); >- LayoutRect colRect = columnRectAt(colInfo, startColumn); >- LayoutRect repaintRect = r; >- >- if (colInfo->progressionIsInline()) { >- if (isHorizontal) >- repaintRect.move(colRect.x() - logicalLeftOffset, - static_cast<int>(startColumn) * colHeight); >- else >- repaintRect.move(- static_cast<int>(startColumn) * colHeight, colRect.y() - logicalLeftOffset); >- } else { >- if (isHorizontal) >- repaintRect.move(0, colRect.y() - startColumn * colHeight - beforeBorderPadding); >- else >- repaintRect.move(colRect.x() - startColumn * colHeight - beforeBorderPadding, 0); >- } >- repaintRect.intersect(colRect); >- result.unite(repaintRect); >- } else { >- // We span multiple columns. We can just unite the start and end column to get the final >- // repaint rect. >- result.unite(columnRectAt(colInfo, startColumn)); >- result.unite(columnRectAt(colInfo, endColumn)); >- } >- >- r = result; >-} >- >-LayoutPoint RenderBlock::flipForWritingModeIncludingColumns(const LayoutPoint& point) const >-{ >- ASSERT(hasColumns()); >- if (!hasColumns() || !style().isFlippedBlocksWritingMode()) >- return point; >- ColumnInfo* colInfo = columnInfo(); >- LayoutUnit columnLogicalHeight = colInfo->columnHeight(); >- LayoutUnit expandedLogicalHeight = borderAndPaddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAndPaddingAfter() + scrollbarLogicalHeight(); >- if (isHorizontalWritingMode()) >- return LayoutPoint(point.x(), expandedLogicalHeight - point.y()); >- return LayoutPoint(expandedLogicalHeight - point.x(), point.y()); >-} >- >-void RenderBlock::adjustStartEdgeForWritingModeIncludingColumns(LayoutRect& rect) const >-{ >- ASSERT(hasColumns()); >- if (!hasColumns() || !style().isFlippedBlocksWritingMode()) >- return; >- >- ColumnInfo* colInfo = columnInfo(); >- LayoutUnit columnLogicalHeight = colInfo->columnHeight(); >- LayoutUnit expandedLogicalHeight = borderAndPaddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAndPaddingAfter() + scrollbarLogicalHeight(); >- >- if (isHorizontalWritingMode()) >- rect.setY(expandedLogicalHeight - rect.maxY()); >- else >- rect.setX(expandedLogicalHeight - rect.maxX()); >-} >- >-void RenderBlock::adjustForColumns(LayoutSize& offset, const LayoutPoint& point) const >-{ >- if (!hasColumns()) >- return; >- >- ColumnInfo* colInfo = columnInfo(); >- >- LayoutUnit logicalLeft = logicalLeftOffsetForContent(); >- unsigned colCount = columnCount(colInfo); >- LayoutUnit colLogicalWidth = colInfo->desiredColumnWidth(); >- LayoutUnit colLogicalHeight = colInfo->columnHeight(); >- >- for (unsigned i = 0; i < colCount; ++i) { >- // Compute the edges for a given column in the block progression direction. >- LayoutRect sliceRect = LayoutRect(logicalLeft, borderAndPaddingBefore() + i * colLogicalHeight, colLogicalWidth, colLogicalHeight); >- if (!isHorizontalWritingMode()) >- sliceRect = sliceRect.transposedRect(); >- >- LayoutUnit logicalOffset = i * colLogicalHeight; >- >- // Now we're in the same coordinate space as the point. See if it is inside the rectangle. >- if (isHorizontalWritingMode()) { >- if (point.y() >= sliceRect.y() && point.y() < sliceRect.maxY()) { >- if (colInfo->progressionIsInline()) >- offset.expand(columnRectAt(colInfo, i).x() - logicalLeft, -logicalOffset); >- else >- offset.expand(0, columnRectAt(colInfo, i).y() - logicalOffset - borderAndPaddingBefore()); >- return; >- } >- } else { >- if (point.x() >= sliceRect.x() && point.x() < sliceRect.maxX()) { >- if (colInfo->progressionIsInline()) >- offset.expand(-logicalOffset, columnRectAt(colInfo, i).y() - logicalLeft); >- else >- offset.expand(columnRectAt(colInfo, i).x() - logicalOffset - borderAndPaddingBefore(), 0); >- return; >- } >- } >- } >-} >- > void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >- if (childrenInline()) { >- // FIXME: Remove this const_cast. >- const_cast<RenderBlock*>(this)->computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >- } else >- computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ ASSERT(!childrenInline()); >+ >+ computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); > > maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); > >- adjustIntrinsicLogicalWidthsForColumns(minLogicalWidth, maxLogicalWidth); >- >- if (!style().autoWrap() && childrenInline()) { >- // A horizontal marquee with inline children has no minimum width. >- if (layer() && layer()->marquee() && layer()->marquee()->isHorizontal()) >- minLogicalWidth = 0; >- } >- >- if (isTableCell()) { >- Length tableCellWidth = toRenderTableCell(this)->styleOrColLogicalWidth(); >- if (tableCellWidth.isFixed() && tableCellWidth.value() > 0) >- maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth.value())); >- } >- > int scrollbarWidth = instrinsicScrollbarLogicalWidth(); > maxLogicalWidth += scrollbarWidth; > minLogicalWidth += scrollbarWidth; >@@ -3728,32 +2725,6 @@ void RenderBlock::computePreferredLogica > setPreferredLogicalWidthsDirty(false); > } > >-void RenderBlock::adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const >-{ >- // FIXME: Move this code to RenderBlockFlow. >- >- if (!style().hasAutoColumnCount() || !style().hasAutoColumnWidth()) { >- // The min/max intrinsic widths calculated really tell how much space elements need when >- // laid out inside the columns. In order to eventually end up with the desired column width, >- // we need to convert them to values pertaining to the multicol container. >- int columnCount = style().hasAutoColumnCount() ? 1 : style().columnCount(); >- LayoutUnit columnWidth; >- LayoutUnit gapExtra = (columnCount - 1) * columnGap(); >- if (style().hasAutoColumnWidth()) >- minLogicalWidth = minLogicalWidth * columnCount + gapExtra; >- else { >- columnWidth = style().columnWidth(); >- minLogicalWidth = std::min(minLogicalWidth, columnWidth); >- } >- // FIXME: If column-count is auto here, we should resolve it to calculate the maximum >- // intrinsic width, instead of pretending that it's 1. The only way to do that is by >- // performing a layout pass, but this is not an appropriate time or place for layout. The >- // good news is that if height is unconstrained and there are no explicit breaks, the >- // resolved column-count really should be 1. >- maxLogicalWidth = std::max(maxLogicalWidth, columnWidth) * columnCount + gapExtra; >- } >-} >- > struct InlineMinMaxIterator { > /* InlineMinMaxIterator is a class that will iterate over all render objects that contribute to > inline min/max width calculations. Note the following about the way it walks: >@@ -4822,18 +3793,9 @@ void RenderBlock::addFocusRingRects(Vect > > RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const > { >- if (isAnonymousColumnsBlock()) >- return createAnonymousColumnsWithParentRenderer(parent); >- if (isAnonymousColumnSpanBlock()) >- return createAnonymousColumnSpanWithParentRenderer(parent); > return createAnonymousWithParentRendererAndDisplay(parent, style().display()); > } > >-ColumnInfo::PaginationUnit RenderBlock::paginationUnit() const >-{ >- return ColumnInfo::Column; >-} >- > LayoutUnit RenderBlock::offsetFromLogicalTopOfFirstPage() const > { > LayoutState* layoutState = view().layoutState(); >@@ -4884,8 +3846,7 @@ static bool canComputeRegionRangeForBox( > bool RenderBlock::childBoxIsUnsplittableForFragmentation(const RenderBox& child) const > { > RenderFlowThread* flowThread = flowThreadContainingBlock(); >- bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread(); >- bool checkColumnBreaks = isInsideMulticolFlowThread || view().layoutState()->isPaginatingColumns(); >+ bool checkColumnBreaks = flowThread && flowThread->shouldCheckColumnBreaks(); > bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; > bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread(); > return child.isUnsplittableForPagination() || (checkColumnBreaks && child.style().columnBreakInside() == PBAVOID) >@@ -5034,10 +3995,6 @@ const char* RenderBlock::renderName() co > return "RenderBlock (floating)"; > if (isOutOfFlowPositioned()) > return "RenderBlock (positioned)"; >- if (isAnonymousColumnsBlock()) >- return "RenderBlock (anonymous multi-column)"; >- if (isAnonymousColumnSpanBlock()) >- return "RenderBlock (anonymous multi-column span)"; > if (isAnonymousBlock()) > return "RenderBlock (anonymous)"; > // FIXME: Temporary hack while the new generated content system is being implemented. >@@ -5134,72 +4091,6 @@ RenderBlock* RenderBlock::createAnonymou > return newBox; > } > >-RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent) >-{ >- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), BLOCK); >- newStyle.get().inheritColumnPropertiesFrom(&parent->style()); >- >- RenderBlock* newBox = new RenderBlockFlow(parent->document(), std::move(newStyle)); >- newBox->initializeStyle(); >- return newBox; >-} >- >-RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent) >-{ >- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), BLOCK); >- newStyle.get().setColumnSpan(ColumnSpanAll); >- >- RenderBlock* newBox = new RenderBlockFlow(parent->document(), std::move(newStyle)); >- newBox->initializeStyle(); >- return newBox; >-} >- >-void RenderBlock::computeLineGridPaginationOrigin(LayoutState& layoutState) const >-{ >- if (!hasColumns() || !style().hasInlineColumnAxis()) >- return; >- >- // We need to cache a line grid pagination origin so that we understand how to reset the line grid >- // at the top of each column. >- // Get the current line grid and offset. >- const auto lineGrid = layoutState.lineGrid(); >- if (!lineGrid) >- return; >- >- // Get the hypothetical line box used to establish the grid. >- auto lineGridBox = lineGrid->lineGridBox(); >- if (!lineGridBox) >- return; >- >- bool isHorizontalWritingMode = lineGrid->isHorizontalWritingMode(); >- >- LayoutUnit lineGridBlockOffset = isHorizontalWritingMode ? layoutState.lineGridOffset().height() : layoutState.lineGridOffset().width(); >- >- // Now determine our position on the grid. Our baseline needs to be adjusted to the nearest baseline multiple >- // as established by the line box. >- // FIXME: Need to handle crazy line-box-contain values that cause the root line box to not be considered. I assume >- // the grid should honor line-box-contain. >- 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) { >- // Shift to the next highest line grid multiple past the page logical top. Cache the delta >- // between this new value and the page logical top as the pagination origin. >- 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())); >- } >- } >-} >- > #ifndef NDEBUG > void RenderBlock::checkPositionedObjectsNeedLayout() > { >Index: Source/WebCore/rendering/RenderBlock.h >=================================================================== >--- Source/WebCore/rendering/RenderBlock.h (revision 168316) >+++ Source/WebCore/rendering/RenderBlock.h (working copy) >@@ -23,7 +23,6 @@ > #ifndef RenderBlock_h > #define RenderBlock_h > >-#include "ColumnInfo.h" > #include "GapRects.h" > #include "RenderBox.h" > #include "TextRun.h" >@@ -164,9 +163,7 @@ public: > } > LayoutUnit pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const > { >- // FIXME: Multicolumn layouts break carrying over subpixel values to the logical right offset because the lines may be shifted >- // by a subpixel value for all but the first column. This can lead to the actual pixel snapped width of the column being off >- // by one pixel when rendered versus layed out, which can result in the line being clipped. For now, we have to floor. >+ // FIXME: Now that we have a new multicolumn implementation, can this be fixed? > // https://bugs.webkit.org/show_bug.cgi?id=105461 > return floorToInt(logicalRightOffsetForLine(position, shouldIndentText, logicalHeight)); > } >@@ -184,12 +181,6 @@ public: > LayoutUnit textIndentOffset() const; > > virtual VisiblePosition positionForPoint(const LayoutPoint&, const RenderRegion*) override; >- >- // Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.) >- virtual LayoutUnit availableLogicalWidth() const override final; >- >- LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const; >- void adjustStartEdgeForWritingModeIncludingColumns(LayoutRect&) const; > > GapRects selectionGapRectsForRepaint(const RenderLayerModelObject* repaintContainer); > LayoutRect logicalLeftSelectionGap(RenderBlock& rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, >@@ -201,10 +192,6 @@ public: > > LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, const LayoutRect& logicalRect); > >- void adjustRectForColumns(LayoutRect&) const; >- virtual void adjustForColumns(LayoutSize&, const LayoutPoint&) const override final; >- void adjustForColumnRect(LayoutSize& offset, const LayoutPoint& locationInContainer) const; >- > void addContinuationWithOutline(RenderInline*); > bool paintsContinuationOutline(RenderInline*); > >@@ -217,11 +204,7 @@ public: > using RenderBoxModelObject::setContinuation; > > static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK); >- static RenderBlock* createAnonymousColumnsWithParentRenderer(const RenderObject*); >- static RenderBlock* createAnonymousColumnSpanWithParentRenderer(const RenderObject*); > RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); } >- RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); } >- RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); } > static void collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child); > > virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override; >@@ -248,20 +231,7 @@ public: > > static TextRun constructTextRun(RenderObject* context, const Font&, const UChar* characters, int length, const RenderStyle&, > TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); >- >- ColumnInfo* columnInfo() const; >- int columnGap() const; >- >- // FIXME: Can devirtualize this and only have the RenderBlockFlow version once the old multi-column code is gone. >- virtual void updateColumnProgressionFromStyle(RenderStyle*); > >- LayoutUnit initialBlockOffsetForPainting() const; >- LayoutUnit blockDeltaForPaintingNextColumn() const; >- >- // These two functions take the ColumnInfo* to avoid repeated lookups of the info in the global HashMap. >- unsigned columnCount(ColumnInfo*) const; >- LayoutRect columnRectAt(ColumnInfo*, unsigned) const; >- > LayoutUnit paginationStrut() const; > void setPaginationStrut(LayoutUnit); > >@@ -380,8 +350,7 @@ protected: > > virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override; > virtual void computePreferredLogicalWidths() override; >- void adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const; >- >+ > virtual int firstLineBaseline() const override; > virtual int inlineBlockBaseline(LineDirectionMode) const override; > >@@ -404,21 +373,12 @@ protected: > bool simplifiedLayout(); > virtual void simplifiedNormalFlowLayout(); > >- // FIXME: Can de-virtualize this once old columns go away. >- virtual void setComputedColumnCountAndWidth(int, LayoutUnit); >- > bool childBoxIsUnsplittableForFragmentation(const RenderBox& child) const; > > public: > virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false); > void clearLayoutOverflow(); > >- bool isTopLayoutOverflowAllowed() const override; >- bool isLeftLayoutOverflowAllowed() const override; >- >- // FIXME: Can devirtualize once old column code is gone. >- virtual void computeLineGridPaginationOrigin(LayoutState&) const; >- > // Adjust from painting offsets to the local coords of this renderer > void offsetForContents(LayoutPoint&) const; > >@@ -462,10 +422,7 @@ private: > > void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild); > virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild) override; >- void addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild); > >- void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild = 0); >- > virtual bool isSelfCollapsingBlock() const override final; > // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow > virtual bool hasLines() const { return false; } >@@ -482,16 +439,14 @@ private: > virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { } > virtual void paintInlineChildren(PaintInfo&, const LayoutPoint&) { } > void paintContents(PaintInfo&, const LayoutPoint&); >- void paintColumnContents(PaintInfo&, const LayoutPoint&, bool paintFloats = false); >- virtual void paintColumnRules(PaintInfo&, const LayoutPoint&); >+ virtual void paintColumnRules(PaintInfo&, const LayoutPoint&) { }; > void paintSelection(PaintInfo&, const LayoutPoint&); > void paintCaret(PaintInfo&, const LayoutPoint&, CaretType); > > virtual bool avoidsFloats() const override; > >- bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); > virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); >- // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow >+ // FIXME-BLOCKFLOW: Remove virtualization when all callers have moved to RenderBlockFlow > virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&) { return false; } > virtual bool hitTestInlineChildren(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&, HitTestAction) { return false; } > >@@ -535,22 +490,13 @@ private: > virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override; > virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override; > >- // FIXME: Can de-virtualize once old columns go away. >- virtual LayoutUnit computedColumnWidth() const; >- virtual unsigned computedColumnCount() const; >- > void paintContinuationOutlines(PaintInfo&, const LayoutPoint&); > > virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0) override final; >- >- void adjustPointToColumnContents(LayoutPoint&) const; > > // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow > virtual VisiblePosition positionForPointWithInlineChildren(const LayoutPoint&, const RenderRegion*); > >- virtual void computeColumnCountAndWidth(); >- void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild); >- > bool expandsToEncloseOverhangingFloats() const; > > void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, >@@ -559,21 +505,16 @@ private: > RenderObject* newChild, RenderBoxModelObject* oldCont); > RenderPtr<RenderBlock> clone() const; > RenderBlock* continuationBefore(RenderObject* beforeChild); >- RenderBlock* containingColumnsBlock(bool allowAnonymousColumnBlock = true); >- RenderBlock* columnsBlockForSpanningElement(RenderObject* newChild); > > private: > bool hasRareData() const; > > protected: > void dirtyForLayoutFromPercentageHeightDescendants(); >- >- virtual ColumnInfo::PaginationUnit paginationUnit() const; > > protected: >- virtual bool requiresColumns(int computedColumnCount) const; >- >- bool updateLogicalWidthAndColumnWidth(); >+ bool recomputeLogicalWidth(); >+ > public: > virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const override; > RenderRegion* regionAtBlockOffset(LayoutUnit) const; >Index: Source/WebCore/rendering/RenderBlockFlow.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlockFlow.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderBlockFlow.cpp (working copy) >@@ -35,9 +35,11 @@ > #include "RenderIterator.h" > #include "RenderLayer.h" > #include "RenderListItem.h" >+#include "RenderMarquee.h" > #include "RenderMultiColumnFlowThread.h" > #include "RenderMultiColumnSet.h" > #include "RenderNamedFlowFragment.h" >+#include "RenderTableCell.h" > #include "RenderText.h" > #include "RenderView.h" > #include "SimpleLineLayoutFunctions.h" >@@ -322,6 +324,108 @@ void RenderBlockFlow::rebuildFloatingObj > } > } > >+void RenderBlockFlow::adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const >+{ >+ if (!style().hasAutoColumnCount() || !style().hasAutoColumnWidth()) { >+ // The min/max intrinsic widths calculated really tell how much space elements need when >+ // laid out inside the columns. In order to eventually end up with the desired column width, >+ // we need to convert them to values pertaining to the multicol container. >+ int columnCount = style().hasAutoColumnCount() ? 1 : style().columnCount(); >+ LayoutUnit columnWidth; >+ LayoutUnit colGap = columnGap(); >+ LayoutUnit gapExtra = (columnCount - 1) * colGap; >+ if (style().hasAutoColumnWidth()) >+ minLogicalWidth = minLogicalWidth * columnCount + gapExtra; >+ else { >+ columnWidth = style().columnWidth(); >+ minLogicalWidth = std::min(minLogicalWidth, columnWidth); >+ } >+ // FIXME: If column-count is auto here, we should resolve it to calculate the maximum >+ // intrinsic width, instead of pretending that it's 1. The only way to do that is by >+ // performing a layout pass, but this is not an appropriate time or place for layout. The >+ // good news is that if height is unconstrained and there are no explicit breaks, the >+ // resolved column-count really should be 1. >+ maxLogicalWidth = std::max(maxLogicalWidth, columnWidth) * columnCount + gapExtra; >+ } >+} >+ >+void RenderBlockFlow::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const >+{ >+ if (childrenInline()) { >+ // FIXME: Remove this const_cast. >+ const_cast<RenderBlockFlow*>(this)->computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ } else >+ computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ >+ maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); >+ >+ adjustIntrinsicLogicalWidthsForColumns(minLogicalWidth, maxLogicalWidth); >+ >+ if (!style().autoWrap() && childrenInline()) { >+ // A horizontal marquee with inline children has no minimum width. >+ if (layer() && layer()->marquee() && layer()->marquee()->isHorizontal()) >+ minLogicalWidth = 0; >+ } >+ >+ if (isTableCell()) { >+ Length tableCellWidth = toRenderTableCell(this)->styleOrColLogicalWidth(); >+ if (tableCellWidth.isFixed() && tableCellWidth.value() > 0) >+ maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth.value())); >+ } >+ >+ int scrollbarWidth = instrinsicScrollbarLogicalWidth(); >+ maxLogicalWidth += scrollbarWidth; >+ minLogicalWidth += scrollbarWidth; >+} >+ >+bool RenderBlockFlow::recomputeLogicalWidthAndColumnWidth() >+{ >+ bool changed = recomputeLogicalWidth(); >+ >+ LayoutUnit oldColumnWidth = computedColumnWidth(); >+ computeColumnCountAndWidth(); >+ >+ return changed || oldColumnWidth != computedColumnWidth(); >+} >+ >+LayoutUnit RenderBlockFlow::columnGap() const >+{ >+ if (style().hasNormalColumnGap()) >+ return style().fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins. >+ return style().columnGap(); >+} >+ >+void RenderBlockFlow::computeColumnCountAndWidth() >+{ >+ // Calculate our column width and column count. >+ // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744 >+ unsigned desiredColumnCount = 1; >+ LayoutUnit desiredColumnWidth = contentLogicalWidth(); >+ >+ // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination. >+ if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) { >+ setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth); >+ return; >+ } >+ >+ LayoutUnit availWidth = desiredColumnWidth; >+ LayoutUnit colGap = columnGap(); >+ LayoutUnit colWidth = std::max<LayoutUnit>(LayoutUnit::fromPixel(1), LayoutUnit(style().columnWidth())); >+ int colCount = std::max<int>(1, style().columnCount()); >+ >+ if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) { >+ desiredColumnCount = colCount; >+ desiredColumnWidth = std::max<LayoutUnit>(0, (availWidth - ((desiredColumnCount - 1) * colGap)) / desiredColumnCount); >+ } else if (!style().hasAutoColumnWidth() && style().hasAutoColumnCount()) { >+ desiredColumnCount = std::max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap)); >+ desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap; >+ } else { >+ desiredColumnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1); >+ desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap; >+ } >+ setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth); >+} >+ > void RenderBlockFlow::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight) > { > ASSERT(needsLayout()); >@@ -331,7 +435,7 @@ void RenderBlockFlow::layoutBlock(bool r > > LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); > >- if (updateLogicalWidthAndColumnWidth()) >+ if (recomputeLogicalWidthAndColumnWidth()) > relayoutChildren = true; > > rebuildFloatingObjectSetFromIntrudingFloats(); >@@ -342,11 +446,10 @@ void RenderBlockFlow::layoutBlock(bool r > setLogicalHeight(0); > > bool pageLogicalHeightChanged = false; >- bool hasSpecifiedPageLogicalHeight = false; >- checkForPaginationLogicalHeightChange(relayoutChildren, pageLogicalHeight, pageLogicalHeightChanged, hasSpecifiedPageLogicalHeight); >+ checkForPaginationLogicalHeightChange(relayoutChildren, pageLogicalHeight, pageLogicalHeightChanged); > > const RenderStyle& styleToUse = style(); >- LayoutStateMaintainer statePusher(view(), *this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || styleToUse.isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, columnInfo()); >+ LayoutStateMaintainer statePusher(view(), *this, locationOffset(), hasTransform() || hasReflection() || styleToUse.isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged); > > preparePaginationBeforeBlockLayout(relayoutChildren); > if (!relayoutChildren) >@@ -386,7 +489,7 @@ void RenderBlockFlow::layoutBlock(bool r > if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats()) > setLogicalHeight(lowestFloatLogicalBottom() + toAdd); > >- if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight, statePusher) || relayoutToAvoidWidows(statePusher)) { >+ if (relayoutForPagination(statePusher) || relayoutToAvoidWidows(statePusher)) { > ASSERT(!shouldBreakAtLineToAvoidWidow()); > return; > } >@@ -458,9 +561,6 @@ void RenderBlockFlow::layoutBlock(bool r > else > repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft); > >- // The repaint rect may be split across columns, in which case adjustRectForColumns() will return the union. >- adjustRectForColumns(repaintRect); >- > repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline)); > > if (hasOverflowClip()) { >@@ -1357,7 +1457,7 @@ static bool inNormalFlow(RenderBox& chil > { > RenderBlock* curr = child.containingBlock(); > while (curr && curr != &child.view()) { >- if (curr->hasColumns() || curr->isRenderFlowThread()) >+ if (curr->isRenderFlowThread()) > return true; > if (curr->isFloatingOrOutOfFlowPositioned()) > return false; >@@ -1371,7 +1471,7 @@ LayoutUnit RenderBlockFlow::applyBeforeB > // FIXME: Add page break checking here when we support printing. > RenderFlowThread* flowThread = flowThreadContainingBlock(); > bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread(); >- bool checkColumnBreaks = isInsideMulticolFlowThread || view().layoutState()->isPaginatingColumns(); >+ bool checkColumnBreaks = flowThread && flowThread->shouldCheckColumnBreaks(); > bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this. > bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread(); > bool checkBeforeAlways = (checkColumnBreaks && child.style().columnBreakBefore() == PBALWAYS) >@@ -1381,8 +1481,6 @@ LayoutUnit RenderBlockFlow::applyBeforeB > if (checkColumnBreaks) { > if (isInsideMulticolFlowThread) > checkRegionBreaks = true; >- else >- view().layoutState()->addForcedColumnBreak(&child, logicalOffset); > } > if (checkRegionBreaks) { > LayoutUnit offsetBreakAdjustment = 0; >@@ -1399,7 +1497,7 @@ LayoutUnit RenderBlockFlow::applyAfterBr > // FIXME: Add page break checking here when we support printing. > RenderFlowThread* flowThread = flowThreadContainingBlock(); > bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread(); >- bool checkColumnBreaks = isInsideMulticolFlowThread || view().layoutState()->isPaginatingColumns(); >+ bool checkColumnBreaks = flowThread && flowThread->shouldCheckColumnBreaks(); > bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this. > bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread(); > bool checkAfterAlways = (checkColumnBreaks && child.style().columnBreakAfter() == PBALWAYS) >@@ -1414,8 +1512,6 @@ LayoutUnit RenderBlockFlow::applyAfterBr > if (checkColumnBreaks) { > if (isInsideMulticolFlowThread) > checkRegionBreaks = true; >- else >- view().layoutState()->addForcedColumnBreak(&child, logicalOffset); > } > if (checkRegionBreaks) { > LayoutUnit offsetBreakAdjustment = 0; >@@ -1714,8 +1810,6 @@ void RenderBlockFlow::updateMinimumPageH > { > if (RenderFlowThread* flowThread = flowThreadContainingBlock()) > flowThread->updateMinimumPageHeight(this, offsetFromLogicalTopOfFirstPage() + offset, minHeight); >- else if (ColumnInfo* colInfo = view().layoutState()->m_columnInfo) >- colInfo->updateMinimumColumnHeight(minHeight); > } > > LayoutUnit RenderBlockFlow::nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const >@@ -1967,7 +2061,7 @@ void RenderBlockFlow::computeOverflow(La > { > RenderBlock::computeOverflow(oldClientAfterEdge, recomputeFloats); > >- if (!hasColumns() && !multiColumnFlowThread() && (recomputeFloats || isRoot() || expandsToEncloseOverhangingFloats() || hasSelfPaintingLayer())) >+ if (!multiColumnFlowThread() && (recomputeFloats || isRoot() || expandsToEncloseOverhangingFloats() || hasSelfPaintingLayer())) > addOverflowFromFloats(); > } > >@@ -2422,7 +2516,7 @@ LayoutUnit RenderBlockFlow::lowestFloatL > LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow& child, bool makeChildPaintOtherFloats) > { > // Prevent floats from being added to the canvas by the root element, e.g., <html>. >- if (child.hasOverflowClip() || !child.containsFloats() || child.isRoot() || child.hasColumns() || child.isWritingModeRoot() || child.isRenderFlowThread() || child.isRenderRegion()) >+ if (child.hasOverflowClip() || !child.containsFloats() || child.isRoot() || child.isWritingModeRoot() || child.isRenderFlowThread() || child.isRenderRegion()) > return 0; > > LayoutUnit childLogicalTop = child.logicalTop(); >@@ -2480,7 +2574,7 @@ LayoutUnit RenderBlockFlow::addOverhangi > > bool RenderBlockFlow::hasOverhangingFloat(RenderBox& renderer) > { >- if (!m_floatingObjects || hasColumns() || !parent()) >+ if (!m_floatingObjects || !parent()) > return false; > > const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); >@@ -3219,59 +3313,9 @@ void RenderBlockFlow::paintInlineChildre > m_lineBoxes.paint(this, paintInfo, paintOffset); > } > >-bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher) >+bool RenderBlockFlow::relayoutForPagination(LayoutStateMaintainer& statePusher) > { >- if (!hasColumns() && !multiColumnFlowThread()) >- return false; >- >- if (hasColumns()) { >- RefPtr<RenderOverflow> savedOverflow = m_overflow.release(); >- if (childrenInline()) >- addOverflowFromInlineChildren(); >- else >- addOverflowFromBlockChildren(); >- LayoutUnit layoutOverflowLogicalBottom = (isHorizontalWritingMode() ? layoutOverflowRect().maxY() : layoutOverflowRect().maxX()) - borderAndPaddingBefore(); >- >- // FIXME: We don't balance properly at all in the presence of forced page breaks. We need to understand what >- // the distance between forced page breaks is so that we can avoid making the minimum column height too tall. >- ColumnInfo* colInfo = columnInfo(); >- if (!hasSpecifiedPageLogicalHeight) { >- LayoutUnit columnHeight = pageLogicalHeight; >- int minColumnCount = colInfo->forcedBreaks() + 1; >- int desiredColumnCount = colInfo->desiredColumnCount(); >- if (minColumnCount >= desiredColumnCount) { >- // The forced page breaks are in control of the balancing. Just set the column height to the >- // maximum page break distance. >- if (!pageLogicalHeight) { >- LayoutUnit distanceBetweenBreaks = std::max<LayoutUnit>(colInfo->maximumDistanceBetweenForcedBreaks(), >- view().layoutState()->pageLogicalOffset(this, borderAndPaddingBefore() + layoutOverflowLogicalBottom) - colInfo->forcedBreakOffset()); >- columnHeight = std::max(colInfo->minimumColumnHeight(), distanceBetweenBreaks); >- } >- } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeight, desiredColumnCount)) { >- // Now that we know the intrinsic height of the columns, we have to rebalance them. >- columnHeight = std::max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)layoutOverflowLogicalBottom / desiredColumnCount)); >- } >- >- if (columnHeight && columnHeight != pageLogicalHeight) { >- statePusher.pop(); >- setEverHadLayout(true); >- layoutBlock(false, columnHeight); >- return true; >- } >- } >- >- if (pageLogicalHeight) >- colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBottom / pageLogicalHeight), pageLogicalHeight); >- >- if (columnCount(colInfo)) { >- setLogicalHeight(borderAndPaddingBefore() + colInfo->columnHeight() + borderAndPaddingAfter() + scrollbarLogicalHeight()); >- clearOverflow(); >- } else >- m_overflow = savedOverflow.release(); >- return false; >- } >- >- if (!multiColumnFlowThread()->shouldRelayoutForPagination()) >+ if (!multiColumnFlowThread() || !multiColumnFlowThread()->shouldRelayoutForPagination()) > return false; > > multiColumnFlowThread()->setNeedsHeightsRecalculation(false); >@@ -3578,10 +3622,10 @@ void RenderBlockFlow::removeChild(Render > RenderBlock::removeChild(oldChild); > } > >-void RenderBlockFlow::checkForPaginationLogicalHeightChange(bool& relayoutChildren, LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight) >+void RenderBlockFlow::checkForPaginationLogicalHeightChange(bool& relayoutChildren, LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged) > { >- // If we don't use either of the two column implementations or a flow thread, then bail. >- if (!isRenderFlowThread() && !multiColumnFlowThread() && !hasColumns()) >+ // If we don't use columns or flow threads, then bail. >+ if (!isRenderFlowThread() && !multiColumnFlowThread()) > return; > > // We don't actually update any of the variables. We just subclassed to adjust our column height. >@@ -3593,30 +3637,6 @@ void RenderBlockFlow::checkForPagination > flowThread->setColumnHeightAvailable(std::max<LayoutUnit>(columnHeight, 0)); > if (oldHeightAvailable != flowThread->columnHeightAvailable()) > relayoutChildren = true; >- } else if (hasColumns()) { >- ColumnInfo* colInfo = columnInfo(); >- >- if (!pageLogicalHeight) { >- // We need to go ahead and set our explicit page height if one exists, so that we can >- // avoid doing two layout passes. >- updateLogicalHeight(); >- LayoutUnit columnHeight = isRenderView() ? view().pageOrViewLogicalHeight() : contentLogicalHeight(); >- if (columnHeight > 0) { >- pageLogicalHeight = columnHeight; >- hasSpecifiedPageLogicalHeight = true; >- } >- setLogicalHeight(0); >- } >- >- if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) >- pageLogicalHeightChanged = true; >- >- colInfo->setColumnHeight(pageLogicalHeight); >- >- if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight) >- colInfo->clearForcedBreaks(); >- >- colInfo->setPaginationUnit(paginationUnit()); > } else if (isRenderFlowThread()) { > RenderFlowThread* flowThread = toRenderFlowThread(this); > >@@ -3635,11 +3655,17 @@ void RenderBlockFlow::checkForPagination > } > } > >+bool RenderBlockFlow::requiresColumns(int desiredColumnCount) const >+{ >+ // If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating >+ // in the RenderView instead. >+ bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isRoot() || isBody()); >+ >+ return firstChild() && (desiredColumnCount != 1 || !style().hasAutoColumnWidth() || !style().hasInlineColumnAxis() || isPaginated); >+} >+ > void RenderBlockFlow::setComputedColumnCountAndWidth(int count, LayoutUnit width) > { >- if (!document().regionBasedColumnsEnabled()) >- return RenderBlock::setComputedColumnCountAndWidth(count, width); >- > bool destroyColumns = !requiresColumns(count); > if (destroyColumns) { > if (multiColumnFlowThread()) >@@ -3655,9 +3681,6 @@ void RenderBlockFlow::setComputedColumnC > > void RenderBlockFlow::updateColumnProgressionFromStyle(RenderStyle* style) > { >- if (!document().regionBasedColumnsEnabled()) >- return RenderBlock::updateColumnProgressionFromStyle(style); >- > if (!multiColumnFlowThread()) > return; > >@@ -3682,9 +3705,6 @@ void RenderBlockFlow::updateColumnProgre > > LayoutUnit RenderBlockFlow::computedColumnWidth() const > { >- if (!document().regionBasedColumnsEnabled()) >- return RenderBlock::computedColumnWidth(); >- > if (multiColumnFlowThread()) > return multiColumnFlowThread()->computedColumnWidth(); > return contentLogicalWidth(); >@@ -3692,9 +3712,6 @@ LayoutUnit RenderBlockFlow::computedColu > > unsigned RenderBlockFlow::computedColumnCount() const > { >- if (!document().regionBasedColumnsEnabled()) >- return RenderBlock::computedColumnCount(); >- > if (multiColumnFlowThread()) > return multiColumnFlowThread()->computedColumnCount(); > >Index: Source/WebCore/rendering/RenderBlockFlow.h >=================================================================== >--- Source/WebCore/rendering/RenderBlockFlow.h (revision 168316) >+++ Source/WebCore/rendering/RenderBlockFlow.h (working copy) >@@ -384,9 +384,11 @@ public: > void createMultiColumnFlowThread(); > void destroyMultiColumnFlowThread(); > >- virtual void updateColumnProgressionFromStyle(RenderStyle*) override; >+ void updateColumnProgressionFromStyle(RenderStyle*); > > protected: >+ virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override; >+ > // A page break is required at some offset due to space shortage in the current fragmentainer. > void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage); > >@@ -442,22 +444,28 @@ protected: > > virtual bool isMultiColumnBlockFlow() const override { return multiColumnFlowThread(); } > >- virtual void setComputedColumnCountAndWidth(int, LayoutUnit) override; >+ void setComputedColumnCountAndWidth(int, LayoutUnit); > >- virtual LayoutUnit computedColumnWidth() const override; >- virtual unsigned computedColumnCount() const override; >+ LayoutUnit computedColumnWidth() const; >+ unsigned computedColumnCount() const; > > bool isTopLayoutOverflowAllowed() const override; > bool isLeftLayoutOverflowAllowed() const override; > > void moveFloatsTo(RenderBlockFlow* toBlock); >+ >+ virtual void computeColumnCountAndWidth(); >+ virtual bool requiresColumns(int) const; > > private: >+ bool recomputeLogicalWidthAndColumnWidth(); >+ LayoutUnit columnGap() const; >+ > // Called to lay out the legend for a fieldset or the ruby text of a ruby run. Also used by multi-column layout to handle > // the flow thread child. > virtual RenderObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/); > >- void checkForPaginationLogicalHeightChange(bool& relayoutChildren, LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight); >+ void checkForPaginationLogicalHeightChange(bool& relayoutChildren, LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged); > > virtual void paintInlineChildren(PaintInfo&, const LayoutPoint&) override; > virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool preservePhase = false) override; >@@ -490,7 +498,7 @@ private: > LayoutUnit addOverhangingFloats(RenderBlockFlow& child, bool makeChildPaintOtherFloats); > bool hasOverhangingFloat(RenderBox&); > void addIntrudingFloats(RenderBlockFlow* prev, LayoutUnit xoffset, LayoutUnit yoffset); >- bool hasOverhangingFloats() { return parent() && !hasColumns() && containsFloats() && lowestFloatLogicalBottom() > logicalHeight(); } >+ bool hasOverhangingFloats() { return parent() && containsFloats() && lowestFloatLogicalBottom() > logicalHeight(); } > LayoutUnit getClearDelta(RenderBox& child, LayoutUnit yPos); > > void determineLogicalLeftPositionForChild(RenderBox& child, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta); >@@ -527,7 +535,9 @@ public: > virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; > virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } > >-private: >+private: >+ void adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const; >+ > void layoutLineBoxes(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom); > void layoutSimpleLines(LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom); > >@@ -581,7 +591,7 @@ public: > void createRenderNamedFlowFragmentIfNeeded(); > > // Pagination routines. >- virtual bool relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer&); >+ bool relayoutForPagination(LayoutStateMaintainer&); > > bool hasRareBlockFlowData() const { return m_rareBlockFlowData.get(); } > RenderBlockFlowRareData* rareBlockFlowData() const { ASSERT_WITH_SECURITY_IMPLICATION(hasRareBlockFlowData()); return m_rareBlockFlowData.get(); } >Index: Source/WebCore/rendering/RenderBox.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBox.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderBox.cpp (working copy) >@@ -374,7 +374,7 @@ void RenderBox::styleDidChange(StyleDiff > const Pagination& pagination = view().frameView().pagination(); > if (viewChangedWritingMode && pagination.mode != Pagination::Unpaginated) { > viewStyle.setColumnStylesFromPaginationMode(pagination.mode); >- if (view().hasColumns() || view().multiColumnFlowThread()) >+ if (view().multiColumnFlowThread()) > view().updateColumnProgressionFromStyle(&viewStyle); > } > } >@@ -1970,7 +1970,7 @@ void RenderBox::mapAbsoluteToLocalPoint( > RenderBoxModelObject::mapAbsoluteToLocalPoint(mode, transformState); > } > >-LayoutSize RenderBox::offsetFromContainer(RenderObject* o, const LayoutPoint& point, bool* offsetDependsOnPoint) const >+LayoutSize RenderBox::offsetFromContainer(RenderObject* o, const LayoutPoint&, bool* offsetDependsOnPoint) const > { > // A region "has" boxes inside it without being their container. > ASSERT(o == container() || o->isRenderRegion()); >@@ -1979,22 +1979,8 @@ LayoutSize RenderBox::offsetFromContaine > if (isInFlowPositioned()) > offset += offsetForInFlowPosition(); > >- if (!isInline() || isReplaced()) { >- if (!style().hasOutOfFlowPosition() && o->hasColumns()) { >- RenderBlock* block = toRenderBlock(o); >- LayoutRect columnRect(frameRect()); >- block->adjustStartEdgeForWritingModeIncludingColumns(columnRect); >- offset += toLayoutSize(columnRect.location()); >- LayoutPoint columnPoint = block->flipForWritingModeIncludingColumns(point + offset); >- offset = toLayoutSize(block->flipForWritingModeIncludingColumns(toLayoutPoint(offset))); >- o->adjustForColumns(offset, columnPoint); >- offset = block->flipForWritingMode(offset); >- >- if (offsetDependsOnPoint) >- *offsetDependsOnPoint = true; >- } else >- offset += topLeftLocationOffset(); >- } >+ if (!isInline() || isReplaced()) >+ offset += topLeftLocationOffset(); > > if (o->isBox()) > offset -= toRenderBox(o)->scrolledContentOffset(); >@@ -2171,13 +2157,6 @@ void RenderBox::computeRectForRepaint(co > // flag on the RenderObject has been cleared, so use the one on the style(). > topLeft += layer()->offsetForInFlowPosition(); > } >- >- if (position != AbsolutePosition && position != FixedPosition && o->hasColumns() && o->isRenderBlockFlow()) { >- LayoutRect repaintRect(topLeft, rect.size()); >- toRenderBlock(o)->adjustRectForColumns(repaintRect); >- topLeft = repaintRect.location(); >- rect = repaintRect; >- } > > // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout, > // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer. >@@ -4670,13 +4649,6 @@ LayoutPoint RenderBox::flipForWritingMod > return isHorizontalWritingMode() ? LayoutPoint(position.x(), height() - position.y()) : LayoutPoint(width() - position.x(), position.y()); > } > >-LayoutPoint RenderBox::flipForWritingModeIncludingColumns(const LayoutPoint& point) const >-{ >- if (!hasColumns() || !style().isFlippedBlocksWritingMode()) >- return flipForWritingMode(point); >- return toRenderBlock(this)->flipForWritingModeIncludingColumns(point); >-} >- > LayoutSize RenderBox::flipForWritingMode(const LayoutSize& offset) const > { > if (!style().isFlippedBlocksWritingMode()) >Index: Source/WebCore/rendering/RenderBox.h >=================================================================== >--- Source/WebCore/rendering/RenderBox.h (revision 168316) >+++ Source/WebCore/rendering/RenderBox.h (working copy) >@@ -446,7 +446,6 @@ public: > static bool percentageLogicalHeightIsResolvableFromBlock(const RenderBlock* containingBlock, bool outOfFlowPositioned); > LayoutUnit computePercentageLogicalHeight(const Length& height) const; > >- // Block flows subclass availableWidth/Height to handle multi column layout (shrinking the width/height available to children when laying out.) > virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); } > virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const; > LayoutUnit availableLogicalHeightUsing(const Length&, AvailableLogicalHeightType) const; >@@ -544,7 +543,6 @@ public: > LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutPoint&) const; > LayoutUnit flipForWritingMode(LayoutUnit position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes). > LayoutPoint flipForWritingMode(const LayoutPoint&) const; >- LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const; > LayoutSize flipForWritingMode(const LayoutSize&) const; > void flipForWritingMode(LayoutRect&) const; > FloatPoint flipForWritingMode(const FloatPoint&) const; >Index: Source/WebCore/rendering/RenderBoxModelObject.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy) >@@ -296,7 +296,6 @@ LayoutPoint RenderBoxModelObject::adjust > return LayoutPoint(); > > LayoutPoint referencePoint = startPoint; >- referencePoint.move(parent()->offsetForColumns(referencePoint)); > > // If the offsetParent of the element is null, or is the HTML body element, > // return the distance between the canvas origin and the left border edge >@@ -325,7 +324,6 @@ LayoutPoint RenderBoxModelObject::adjust > } else if (!isOutOfFlowPositioned()) { > if (curr->isBox() && !curr->isTableRow()) > referencePoint.moveBy(toRenderBox(curr)->topLeftLocation()); >- referencePoint.move(curr->parent()->offsetForColumns(referencePoint)); > } > > curr = curr->parent(); >@@ -2654,13 +2652,6 @@ void RenderBoxModelObject::mapAbsoluteTo > > LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint()); > >- if (!style().hasOutOfFlowPosition() && o->hasColumns()) { >- RenderBlock* block = toRenderBlock(o); >- LayoutPoint point(roundedLayoutPoint(transformState.mappedPoint())); >- point -= containerOffset; >- block->adjustForColumnRect(containerOffset, point); >- } >- > bool preserve3D = mode & UseTransforms && (o->style().preserves3D() || style().preserves3D()); > if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { > TransformationMatrix t; >Index: Source/WebCore/rendering/RenderBoxModelObject.h >=================================================================== >--- Source/WebCore/rendering/RenderBoxModelObject.h (revision 168316) >+++ Source/WebCore/rendering/RenderBoxModelObject.h (working copy) >@@ -89,7 +89,7 @@ public: > > virtual void updateFromStyle() override; > >- virtual bool requiresLayer() const override { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || hasReflection() || style().specifiesColumns(); } >+ virtual bool requiresLayer() const override { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || hasReflection(); } > > // This will work on inlines to return the bounding box of all of the lines' border boxes. > virtual IntRect borderBoundingBox() const = 0; >@@ -181,7 +181,7 @@ public: > > virtual void setSelectionState(SelectionState) override; > >- bool canHaveBoxInfoInRegion() const { return !isFloating() && !isReplaced() && !isInline() && !hasColumns() && !isTableCell() && isRenderBlock() && !isRenderSVGBlock(); } >+ bool canHaveBoxInfoInRegion() const { return !isFloating() && !isReplaced() && !isInline() && !isTableCell() && isRenderBlock() && !isRenderSVGBlock(); } > > void getGeometryForBackgroundImage(const RenderLayerModelObject* paintContainer, FloatRect& destRect, FloatPoint& phase, FloatSize& tileSize) const; > void contentChanged(ContentChangeType); >@@ -275,8 +275,7 @@ public: > void setFirstLetterRemainingText(RenderTextFragment*); > > // These functions are only used internally to manipulate the render tree structure via remove/insert/appendChildNode. >- // Since they are typically called only to move objects around within anonymous blocks (which only have layers in >- // the case of column spans), the default for fullRemoveInsert is false rather than true. >+ // Since they are typically called only to move objects around within anonymous blocks, the default for fullRemoveInsert is false rather than true. > void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert = false); > void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, bool fullRemoveInsert = false) > { >Index: Source/WebCore/rendering/RenderFlexibleBox.cpp >=================================================================== >--- Source/WebCore/rendering/RenderFlexibleBox.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderFlexibleBox.cpp (working copy) >@@ -259,7 +259,7 @@ void RenderFlexibleBox::layoutBlock(bool > > LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); > >- if (updateLogicalWidthAndColumnWidth()) >+ if (recomputeLogicalWidth()) > relayoutChildren = true; > > LayoutUnit previousHeight = logicalHeight(); >Index: Source/WebCore/rendering/RenderFlowThread.h >=================================================================== >--- Source/WebCore/rendering/RenderFlowThread.h (revision 168316) >+++ Source/WebCore/rendering/RenderFlowThread.h (working copy) >@@ -233,6 +233,9 @@ public: > > ContainingRegionMap& containingRegionMap(); > >+ // FIXME: Eventually as column and region flow threads start nesting, this may end up changing. >+ virtual bool shouldCheckColumnBreaks() const { return false; } >+ > private: > virtual bool isRenderFlowThread() const override final { return true; } > >Index: Source/WebCore/rendering/RenderGeometryMap.cpp >=================================================================== >--- Source/WebCore/rendering/RenderGeometryMap.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderGeometryMap.cpp (working copy) >@@ -166,7 +166,7 @@ static bool canMapBetweenRenderers(const > if (style.position() == FixedPosition || style.isFlippedBlocksWritingMode()) > return false; > >- if (current->hasColumns() || current->hasTransform() || current->isRenderFlowThread()) >+ if (current->hasTransform() || current->isRenderFlowThread()) > return false; > > if (current->isSVGRoot()) >Index: Source/WebCore/rendering/RenderInline.cpp >=================================================================== >--- Source/WebCore/rendering/RenderInline.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderInline.cpp (working copy) >@@ -1122,9 +1122,6 @@ LayoutRect RenderInline::clippedOverflow > if (hitRepaintContainer || !cb) > return repaintRect; > >- if (cb->hasColumns()) >- cb->adjustRectForColumns(repaintRect); >- > if (cb->hasOverflowClip()) > cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect); > >@@ -1174,16 +1171,6 @@ void RenderInline::computeRectForRepaint > > LayoutPoint topLeft = rect.location(); > >- if (o->isRenderBlockFlow() && !style().hasOutOfFlowPosition()) { >- RenderBlock* cb = toRenderBlock(o); >- if (cb->hasColumns()) { >- LayoutRect repaintRect(topLeft, rect.size()); >- cb->adjustRectForColumns(repaintRect); >- topLeft = repaintRect.location(); >- rect = repaintRect; >- } >- } >- > if (style().hasInFlowPosition() && layer()) { > // Apply the in-flow position offset when invalidating a rectangle. The layer > // is translated, but the render box isn't, so we need to do this to get the >@@ -1212,7 +1199,7 @@ void RenderInline::computeRectForRepaint > o->computeRectForRepaint(repaintContainer, rect, fixed); > } > >-LayoutSize RenderInline::offsetFromContainer(RenderObject* container, const LayoutPoint& point, bool* offsetDependsOnPoint) const >+LayoutSize RenderInline::offsetFromContainer(RenderObject* container, const LayoutPoint&, bool* offsetDependsOnPoint) const > { > ASSERT(container == this->container()); > >@@ -1220,15 +1207,11 @@ LayoutSize RenderInline::offsetFromConta > if (isInFlowPositioned()) > offset += offsetForInFlowPosition(); > >- container->adjustForColumns(offset, point); >- > if (container->isBox()) > offset -= toRenderBox(container)->scrolledContentOffset(); > > if (offsetDependsOnPoint) >- *offsetDependsOnPoint = container->hasColumns() >- || (container->isBox() && container->style().isFlippedBlocksWritingMode()) >- || container->isRenderFlowThread(); >+ *offsetDependsOnPoint = (container->isBox() && container->style().isFlippedBlocksWritingMode()) || container->isRenderFlowThread(); > > return offset; > } >@@ -1254,8 +1237,8 @@ void RenderInline::mapLocalToContainer(c > > if (mode & ApplyContainerFlip && o->isBox()) { > if (o->style().isFlippedBlocksWritingMode()) { >- IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); >- transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(centerPoint) - centerPoint); >+ LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); >+ transformState.move(toRenderBox(o)->flipForWritingMode(centerPoint) - centerPoint); > } > mode &= ~ApplyContainerFlip; > } >Index: Source/WebCore/rendering/RenderLayer.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayer.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderLayer.cpp (working copy) >@@ -46,7 +46,6 @@ > > #include "AnimationController.h" > #include "BoxShape.h" >-#include "ColumnInfo.h" > #include "CSSPropertyNames.h" > #include "Chrome.h" > #include "Document.h" >@@ -164,7 +163,6 @@ RenderLayer::RenderLayer(RenderLayerMode > , m_hasVisibleContent(false) > , m_visibleDescendantStatusDirty(false) > , m_hasVisibleDescendant(false) >- , m_isPaginated(false) > , m_3DTransformedDescendantStatusDirty(true) > , m_has3DTransformedDescendant(false) > , m_hasCompositingDescendant(false) >@@ -405,10 +403,8 @@ void RenderLayer::updateLayerPositions(R > > if (flags & UpdatePagination) > updatePagination(); >- else { >- m_isPaginated = false; >+ else > m_enclosingPaginationLayer = 0; >- } > > if (m_hasVisibleContent) { > // FIXME: LayoutState does not work with RenderLayers as there is not a 1-to-1 >@@ -462,13 +458,10 @@ void RenderLayer::updateLayerPositions(R > if (isComposited()) > flags &= ~IsCompositingUpdateRoot; > >- if (useRegionBasedColumns() && renderer().isInFlowRenderFlowThread()) { >+ if (renderer().isInFlowRenderFlowThread()) { > updatePagination(); > flags |= UpdatePagination; > } >- >- if (renderer().hasColumns()) >- flags |= UpdatePagination; > > if (transform()) { > flags |= SeenTransformedLayer; >@@ -940,99 +933,47 @@ RenderLayer* RenderLayer::enclosingOverf > return 0; > } > >-static bool checkContainingBlockChainForPagination(RenderLayerModelObject* renderer, RenderBox* ancestorColumnsRenderer) >-{ >- RenderLayerModelObject* prevBlock = renderer; >- RenderBlock* containingBlock; >- for (containingBlock = renderer->containingBlock(); >- containingBlock && containingBlock != &renderer->view() && containingBlock != ancestorColumnsRenderer; >- containingBlock = containingBlock->containingBlock()) { >- prevBlock = containingBlock; >- } >- >- // If the columns block wasn't in our containing block chain, then we aren't paginated by it. >- if (containingBlock != ancestorColumnsRenderer) >- return false; >- >- // If the previous block is absolutely positioned, then we can't be paginated by the columns block. >- if (prevBlock->isOutOfFlowPositioned()) >- return false; >- >- // Otherwise we are paginated by the columns block. >- return true; >-} >- >-bool RenderLayer::useRegionBasedColumns() const >-{ >- const Settings& settings = renderer().frame().settings(); >- return settings.regionBasedColumnsEnabled(); >-} >- > void RenderLayer::updatePagination() > { >- m_isPaginated = false; > m_enclosingPaginationLayer = 0; > > if (isComposited() || !parent()) > return; // FIXME: We will have to deal with paginated compositing layers someday. > // FIXME: For now the RenderView can't be paginated. Eventually printing will move to a model where it is though. > >- // The main difference between the paginated booleans for the old column code and the new column code >- // is that each paginated layer has to paint on its own with the new code. There is no >- // recurring into child layers. This means that the m_isPaginated bits for the new column code can't just be set on >- // "roots" that get split and paint all their descendants. Instead each layer has to be checked individually and >+ // Each layer that is inside a multicolumn flow thread has to be checked individually and > // genuinely know if it is going to have to split itself up when painting only its contents (and not any other descendant > // layers). We track an enclosingPaginationLayer instead of using a simple bit, since we want to be able to get back > // to that layer easily. >- bool regionBasedColumnsUsed = useRegionBasedColumns(); >- if (regionBasedColumnsUsed && renderer().isInFlowRenderFlowThread()) { >+ if (renderer().isInFlowRenderFlowThread()) { > m_enclosingPaginationLayer = this; > return; > } > > if (isNormalFlowOnly()) { >- if (regionBasedColumnsUsed) { >- // Content inside a transform is not considered to be paginated, since we simply >- // paint the transform multiple times in each column, so we don't have to use >- // fragments for the transformed content. >- m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(); >- if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTransform()) >- m_enclosingPaginationLayer = 0; >- } else >- m_isPaginated = parent()->renderer().hasColumns(); >+ // Content inside a transform is not considered to be paginated, since we simply >+ // paint the transform multiple times in each column, so we don't have to use >+ // fragments for the transformed content. >+ m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(); >+ if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTransform()) >+ m_enclosingPaginationLayer = 0; > return; > } > > // For the new columns code, we want to walk up our containing block chain looking for an enclosing layer. Once > // we find one, then we just check its pagination status. >- if (regionBasedColumnsUsed) { >- RenderView* renderView = &renderer().view(); >- RenderBlock* containingBlock; >- for (containingBlock = renderer().containingBlock(); >- containingBlock && containingBlock != renderView; >- containingBlock = containingBlock->containingBlock()) { >- if (containingBlock->hasLayer()) { >- // Content inside a transform is not considered to be paginated, since we simply >- // paint the transform multiple times in each column, so we don't have to use >- // fragments for the transformed content. >- m_enclosingPaginationLayer = containingBlock->layer()->enclosingPaginationLayer(); >- if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTransform()) >- m_enclosingPaginationLayer = 0; >- return; >- } >- } >- return; >- } >- >- // If we're not normal flow, then we need to look for a multi-column object between us and our stacking container. >- RenderLayer* ancestorStackingContainer = stackingContainer(); >- for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { >- if (curr->renderer().hasColumns()) { >- m_isPaginated = checkContainingBlockChainForPagination(&renderer(), curr->renderBox()); >+ RenderView* renderView = &renderer().view(); >+ RenderBlock* containingBlock; >+ for (containingBlock = renderer().containingBlock(); containingBlock && containingBlock != renderView; containingBlock = containingBlock->containingBlock()) { >+ if (containingBlock->hasLayer()) { >+ // Content inside a transform is not considered to be paginated, since we simply >+ // paint the transform multiple times in each column, so we don't have to use >+ // fragments for the transformed content. >+ m_enclosingPaginationLayer = containingBlock->layer()->enclosingPaginationLayer(); >+ if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTransform()) >+ m_enclosingPaginationLayer = 0; > return; > } >- if (curr == ancestorStackingContainer) >- return; > } > } > >@@ -2064,10 +2005,6 @@ static inline const RenderLayer* accumul > > if (adjustForColumns == RenderLayer::AdjustForColumns) { > if (RenderLayer* parentLayer = layer->parent()) { >- LayoutSize layerColumnOffset; >- parentLayer->renderer().adjustForColumns(layerColumnOffset, location); >- location += layerColumnOffset; >- > if (parentLayer->renderer().isRenderMultiColumnFlowThread()) { > RenderRegion* region = toRenderMultiColumnFlowThread(parentLayer->renderer()).physicalTranslationFromFlowToRegion(location); > if (region) >@@ -4232,11 +4169,7 @@ void RenderLayer::paintList(Vector<Rende > RenderLayer* childLayer = list->at(i); > if (childLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()) > continue; >- >- if (!childLayer->isPaginated()) >- childLayer->paintLayer(context, paintingInfo, paintFlags); >- else >- paintPaginatedChildLayer(childLayer, context, paintingInfo, paintFlags); >+ childLayer->paintLayer(context, paintingInfo, paintFlags); > } > } > >@@ -4596,108 +4529,6 @@ void RenderLayer::paintOverflowControlsF > } > } > >-void RenderLayer::paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) >-{ >- // We need to do multiple passes, breaking up our child layer into strips. >- Vector<RenderLayer*> columnLayers; >- RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContainer(); >- for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) { >- if (curr->renderer().hasColumns() && checkContainingBlockChainForPagination(&childLayer->renderer(), curr->renderBox())) >- columnLayers.append(curr); >- if (curr == ancestorLayer) >- break; >- } >- >- // It is possible for paintLayer() to be called after the child layer ceases to be paginated but before >- // updateLayerPositions() is called and resets the isPaginated() flag, see <rdar://problem/10098679>. >- // If this is the case, just bail out, since the upcoming call to updateLayerPositions() will repaint the layer. >- if (!columnLayers.size()) >- return; >- >- paintChildLayerIntoColumns(childLayer, context, paintingInfo, paintFlags, columnLayers, columnLayers.size() - 1); >-} >- >-void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext* context, const LayerPaintingInfo& paintingInfo, >- PaintLayerFlags paintFlags, const Vector<RenderLayer*>& columnLayers, size_t colIndex) >-{ >- RenderBlock& columnBlock = toRenderBlock(columnLayers[colIndex]->renderer()); >- >- ASSERT(columnBlock.hasColumns()); >- if (!columnBlock.hasColumns()) >- return; >- >- LayoutPoint layerOffset; >- // FIXME: It looks suspicious to call convertToLayerCoords here >- // as canUseConvertToLayerCoords is true for this layer. >- columnBlock.layer()->convertToLayerCoords(paintingInfo.rootLayer, layerOffset); >- >- bool isHorizontal = columnBlock.style().isHorizontalWritingMode(); >- >- ColumnInfo* colInfo = columnBlock.columnInfo(); >- unsigned colCount = columnBlock.columnCount(colInfo); >- LayoutUnit currLogicalTopOffset = columnBlock.initialBlockOffsetForPainting(); >- LayoutUnit blockDelta = columnBlock.blockDeltaForPaintingNextColumn(); >- for (unsigned i = 0; i < colCount; i++) { >- // For each rect, we clip to the rect, and then we adjust our coords. >- LayoutRect colRect = columnBlock.columnRectAt(colInfo, i); >- columnBlock.flipForWritingMode(colRect); >- >- LayoutUnit logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock.logicalLeftOffsetForContent(); >- LayoutSize offset = isHorizontal ? LayoutSize(logicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, logicalLeftOffset); >- colRect.moveBy(layerOffset); >- >- LayoutRect localDirtyRect(paintingInfo.paintDirtyRect); >- localDirtyRect.intersect(colRect); >- if (!localDirtyRect.isEmpty()) { >- GraphicsContextStateSaver stateSaver(*context); >- >- // Each strip pushes a clip, since column boxes are specified as being >- // like overflow:hidden. >- context->clip(pixelSnappedIntRect(colRect)); >- >- if (!colIndex) { >- // Apply a translation transform to change where the layer paints. >- TransformationMatrix oldTransform; >- bool oldHasTransform = childLayer->transform(); >- if (oldHasTransform) >- oldTransform = *childLayer->transform(); >- TransformationMatrix newTransform(oldTransform); >- newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height())); >- >- childLayer->m_transform = std::make_unique<TransformationMatrix>(newTransform); >- >- LayerPaintingInfo localPaintingInfo(paintingInfo); >- localPaintingInfo.paintDirtyRect = localDirtyRect; >- childLayer->paintLayer(context, localPaintingInfo, paintFlags); >- >- if (oldHasTransform) >- childLayer->m_transform = std::make_unique<TransformationMatrix>(oldTransform); >- else >- childLayer->m_transform = nullptr; >- } else { >- // Adjust the transform such that the renderer's upper left corner will paint at (0,0) in user space. >- // This involves subtracting out the position of the layer in our current coordinate space. >- LayoutPoint childOffset; >- columnLayers[colIndex - 1]->convertToLayerCoords(paintingInfo.rootLayer, childOffset); >- TransformationMatrix transform; >- transform.translateRight(roundToInt(childOffset.x() + offset.width()), roundToInt(childOffset.y() + offset.height())); >- >- // Apply the transform. >- context->concatCTM(transform.toAffineTransform()); >- >- // Now do a paint with the root layer shifted to be the next multicol block. >- LayerPaintingInfo columnPaintingInfo(paintingInfo); >- columnPaintingInfo.rootLayer = columnLayers[colIndex - 1]; >- columnPaintingInfo.paintDirtyRect = transform.inverse().mapRect(localDirtyRect); >- paintChildLayerIntoColumns(childLayer, context, columnPaintingInfo, paintFlags, columnLayers, colIndex - 1); >- } >- } >- >- // Move to the next position. >- currLogicalTopOffset += blockDelta; >- } >-} >- > bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) > { > return hitTest(request, result.hitTestLocation(), result); >@@ -5231,10 +5062,7 @@ RenderLayer* RenderLayer::hitTestList(Ve > continue; > RenderLayer* hitLayer = 0; > HitTestResult tempResult(result.hitTestLocation()); >- if (childLayer->isPaginated()) >- hitLayer = hitTestPaginatedChildLayer(childLayer, rootLayer, request, tempResult, hitTestRect, hitTestLocation, transformState, zOffsetForDescendants); >- else >- hitLayer = childLayer->hitTestLayer(rootLayer, this, request, tempResult, hitTestRect, hitTestLocation, false, transformState, zOffsetForDescendants); >+ hitLayer = childLayer->hitTestLayer(rootLayer, this, request, tempResult, hitTestRect, hitTestLocation, false, transformState, zOffsetForDescendants); > > // If it a rect-based test, we can safely append the temporary result since it might had hit > // nodes but not necesserily had hitLayer set. >@@ -5253,104 +5081,6 @@ RenderLayer* RenderLayer::hitTestList(Ve > return resultLayer; > } > >-RenderLayer* RenderLayer::hitTestPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, >- const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, const HitTestingTransformState* transformState, double* zOffset) >-{ >- Vector<RenderLayer*> columnLayers; >- RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContainer(); >- for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) { >- if (curr->renderer().hasColumns() && checkContainingBlockChainForPagination(&childLayer->renderer(), curr->renderBox())) >- columnLayers.append(curr); >- if (curr == ancestorLayer) >- break; >- } >- >- ASSERT(columnLayers.size()); >- return hitTestChildLayerColumns(childLayer, rootLayer, request, result, hitTestRect, hitTestLocation, transformState, zOffset, >- columnLayers, columnLayers.size() - 1); >-} >- >-RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, >- const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, const HitTestingTransformState* transformState, double* zOffset, >- const Vector<RenderLayer*>& columnLayers, size_t columnIndex) >-{ >- RenderBlock& columnBlock = toRenderBlock(columnLayers[columnIndex]->renderer()); >- >- ASSERT(columnBlock.hasColumns()); >- if (!columnBlock.hasColumns()) >- return 0; >- >- LayoutPoint layerOffset; >- columnBlock.layer()->convertToLayerCoords(rootLayer, layerOffset); >- >- ColumnInfo* colInfo = columnBlock.columnInfo(); >- int colCount = columnBlock.columnCount(colInfo); >- >- // We have to go backwards from the last column to the first. >- bool isHorizontal = columnBlock.style().isHorizontalWritingMode(); >- LayoutUnit logicalLeft = columnBlock.logicalLeftOffsetForContent(); >- LayoutUnit currLogicalTopOffset = columnBlock.initialBlockOffsetForPainting(); >- LayoutUnit blockDelta = columnBlock.blockDeltaForPaintingNextColumn(); >- currLogicalTopOffset += colCount * blockDelta; >- for (int i = colCount - 1; i >= 0; i--) { >- // For each rect, we clip to the rect, and then we adjust our coords. >- LayoutRect colRect = columnBlock.columnRectAt(colInfo, i); >- columnBlock.flipForWritingMode(colRect); >- LayoutUnit currLogicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - logicalLeft; >- currLogicalTopOffset -= blockDelta; >- >- LayoutSize offset = isHorizontal ? LayoutSize(currLogicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, currLogicalLeftOffset); >- >- colRect.moveBy(layerOffset); >- >- LayoutRect localClipRect(hitTestRect); >- localClipRect.intersect(colRect); >- >- if (!localClipRect.isEmpty() && hitTestLocation.intersects(localClipRect)) { >- RenderLayer* hitLayer = 0; >- if (!columnIndex) { >- // Apply a translation transform to change where the layer paints. >- TransformationMatrix oldTransform; >- bool oldHasTransform = childLayer->transform(); >- if (oldHasTransform) >- oldTransform = *childLayer->transform(); >- TransformationMatrix newTransform(oldTransform); >- newTransform.translateRight(offset.width(), offset.height()); >- >- childLayer->m_transform = std::make_unique<TransformationMatrix>(newTransform); >- hitLayer = childLayer->hitTestLayer(rootLayer, columnLayers[0], request, result, localClipRect, hitTestLocation, false, transformState, zOffset); >- if (oldHasTransform) >- childLayer->m_transform = std::make_unique<TransformationMatrix>(oldTransform); >- else >- childLayer->m_transform = nullptr; >- } else { >- // Adjust the transform such that the renderer's upper left corner will be at (0,0) in user space. >- // This involves subtracting out the position of the layer in our current coordinate space. >- RenderLayer* nextLayer = columnLayers[columnIndex - 1]; >- RefPtr<HitTestingTransformState> newTransformState = nextLayer->createLocalTransformState(rootLayer, nextLayer, localClipRect, hitTestLocation, transformState); >- newTransformState->translate(offset.width(), offset.height(), HitTestingTransformState::AccumulateTransform); >- FloatPoint localPoint = newTransformState->mappedPoint(); >- FloatQuad localPointQuad = newTransformState->mappedQuad(); >- LayoutRect localHitTestRect = newTransformState->mappedArea().enclosingBoundingBox(); >- HitTestLocation newHitTestLocation; >- if (hitTestLocation.isRectBasedTest()) >- newHitTestLocation = HitTestLocation(localPoint, localPointQuad); >- else >- newHitTestLocation = HitTestLocation(localPoint); >- newTransformState->flatten(); >- >- hitLayer = hitTestChildLayerColumns(childLayer, columnLayers[columnIndex - 1], request, result, localHitTestRect, newHitTestLocation, >- newTransformState.get(), zOffset, columnLayers, columnIndex - 1); >- } >- >- if (hitLayer) >- return hitLayer; >- } >- } >- >- return 0; >-} >- > void RenderLayer::updateClipRects(const ClipRectsContext& clipRectsContext) > { > ClipRectsType clipRectsType = clipRectsContext.clipRectsType; >Index: Source/WebCore/rendering/RenderLayer.h >=================================================================== >--- Source/WebCore/rendering/RenderLayer.h (revision 168316) >+++ Source/WebCore/rendering/RenderLayer.h (working copy) >@@ -515,7 +515,6 @@ public: > > void positionNewlyCreatedOverflowControls(); > >- bool isPaginated() const { return m_isPaginated; } > RenderLayer* enclosingPaginationLayer() const { return m_enclosingPaginationLayer; } > > void updateTransform(); >@@ -633,7 +632,7 @@ public: > bool canUseConvertToLayerCoords() const > { > // These RenderObject have an impact on their layers' without them knowing about it. >- return !renderer().hasColumns() && !renderer().hasTransform() && !renderer().isSVGRoot(); >+ return !renderer().hasTransform() && !renderer().isSVGRoot(); > } > > // FIXME: adjustForColumns allows us to position compositing layers in columns correctly, but eventually they need to be split across columns too. >@@ -999,8 +998,6 @@ private: > void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); > void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags); > void paintList(Vector<RenderLayer*>*, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags); >- void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags); >- void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLayers, size_t columnIndex); > > void collectFragments(LayerFragments&, const RenderLayer* rootLayer, RenderRegion*, const LayoutRect& dirtyRect, > ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, >@@ -1027,13 +1024,6 @@ private: > const LayoutRect& hitTestRect, const HitTestLocation&, > const HitTestingTransformState* transformState, double* zOffsetForDescendants, double* zOffset, > const HitTestingTransformState* unflattenedTransformState, bool depthSortDescendants); >- RenderLayer* hitTestPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, >- const LayoutRect& hitTestRect, const HitTestLocation&, >- const HitTestingTransformState* transformState, double* zOffset); >- RenderLayer* hitTestChildLayerColumns(RenderLayer* childLayer, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, >- const LayoutRect& hitTestRect, const HitTestLocation&, >- const HitTestingTransformState* transformState, double* zOffset, >- const Vector<RenderLayer*>& columnLayers, size_t columnIndex); > > RenderLayer* hitTestFixedLayersInNamedFlows(RenderLayer* rootLayer, > const HitTestRequest&, HitTestResult&, >@@ -1160,9 +1150,6 @@ private: > void drawPlatformResizerImage(GraphicsContext*, const LayoutRect& resizerCornerRect); > > void updatePagination(); >- >- // FIXME: Temporary. Remove when new columns come online. >- bool useRegionBasedColumns() const; > > void setHasCompositingDescendant(bool b) { m_hasCompositingDescendant = b; } > >@@ -1252,8 +1239,6 @@ private: > bool m_visibleDescendantStatusDirty : 1; > bool m_hasVisibleDescendant : 1; > >- bool m_isPaginated : 1; // If we think this layer is split by a multi-column ancestor, then this bit will be set. >- > bool m_3DTransformedDescendantStatusDirty : 1; > bool m_has3DTransformedDescendant : 1; // Set on a stacking context layer that has 3D descendants anywhere > // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. >Index: Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp >=================================================================== >--- Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp (working copy) >@@ -774,4 +774,11 @@ bool RenderMultiColumnFlowThread::nodeAt > return inside; > } > >+bool RenderMultiColumnFlowThread::shouldCheckColumnBreaks() const >+{ >+ if (!parent()->isRenderView()) >+ return true; >+ return view().frameView().pagination().behavesLikeColumns; >+} >+ > } >Index: Source/WebCore/rendering/RenderMultiColumnFlowThread.h >=================================================================== >--- Source/WebCore/rendering/RenderMultiColumnFlowThread.h (revision 168316) >+++ Source/WebCore/rendering/RenderMultiColumnFlowThread.h (working copy) >@@ -92,7 +92,7 @@ public: > bool progressionIsReversed() const { return m_progressionIsReversed; } > void setProgressionIsReversed(bool reversed) { m_progressionIsReversed = reversed; } > >- virtual void computeLineGridPaginationOrigin(LayoutState&) const override; >+ void computeLineGridPaginationOrigin(LayoutState&) const; > > virtual RenderRegion* mapFromFlowToRegion(TransformState&) const override; > >@@ -111,6 +111,9 @@ public: > virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const override; > virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const override; > >+ // FIXME: Eventually as column and region flow threads start nesting, this will end up changing. >+ virtual bool shouldCheckColumnBreaks() const override; >+ > private: > virtual const char* renderName() const override; > virtual void addRegionToThread(RenderRegion*) override; >Index: Source/WebCore/rendering/RenderObject.cpp >=================================================================== >--- Source/WebCore/rendering/RenderObject.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderObject.cpp (working copy) >@@ -1370,12 +1370,6 @@ void RenderObject::computeRectForRepaint > return; > > if (auto o = parent()) { >- if (o->isRenderBlockFlow()) { >- RenderBlock* cb = toRenderBlock(o); >- if (cb->hasColumns()) >- cb->adjustRectForColumns(rect); >- } >- > if (o->hasOverflowClip()) { > RenderBox* boxParent = toRenderBox(o); > boxParent->applyCachedClipAndScrollOffsetForRepaint(rect); >@@ -1619,15 +1613,10 @@ void RenderObject::mapLocalToContainer(c > LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); > if (mode & ApplyContainerFlip && o->isBox()) { > if (o->style().isFlippedBlocksWritingMode()) >- transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); >+ transformState.move(toRenderBox(o)->flipForWritingMode(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); > mode &= ~ApplyContainerFlip; > } > >- LayoutSize columnOffset; >- o->adjustForColumns(columnOffset, roundedLayoutPoint(transformState.mappedPoint())); >- if (!columnOffset.isZero()) >- transformState.move(columnOffset); >- > if (o->isBox()) > transformState.move(-toRenderBox(o)->scrolledContentOffset()); > >@@ -1647,7 +1636,7 @@ const RenderObject* RenderObject::pushMa > if (container->isBox()) > offset = -toRenderBox(container)->scrolledContentOffset(); > >- geometryMap.push(this, offset, hasColumns()); >+ geometryMap.push(this, offset, false); > > return container; > } >@@ -1720,19 +1709,16 @@ FloatPoint RenderObject::localToContaine > return transformState.lastPlanarPoint(); > } > >-LayoutSize RenderObject::offsetFromContainer(RenderObject* o, const LayoutPoint& point, bool* offsetDependsOnPoint) const >+LayoutSize RenderObject::offsetFromContainer(RenderObject* o, const LayoutPoint&, bool* offsetDependsOnPoint) const > { > ASSERT(o == container()); > > LayoutSize offset; >- >- o->adjustForColumns(offset, point); >- > if (o->isBox()) > offset -= toRenderBox(o)->scrolledContentOffset(); > > if (offsetDependsOnPoint) >- *offsetDependsOnPoint = hasColumns() || o->isRenderFlowThread(); >+ *offsetDependsOnPoint = o->isRenderFlowThread(); > > return offset; > } >Index: Source/WebCore/rendering/RenderObject.h >=================================================================== >--- Source/WebCore/rendering/RenderObject.h (revision 168316) >+++ Source/WebCore/rendering/RenderObject.h (working copy) >@@ -389,9 +389,7 @@ public: > > bool childrenInline() const { return m_bitfields.childrenInline(); } > void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } >- bool hasColumns() const { return m_bitfields.hasColumns(); } >- void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } >- >+ > enum FlowThreadState { > NotInsideFlowThread = 0, > InsideOutOfFlowThread = 1, >@@ -494,8 +492,6 @@ public: > #endif > ; > } >- bool isAnonymousColumnsBlock() const { return style().specifiesColumns() && isAnonymousBlock(); } >- bool isAnonymousColumnSpanBlock() const { return style().columnSpan() && isAnonymousBlock(); } > bool isElementContinuation() const { return node() && node()->renderer() != this; } > bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); } > bool isBlockElementContinuation() const { return isElementContinuation() && !isInline(); } >@@ -764,16 +760,6 @@ public: > virtual void computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect&, bool fixed = false) const; > virtual void computeFloatRectForRepaint(const RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed = false) const; > >- // If multiple-column layout results in applying an offset to the given point, add the same >- // offset to the given size. >- virtual void adjustForColumns(LayoutSize&, const LayoutPoint&) const { } >- LayoutSize offsetForColumns(const LayoutPoint& point) const >- { >- LayoutSize offset; >- adjustForColumns(offset, point); >- return offset; >- } >- > virtual unsigned int length() const { return 1; } > > bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); } >@@ -966,7 +952,6 @@ private: > , m_hasCounterNodeMap(false) > , m_everHadLayout(false) > , m_childrenInline(false) >- , m_hasColumns(false) > , m_positionedState(IsStaticallyPositioned) > , m_selectionState(SelectionNone) > , m_flowThreadState(NotInsideFlowThread) >@@ -1002,7 +987,6 @@ private: > > // from RenderBlock > ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); >- ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns); > > private: > unsigned m_positionedState : 2; // PositionedState >Index: Source/WebCore/rendering/RenderText.cpp >=================================================================== >--- Source/WebCore/rendering/RenderText.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderText.cpp (working copy) >@@ -1277,12 +1277,8 @@ LayoutRect RenderText::selectionRectForR > > if (clipToVisibleContent) > computeRectForRepaint(repaintContainer, rect); >- else { >- if (cb->hasColumns()) >- cb->adjustRectForColumns(rect); >- >+ else > rect = localToContainerQuad(FloatRect(rect), repaintContainer).enclosingBoundingBox(); >- } > > return rect; > } >Index: Source/WebCore/rendering/RenderView.cpp >=================================================================== >--- Source/WebCore/rendering/RenderView.cpp (revision 168316) >+++ Source/WebCore/rendering/RenderView.cpp (working copy) >@@ -21,7 +21,6 @@ > #include "config.h" > #include "RenderView.h" > >-#include "ColumnInfo.h" > #include "Document.h" > #include "Element.h" > #include "FloatQuad.h" >@@ -174,9 +173,8 @@ void RenderView::updateLogicalWidth() > > LayoutUnit RenderView::availableLogicalHeight(AvailableLogicalHeightType) const > { >- // If we have columns, then the available logical height is reduced to the column height. >- if (hasColumns()) >- return columnInfo()->columnHeight(); >+ // FIXME: Need to patch for new columns? >+ > #if PLATFORM(IOS) > // Workaround for <rdar://problem/7166808>. > if (document().isPluginDocument() && frameView().useFixedLayout()) >@@ -340,7 +338,7 @@ LayoutUnit RenderView::pageOrViewLogical > if (document().printing()) > return pageLogicalHeight(); > >- if ((hasColumns() || multiColumnFlowThread()) && !style().hasInlineColumnAxis()) { >+ if (multiColumnFlowThread() && !style().hasInlineColumnAxis()) { > if (int pageLength = frameView().pagination().pageLength) > return pageLength; > } >@@ -457,11 +455,6 @@ void RenderView::computeColumnCountAndWi > setComputedColumnCountAndWidth(1, columnWidth); > } > >-ColumnInfo::PaginationUnit RenderView::paginationUnit() const >-{ >- return frameView().pagination().behavesLikeColumns ? ColumnInfo::Column : ColumnInfo::Page; >-} >- > void RenderView::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { > // If we ever require layout but receive a paint anyway, something has gone horribly wrong. >@@ -1107,23 +1100,16 @@ bool RenderView::rootBackgroundIsEntirel > return rootObject->rendererForRootBackground().hasEntirelyFixedBackground(); > } > >-LayoutRect RenderView::unextendedBackgroundRect(RenderBox* backgroundRenderer) const >+LayoutRect RenderView::unextendedBackgroundRect(RenderBox*) const > { >- if (!hasColumns()) >- return unscaledDocumentRect(); >- >- ColumnInfo* columnInfo = this->columnInfo(); >- LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo->columnHeight() * columnInfo->columnCount()); >- if (!isHorizontalWritingMode()) >- backgroundRect = backgroundRect.transposedRect(); >- backgroundRenderer->flipForWritingMode(backgroundRect); >- >- return backgroundRect; >+ // FIXME: What is this? Need to patch for new columns? >+ return unscaledDocumentRect(); > } > > LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const > { >- if (!hasColumns() && frameView().hasExtendedBackgroundRectForPainting()) >+ // FIXME: New columns care about this? >+ if (frameView().hasExtendedBackgroundRectForPainting()) > return frameView().extendedBackgroundRectForPainting(); > > return unextendedBackgroundRect(backgroundRenderer); >@@ -1181,7 +1167,7 @@ bool RenderView::shouldDisableLayoutStat > { > RenderObject* o = renderer; > while (o) { >- if (o->hasColumns() || o->hasTransform() || o->hasReflection()) >+ if (o->hasTransform() || o->hasReflection()) > return true; > o = o->container(); > } >@@ -1380,13 +1366,7 @@ unsigned RenderView::pageNumberForBlockP > bool progressionIsInline = false; > bool progressionIsReversed = false; > >- if (hasColumns()) { >- ColumnInfo* colInfo = columnInfo(); >- if (!colInfo) >- return columnNumber; >- progressionIsInline = colInfo->progressionIsInline(); >- progressionIsReversed = colInfo->progressionIsReversed(); >- } else if (multiColumnFlowThread()) { >+ if (multiColumnFlowThread()) { > progressionIsInline = multiColumnFlowThread()->progressionIsInline(); > progressionIsReversed = multiColumnFlowThread()->progressionIsReversed(); > } else >@@ -1408,8 +1388,6 @@ unsigned RenderView::pageCount() const > if (pagination.mode == Pagination::Unpaginated) > return 0; > >- if (hasColumns()) >- return columnCount(columnInfo()); > if (multiColumnFlowThread() && multiColumnFlowThread()->firstMultiColumnSet()) > return multiColumnFlowThread()->firstMultiColumnSet()->columnCount(); > >Index: Source/WebCore/rendering/RenderView.h >=================================================================== >--- Source/WebCore/rendering/RenderView.h (revision 168316) >+++ Source/WebCore/rendering/RenderView.h (working copy) >@@ -256,18 +256,17 @@ private: > void initializeLayoutState(LayoutState&); > > virtual void computeColumnCountAndWidth() override; >- virtual ColumnInfo::PaginationUnit paginationUnit() const override; > > bool shouldRepaint(const LayoutRect&) const; > void flushAccumulatedRepaintRegion() const; > > // These functions may only be accessed by LayoutStateMaintainer. >- bool pushLayoutState(RenderBox& renderer, const LayoutSize& offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = nullptr) >+ bool pushLayoutState(RenderBox& renderer, const LayoutSize& offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false) > { > // We push LayoutState even if layoutState is disabled because it stores layoutDelta too. >- if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer.hasColumns() || renderer.flowThreadContainingBlock() >+ if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer.flowThreadContainingBlock() > || m_layoutState->lineGrid() || (renderer.style().lineGrid() != RenderStyle::initialLineGrid() && renderer.isRenderBlockFlow())) { >- m_layoutState = std::make_unique<LayoutState>(std::move(m_layoutState), &renderer, offset, pageHeight, pageHeightChanged, colInfo); >+ m_layoutState = std::make_unique<LayoutState>(std::move(m_layoutState), &renderer, offset, pageHeight, pageHeightChanged); > pushLayoutStateForCurrentFlowThread(renderer); > return true; > } >@@ -371,14 +370,14 @@ class LayoutStateMaintainer { > WTF_MAKE_NONCOPYABLE(LayoutStateMaintainer); > public: > // Constructor to push now. >- explicit LayoutStateMaintainer(RenderView& view, RenderBox& root, LayoutSize offset, bool disableState = false, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = nullptr) >+ explicit LayoutStateMaintainer(RenderView& view, RenderBox& root, LayoutSize offset, bool disableState = false, LayoutUnit pageHeight = 0, bool pageHeightChanged = false) > : m_view(view) > , m_disabled(disableState) > , m_didStart(false) > , m_didEnd(false) > , m_didCreateLayoutState(false) > { >- push(root, offset, pageHeight, pageHeightChanged, colInfo); >+ push(root, offset, pageHeight, pageHeightChanged); > } > > // Constructor to maybe push later. >@@ -396,11 +395,11 @@ public: > ASSERT(m_didStart == m_didEnd); // if this fires, it means that someone did a push(), but forgot to pop(). > } > >- void push(RenderBox& root, LayoutSize offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = nullptr) >+ void push(RenderBox& root, LayoutSize offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false) > { > ASSERT(!m_didStart); > // We push state even if disabled, because we still need to store layoutDelta >- m_didCreateLayoutState = m_view.pushLayoutState(root, offset, pageHeight, pageHeightChanged, colInfo); >+ m_didCreateLayoutState = m_view.pushLayoutState(root, offset, pageHeight, pageHeightChanged); > if (m_disabled && m_didCreateLayoutState) > m_view.disableLayoutState(); > m_didStart = true; >Index: Source/WebCore/rendering/SimpleLineLayout.cpp >=================================================================== >--- Source/WebCore/rendering/SimpleLineLayout.cpp (revision 168316) >+++ Source/WebCore/rendering/SimpleLineLayout.cpp (working copy) >@@ -115,9 +115,6 @@ bool canUseFor(const RenderBlockFlow& fl > // FIXME: Placeholders do something strange. > if (flow.parent()->isTextControl() && toRenderTextControl(*flow.parent()).textFormControlElement().placeholderElement()) > return false; >- // These tests only works during layout. Outside layout this function may give false positives. >- if (flow.view().layoutState() && flow.view().layoutState()->m_columnInfo) >- return false; > const RenderStyle& style = flow.style(); > if (style.textDecorationsInEffect() != TextDecorationNone) > return false; >Index: Source/WebCore/rendering/svg/RenderSVGText.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGText.cpp (revision 168316) >+++ Source/WebCore/rendering/svg/RenderSVGText.cpp (working copy) >@@ -398,7 +398,7 @@ void RenderSVGText::layout() > ASSERT(!simplifiedLayout()); > ASSERT(!scrollsOverflow()); > ASSERT(!hasControlClip()); >- ASSERT(!hasColumns()); >+ ASSERT(!multiColumnFlowThread()); > ASSERT(!positionedObjects()); > ASSERT(!m_overflow); > ASSERT(!isAnonymousBlock()); >Index: Source/WebCore/style/StyleResolveForDocument.cpp >=================================================================== >--- Source/WebCore/style/StyleResolveForDocument.cpp (revision 168316) >+++ Source/WebCore/style/StyleResolveForDocument.cpp (working copy) >@@ -89,7 +89,7 @@ PassRef<RenderStyle> resolveForDocument( > if (pagination.mode != Pagination::Unpaginated) { > documentStyle.get().setColumnStylesFromPaginationMode(pagination.mode); > documentStyle.get().setColumnGap(pagination.gap); >- if (renderView.hasColumns() || renderView.multiColumnFlowThread()) >+ if (renderView.multiColumnFlowThread()) > renderView.updateColumnProgressionFromStyle(&documentStyle.get()); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
buildbot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 132480
:
230684
|
230692
|
230698
|
230699
|
230861
|
230874
|
230877
|
230881
|
230882
|
230925