[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2017 17:45:09 +0000 (17:45 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2017 17:45:09 +0000 (17:45 +0000)
commit46119c542f711ec1cae97a44eabed8fae7195f50
tree0429468a35a38b17678a4022598f63f36c5e9d16
parentb48ad7db663265e5e4e2a2499f7c67f0adfe3d55
[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
https://bugs.webkit.org/show_bug.cgi?id=179282
<rdar://problem/35348653>

Reviewed by Antti Koivisto.

LayoutContext now owns the top level LayoutState object.
It makes RenderView behave like any other renderer by constructing a LayoutStateMaintainer on the stack.
This is mostly moving code from RenderView.h/.cpp to LayoutContext.h/.cpp and fixing the callsites.
(While view().frameView().layoutContext().layoutState() is a bit lengthy, it's
temporary only, since LayoutState is planned to be an argument of the layout() method.

Covered by existing test.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layoutDelta const):
(WebCore::LayoutContext::addLayoutDelta):
(WebCore::LayoutContext::layoutDeltaMatches):
(WebCore::LayoutContext::pushLayoutState):
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::LayoutContext::popLayoutState):
(WebCore::LayoutContext::checkLayoutState):
* page/LayoutContext.h:
(WebCore::LayoutContext::layoutState const):
(WebCore::LayoutContext::layoutStateEnabled const):
(WebCore::LayoutContext::disableLayoutState):
(WebCore::LayoutContext::enableLayoutState):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::setLogicalLeftForChild):
(WebCore::RenderBlock::setLogicalTopForChild):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
(WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
(WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::hasNextPage const):
(WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
(WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::outlineBoundsForRepaint const):
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::clippedOverflowRectForRepaint const):
(WebCore::RenderBox::computeRectForRepaint const):
(WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::layoutChildIfNeededApplyingDelta):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderEmbeddedObject.cpp:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
* rendering/RenderGrid.cpp:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeRectForRepaint const):
(WebCore::RenderInline::mapLocalToContainer const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::layout):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
(WebCore::RenderMediaControlTimelineContainer::layout):
(WebCore::RenderTextTrackContainerElement::layout):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintRectangle const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
(WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::clippedOverflowRectForRepaint const):
(WebCore::RenderTableCell::computeRectForRepaint const):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::setLogicalPositionForCell const):
* rendering/RenderVTTCue.cpp:
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
(WebCore::RenderView::layoutContent): Deleted.
(WebCore::RenderView::checkLayoutState): Deleted.
(WebCore::RenderView::initializeLayoutState): Deleted.
(WebCore::RenderView::pushLayoutState): Deleted.
(WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): Deleted.
* rendering/RenderView.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSnapAdjustment const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::layout):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::layout):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::RenderTreeUpdater::FirstLetter::update):
* style/RenderTreeUpdaterListItem.cpp:
(WebCore::RenderTreeUpdater::ListItem::updateMarker):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/page/LayoutContext.cpp
Source/WebCore/page/LayoutContext.h
Source/WebCore/rendering/LayoutState.cpp
Source/WebCore/rendering/LayoutState.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFragmentedFlow.cpp
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderMediaControlElements.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderVTTCue.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp
Source/WebCore/style/RenderTreeUpdaterListItem.cpp