Changeset 119548 in webkit
- Timestamp:
- Jun 5, 2012 6:51:08 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r119547 r119548 1 2012-06-05 Vitaly Buka <vitalybuka@chromium.org> 2 3 Special layout handler should be done on top frame being printed. 4 https://bugs.webkit.org/show_bug.cgi?id=88201 5 6 Reviewed by Brady Eidson. 7 8 No new tests. Root case is already covered by tests. 9 Case described in the issue can be reproduced only by direct call 10 to Frame::setPrinting of subframe. Probably it's not possible with 11 layout tests. 12 13 * page/Frame.cpp: 14 (WebCore::Frame::setPrinting): 15 Use shouldUsePrintingLayout to choose proper version of forceLayout(). 16 (WebCore::Frame::shouldUsePrintingLayout): 17 Checks if current frame is the top frame being printed. 18 * rendering/RenderView.cpp: 19 (WebCore::RenderView::shouldUsePrintingLayout): Forward to Frame. 20 1 21 2012-06-05 Max Feil <mfeil@rim.com> 2 22 -
trunk/Source/WebCore/page/Frame.cpp
r119225 r119548 523 523 524 524 m_doc->styleResolverChanged(RecalcStyleImmediately); 525 if (printing && !tree()->parent()) { 526 // Only root frame should be fit to page size. Subframes should be constrained by parents only. 525 if (shouldUsePrintingLayout()) { 527 526 view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize); 528 527 } else { … … 535 534 for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling()) 536 535 child->setPrinting(printing, FloatSize(), FloatSize(), 0, shouldAdjustViewSize); 536 } 537 538 bool Frame::shouldUsePrintingLayout() const 539 { 540 // Only top frame being printed should be fit to page size. 541 // Subframes should be constrained by parents only. 542 return m_doc->printing() && (!tree()->parent() || !tree()->parent()->m_doc->printing()); 537 543 } 538 544 -
trunk/Source/WebCore/page/Frame.h
r119225 r119548 142 142 143 143 void setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot); 144 bool shouldUsePrintingLayout() const; 144 145 FloatSize resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize); 145 146 -
trunk/Source/WebCore/rendering/RenderView.cpp
r118569 r119548 657 657 return false; 658 658 Frame* frame = m_frameView->frame(); 659 // Only root frame should have special handling for printing. 660 return frame && !frame->tree()->parent(); 659 return frame && frame->shouldUsePrintingLayout(); 661 660 } 662 661
Note: See TracChangeset
for help on using the changeset viewer.