haikuwebkit/LayoutTests/printing/single-line-must-not-be-spl...

51 lines
1.9 KiB
HTML
Raw Permalink Normal View History

A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
<html>
<head>
</head>
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
<style>
/* relative positioning ensures underlying RenderLayer */
.renderingArea {
position: relative;
}
</style>
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
<body>
<p>
A single line must not be split into two pages.
This test checks if a single line is not split into two pages.
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
To run this test manually, comment out the last two lines of JavaScript
(See the comment in JavaScript) and then print this page.
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
If no lines are split into two pages, the test passes.
</p>
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
<div class="renderingArea" id="renderingArea1"></div>
<div class="renderingArea" id="renderingArea2"></div>
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
<p>Non-overflowed lines:</p>
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
<pre id="nonOverflowedLines"></pre>
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
<p>Overflowed lines:</p>
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
<pre id="overflowedLines"></pre>
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
<script>
Use testRunner instead of layoutTestController in networkinformation, perf, plugins, pointer-lock, printing, scrollbars, and security tests https://bugs.webkit.org/show_bug.cgi?id=89181 Reviewed by Kent Tamura. * perf/clone-with-focus.html: * perf/nested-combined-selectors.html: * perf/table-rows-length-caching.html: * platform/chromium/plugins/call-as-function.html: * platform/chromium/plugins/get-url-with-blank-target2.html: * platform/chromium/plugins/get-url-with-iframe-target-no-crash.html: * platform/chromium/printing/custom-page-size-style-expected.txt: * platform/chromium/printing/custom-page-size-style.html: * platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html: * platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html: * platform/mac-wk2/plugins/contents-scale-factor.html: * platform/mac-wk2/plugins/mouse-events-scaled.html: * platform/mac/plugins/bindings-array-apply-crash.html: * platform/mac/plugins/bindings-objc-long-method-name.html: * platform/mac/plugins/bindings-objc-method-name-conversion.html: * platform/mac/plugins/bindings-test-objc.html: * platform/mac/plugins/call-as-function-test.html: * platform/mac/plugins/convert-point.html: * platform/mac/plugins/disable-plugins.html: * platform/mac/plugins/jsobjc-dom-wrappers.html: * platform/mac/plugins/jsobjc-simple.html: * platform/mac/plugins/pluginDocumentView-deallocated-dataSource.html-disabled: * platform/mac/plugins/root-object-premature-delete-crash.html: * platform/mac/plugins/supports-carbon-event-model.html: * platform/mac/plugins/testplugin-onnew-onpaint.html: * platform/mac/plugins/throw-on-dealloc.html: * platform/mac/plugins/undefined-property-crash.html: * platform/mac/plugins/update-widget-from-style-recalc.html: * platform/mac/plugins/webScriptObject-exception-deadlock.html: * platform/mac/scrollbars/key-window-not-first-responder.html: * platform/qt/plugins/application-plugin-plugins-disabled.html: * platform/win/plugins/call-javascript-that-destroys-plugin.html: * platform/win/plugins/get-value-netscape-window.html: * platform/win/plugins/iframe-inside-overflow.html: * platform/win/plugins/npn-invalidate-rect-invalidates-window.html: * platform/win/plugins/visibility-hidden.html: * platform/win/plugins/window-geometry-initialized-before-set-window.html: * platform/win/plugins/window-region-is-set-to-clip-rect.html: * platform/win/plugins/windowless-paint-rect-coordinates.html: * plugins/: * pointer-lock/lock-fail-responses-expected.txt: * pointer-lock/lock-fail-responses.html: * pointer-lock/pointer-lock-api.html: * pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt: * pointer-lock/pointerlockchange-pointerlockerror-events.html: * pointer-lock/pointerlocklost-event-expected.txt: * pointer-lock/pointerlocklost-event.html: * printing/compositing-layer-printing.html: * printing/css2.1/README.txt: * printing/css2.1/page-break-after-000.html: * printing/css2.1/page-break-after-001.html: * printing/css2.1/page-break-after-002.html: * printing/css2.1/page-break-after-003.html: * printing/css2.1/page-break-after-004.html: * printing/css2.1/page-break-before-000.html: * printing/css2.1/page-break-before-001.html: * printing/css2.1/page-break-before-002.html: * printing/css2.1/page-break-inside-000.html: * printing/iframe-print.html: * printing/media-queries-print.html: * printing/numberOfPages-expected.txt: * printing/page-count-layout-overflow.html: * printing/page-count-relayout-shrink.html: * printing/page-count-with-one-word.html: * printing/page-format-data-display-none.html: * printing/page-format-data-expected.txt: * printing/page-format-data.html: * printing/page-rule-css-text.html: * printing/page-rule-in-media-query.html: * printing/page-rule-selection-expected.txt: * printing/page-rule-selection.html: * printing/pageNumerForElementById-expected.txt: * printing/print-close-crash.html: * printing/pseudo-class-outside-page.html: * printing/resources/paged-media-test-utils.js: (pageNumberForElementShouldBe): (numberOfPagesShouldBe): (runPrintingTest): * printing/return-from-printing-mode.html: * printing/script-tests/numberOfPages.js: * printing/script-tests/pageNumerForElementById.js: * printing/setPrinting.html: * printing/simultaneous-position-float-change.html: * printing/single-line-must-not-be-split-into-two-pages.html: * printing/width-overflow.html: * printing/zoomed-document.html: * scrollbars/hidden-iframe-scrollbar-crash.html: * scrollbars/hidden-iframe-scrollbar-crash2.html: * scrollbars/hidden-scrollbar-prevents-layout.html: * scrollbars/overflow-custom-scrollbar-crash.html: * scrollbars/resources/hidden-iframe-scrollbar-crash2.html: * scrollbars/scroll-rtl-or-bt-layer.html: * scrollbars/scrollable-iframe-remove-crash.html: * scrollbars/scrollbar-click-does-not-blur-content.html: * scrollbars/scrollbar-crash-on-refresh.html: * scrollbars/scrollbar-drag-thumb-with-large-content.html: * scrollbars/scrollbar-gradient-crash.html: * scrollbars/scrollbar-iframe-click-does-not-blur-content.html: * scrollbars/scrollbar-initial-position.html: * scrollbars/scrollbar-middleclick-nopaste.html: * scrollbars/scrollbar-miss-mousemove-disabled.html: * scrollbars/scrollbar-miss-mousemove.html: * scrollbars/scrollbar-owning-renderer-crash.html: * scrollbars/scrollbar-part-created-with-no-parent-crash.html: * scrollbars/scrollbar-percent-padding-crash.html: * scrollbars/scrollbar-scrollbarparts-repaint-crash.html: * scrollbars/scrollevent-iframe-no-scrolling-wheel.html: * scrollbars/scrollevent-iframe-no-scrolling.html: * security/autocomplete-cleared-on-back.html: * security/block-test-no-port.html: * security/block-test.html: * security/set-form-autocomplete-attribute.html: Canonical link: https://commits.webkit.org/107031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-15 07:38:37 +00:00
if (window.testRunner)
testRunner.dumpAsText();
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
var str = "";
for (var i = 0; i < 400; i++) {
str += "WWWWWW<br />";
}
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
document.getElementById("renderingArea1").innerHTML = str;
if (window.internals)
document.getElementById("nonOverflowedLines").innerText = window.internals.elementRenderTreeAsText(document.getElementById("renderingArea1"));
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
str = "";
for (var i = 0; i < 400; i++) {
str += "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW<br />";
}
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
document.getElementById("renderingArea2").innerHTML = str;
if (window.internals)
document.getElementById("overflowedLines").innerText = window.internals.elementRenderTreeAsText(document.getElementById("renderingArea2"));
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
Use dumpAsText() to avoid an image result being generated https://bugs.webkit.org/show_bug.cgi?id=71386 Reviewed by Tony Chang. single-line-must-not-be-split-into-two-pages.html had been producing a huge image result. What we need is a way by which we can generate a DumpRenderTree result but do not generate an image even if --pixel-test option is specified for ./Tools/Scripts/new-run-webkit-tests. This patch realizes it using dumpAsText() and window.internals.elementRenderTreeAsText. * printing/single-line-must-not-be-split-into-two-pages.html: Used dumpAsText() and window.internals.elementRenderTreeAsText. * platform/chromium-cg-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-cg-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-linux/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-leopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-mac-snowleopard/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.png: Removed. * platform/chromium-win/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Updated a test result. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Ditto. Canonical link: https://commits.webkit.org/88337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-11-09 23:40:17 +00:00
// To test manually, comment out the following two lines,
// print this page, and check if no lines are split across two pages.
document.getElementById("renderingArea1").innerHTML = "";
document.getElementById("renderingArea2").innerHTML = "";
A single line must not be split into two pages. https://bugs.webkit.org/show_bug.cgi?id=65005 Reviewed by David Hyatt. When the document width of a page is overflowed, the last line of the page can be split into the next page. This is the regression caused by r88737. r88737 tried to fix rounding errors in rendering calculations by expanding and shrinking a page using one common method, resizePageRectsKeepingRatio(), but overlooked the case where a document width gets overflowed. Source/WebCore: This patch fixes the problem by also using resizePageRectsKeepingRatio() for the case where the document width gets overflowed. Test: printing/single-line-must-not-be-split-into-two-pages.html * WebCore.exp.in: Updated the signature of forceLayoutForPagination(). * page/Frame.cpp: (WebCore::Frame::setPrinting): Added a new argument |originalPageSize|, which is an original page size before being expanded or shrunk. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): Uses resizePageRectsKeepingRatio() in the case where the document width gets overflowed. * page/FrameView.h: * page/PrintContext.cpp: (WebCore::PrintContext::begin): Passes an original page size to setPrinting(). (WebCore::PrintContext::end): Ditto. Source/WebKit/mac: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Passes an original page size to setPrinting(). (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Ditto. (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Ditto. (-[WebHTMLView _endPrintMode]): Ditto. (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): Ditto. (-[WebHTMLView _endScreenPaginationMode]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]): Ditto. (-[WebHTMLView layout]): Ditto. (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView setPageWidthForPrinting:]): Ditto. Source/WebKit/win: Test: printing/single-line-must-not-be-split-into-two-pages.html * WebFrame.cpp: (WebFrame::setPrinting): Passes an original page size to setPrinting(). (WebFrame::setInPrintingMode): Ditto. * WebFrame.h: LayoutTests: The added test checks if the last line does not split across pages. * platform/chromium/test_expectations.txt: Skipped the added test since setPrinting() is not yet implemented. * platform/gtk/Skipped: Ditto. * platform/mac/printing/single-line-must-not-be-split-into-two-pages-expected.txt: Added. * platform/qt/Skipped: Ditto. * platform/win/Skipped: Ditto. * platform/wk2/Skipped: Ditto. * printing/single-line-must-not-be-split-into-two-pages.html: Added. Canonical link: https://commits.webkit.org/84121@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-16 01:17:37 +00:00
</script>
</body>
</html>