LayoutTests/ChangeLog

 12011-03-25 Dimitri Glazkov <dglazkov@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION(r77257): Only first page of a document is printed
 6 https://bugs.webkit.org/show_bug.cgi?id=56958
 7
 8 * printing/page-count-layout-overflow-expected.txt: Added.
 9 * printing/page-count-layout-overflow.html: Added.
 10
1112011-03-25 Vsevolod Vlasov <vsevik@chromium.org>
212
313 Reviewed by Pavel Feldman.

LayoutTests/printing/page-count-layout-overflow-expected.txt

 1When printing, layout overflow must be cleared after current document size is queried: PASS

LayoutTests/printing/page-count-layout-overflow.html

 1<html>
 2<head>
 3<style type="text/css">
 4
 5p {
 6 font-size: xx-large;
 7 width: 1000px;
 8 height: 100px;
 9}
 10
 11</style>
 12<script type="text/javascript">
 13
 14function runTest()
 15{
 16 if (!window.layoutTestController)
 17 return;
 18
 19 layoutTestController.dumpAsText();
 20 var lines = [ 'line<br>' ];
 21 for (var i = 0; i < 7; i++)
 22 lines = lines.concat(lines);
 23 document.body.innerHTML = '<p>' + lines.join('') + '</p>';
 24 document.body.textContent = 'When printing, layout overflow must be cleared after current document size is queried: ' + (layoutTestController.numberOfPages() > 1 ? 'PASS' : 'FAIL');
 25}
 26
 27</script>
 28<head>
 29<body onload="runTest()">
 30This test needs window.layoutTestController to run.
 31</body>
 32</html>

Source/WebCore/ChangeLog

 12011-03-25 Dave Hyatt <hyatt@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION(r77257): Only first page of a document is printed
 6 https://bugs.webkit.org/show_bug.cgi?id=56958
 7
 8 Test: printing/page-count-layout-overflow.html
 9
 10 * page/FrameView.cpp:
 11 (WebCore::FrameView::forceLayoutForPagination): Moved clearing of overflow
 12 to the right place.
 13
1142011-03-25 Vsevolod Vlasov <vsevik@chromium.org>
215
316 Reviewed by Pavel Feldman.

Source/WebCore/page/FrameView.cpp

@@void FrameView::forceLayoutForPagination(const FloatSize& pageSize, float maximu
24202420 root->setLogicalWidth(flooredPageLogicalWidth);
24212421 root->setNeedsLayoutAndPrefWidthsRecalc();
24222422 forceLayout();
2423  root->clearLayoutOverflow();
24242423 int docLogicalHeight = root->style()->isHorizontalWritingMode() ? root->docHeight() : root->docWidth();
24252424 int docLogicalTop = root->style()->isHorizontalWritingMode() ? root->docTop() : root->docLeft();
24262425 int docLogicalRight = root->style()->isHorizontalWritingMode() ? root->docRight() : root->docBottom();

@@void FrameView::forceLayoutForPagination(const FloatSize& pageSize, float maximu
24302429 IntRect overflow(clippedLogicalLeft, docLogicalTop, flooredPageLogicalWidth, docLogicalHeight);
24312430 if (!root->style()->isHorizontalWritingMode())
24322431 overflow = overflow.transposedRect();
 2432 root->clearLayoutOverflow();
24332433 root->addLayoutOverflow(overflow); // This is how we clip in case we overflow again.
24342434 }
24352435 }