FrameView should not set RenderView::logicalWidth directly for printing
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jul 2017 17:58:36 +0000 (17:58 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jul 2017 17:58:36 +0000 (17:58 +0000)
commit2e814ec238c537a89d7a3c46f3a66ebe628dc750
treeb64aeb2569ff2826c52b5d4be6fa2ec686c99d99
parent3f839f0a7ccad2307b4bf20192b2a93de99a019a
FrameView should not set RenderView::logicalWidth directly for printing
https://bugs.webkit.org/show_bug.cgi?id=174135

Reviewed by Zalan Bujtas.

Source/WebCore:

Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means
that we don't layout children in all cases when the width changes. This is currently mostly hidden
by spurious layouts but causes problems when trying to fix other things that reduces those.

* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):

    Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width
    and the height uniformly.

* rendering/RenderView.cpp:
(WebCore::RenderView::updateLogicalWidth):

    Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely.
    This ensures that the layout will progress to children when the page logical width changes.

(WebCore::RenderView::initializeLayoutState):
(WebCore::RenderView::layout):
(WebCore::RenderView::pageOrViewLogicalHeight):
(WebCore::RenderView::setPageLogicalSize):
* rendering/RenderView.h:

    Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize.

LayoutTests:

* platform/mac/printing/width-overflow-expected.txt:

    This is a progression, view and root element sizes now match.
    Printing output is not affected.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/printing/width-overflow-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h