Changeset 219121 in webkit
- Timestamp:
- Jul 4, 2017, 10:58:36 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac/printing/width-overflow-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderView.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderView.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r219114 r219121 1 2017-07-04 Antti Koivisto <antti@apple.com> 2 3 FrameView should not set RenderView::logicalWidth directly for printing 4 https://bugs.webkit.org/show_bug.cgi?id=174135 5 6 Reviewed by Zalan Bujtas. 7 8 * platform/mac/printing/width-overflow-expected.txt: 9 10 This is a progression, view and root element sizes now match. 11 Printing output is not affected. 12 1 13 2017-07-03 Saam Barati <sbarati@apple.com> 2 14 -
trunk/LayoutTests/platform/mac/printing/width-overflow-expected.txt
r177774 r219121 1 1 layer at (0,0) size 1300x2284 2 2 RenderView at (0,0) size 1300x2284 3 layer at (0,0) size 981x22844 RenderBlock {HTML} at (0,0) size 981x22845 RenderBody {BODY} at (0,16) size 981x22526 RenderBlock {P} at (0,0) size 981x183 layer at (0,0) size 1300x2284 4 RenderBlock {HTML} at (0,0) size 1300x2284 5 RenderBody {BODY} at (0,16) size 1300x2252 6 RenderBlock {P} at (0,0) size 1300x18 7 7 RenderText {#text} at (0,0) size 765x18 8 8 text run at (0,0) width 765: "To run this test manually, print this page. If the right side of any lines is printed without being truncated, the test passes." -
trunk/Source/WebCore/ChangeLog
r219116 r219121 1 2017-07-04 Antti Koivisto <antti@apple.com> 2 3 FrameView should not set RenderView::logicalWidth directly for printing 4 https://bugs.webkit.org/show_bug.cgi?id=174135 5 6 Reviewed by Zalan Bujtas. 7 8 Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means 9 that we don't layout children in all cases when the width changes. This is currently mostly hidden 10 by spurious layouts but causes problems when trying to fix other things that reduces those. 11 12 * page/FrameView.cpp: 13 (WebCore::FrameView::forceLayoutForPagination): 14 15 Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width 16 and the height uniformly. 17 18 * rendering/RenderView.cpp: 19 (WebCore::RenderView::updateLogicalWidth): 20 21 Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely. 22 This ensures that the layout will progress to children when the page logical width changes. 23 24 (WebCore::RenderView::initializeLayoutState): 25 (WebCore::RenderView::layout): 26 (WebCore::RenderView::pageOrViewLogicalHeight): 27 (WebCore::RenderView::setPageLogicalSize): 28 * rendering/RenderView.h: 29 30 Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize. 31 1 32 2017-07-04 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 33 -
trunk/Source/WebCore/page/FrameView.cpp
r219108 r219121 4677 4677 float pageLogicalHeight = renderView->style().isHorizontalWritingMode() ? pageSize.height() : pageSize.width(); 4678 4678 4679 renderView->setLogicalWidth(floor(pageLogicalWidth)); 4680 renderView->setPageLogicalHeight(floor(pageLogicalHeight)); 4679 renderView->setPageLogicalSize({ floor(pageLogicalWidth), floor(pageLogicalHeight) }); 4681 4680 renderView->setNeedsLayoutAndPrefWidthsRecalc(); 4682 4681 forceLayout(); … … 4696 4695 pageLogicalHeight = horizontalWritingMode ? maxPageSize.height() : maxPageSize.width(); 4697 4696 4698 renderView->setLogicalWidth(floor(pageLogicalWidth)); 4699 renderView->setPageLogicalHeight(floor(pageLogicalHeight)); 4697 renderView->setPageLogicalSize({ floor(pageLogicalWidth), floor(pageLogicalHeight) }); 4700 4698 renderView->setNeedsLayoutAndPrefWidthsRecalc(); 4701 4699 forceLayout(); -
trunk/Source/WebCore/rendering/RenderView.cpp
r218480 r219121 218 218 void RenderView::updateLogicalWidth() 219 219 { 220 if (!shouldUsePrintingLayout()) 221 setLogicalWidth(viewLogicalWidth()); 220 setLogicalWidth(shouldUsePrintingLayout() ? m_pageLogicalSize->width() : LayoutUnit(viewLogicalWidth())); 222 221 } 223 222 … … 269 268 state.m_clipped = false; 270 269 271 state.m_pageLogicalHeight = m_pageLogical Height;270 state.m_pageLogicalHeight = m_pageLogicalSize ? m_pageLogicalSize->height() : LayoutUnit(0); 272 271 state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged; 273 272 ASSERT(state.m_pageLogicalHeight >= 0); … … 340 339 StackStats::LayoutCheckPoint layoutCheckPoint; 341 340 if (!document().paginated()) 342 setPageLogicalHeight(0); 343 344 if (shouldUsePrintingLayout()) 345 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth(); 341 m_pageLogicalSize = { }; 342 343 if (shouldUsePrintingLayout()) { 344 ASSERT(m_pageLogicalSize); 345 m_minPreferredLogicalWidth = m_pageLogicalSize->width(); 346 m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth; 347 } 346 348 347 349 // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account. … … 387 389 { 388 390 if (document().printing()) 389 return pageLogicalHeight();391 return m_pageLogicalSize->height(); 390 392 391 393 if (multiColumnFlowThread() && !style().hasInlineColumnAxis()) { … … 1220 1222 } 1221 1223 1224 void RenderView::setPageLogicalSize(LayoutSize size) 1225 { 1226 if (!m_pageLogicalSize || m_pageLogicalSize->height() != size.height()) 1227 m_pageLogicalHeightChanged = true; 1228 1229 m_pageLogicalSize = size; 1230 } 1231 1222 1232 float RenderView::zoomFactor() const 1223 1233 { -
trunk/Source/WebCore/rendering/RenderView.h
r216001 r219121 142 142 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; 143 143 144 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } 145 void setPageLogicalHeight(LayoutUnit height) 146 { 147 if (m_pageLogicalHeight != height) { 148 m_pageLogicalHeight = height; 149 m_pageLogicalHeightChanged = true; 150 } 151 } 144 void setPageLogicalSize(LayoutSize); 152 145 LayoutUnit pageOrViewLogicalHeight() const; 153 146 … … 372 365 373 366 std::unique_ptr<ImageQualityController> m_imageQualityController; 374 LayoutUnit m_pageLogicalHeight;367 std::optional<LayoutSize> m_pageLogicalSize; 375 368 bool m_pageLogicalHeightChanged { false }; 376 369 std::unique_ptr<LayoutState> m_layoutState;
Note:
See TracChangeset
for help on using the changeset viewer.