Nothing printed when specifying a very large maximum layout width
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jul 2011 22:49:32 +0000 (22:49 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jul 2011 22:49:32 +0000 (22:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64831

Reviewed by Beth Dakin.

I am not adding a test because the DumpRenderTree printing test machinery is based on PrintContext,
which does not exercise the code path on which this bug lies.

* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination): Fixed an integer overflow.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp

index 6d058a2..c654e69 100644 (file)
@@ -1,3 +1,16 @@
+2011-07-19  Dan Bernstein  <mitz@apple.com>
+
+        Nothing printed when specifying a very large maximum layout width
+        https://bugs.webkit.org/show_bug.cgi?id=64831
+
+        Reviewed by Beth Dakin.
+
+        I am not adding a test because the DumpRenderTree printing test machinery is based on PrintContext,
+        which does not exercise the code path on which this bug lies.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::forceLayoutForPagination): Fixed an integer overflow.
+
 2011-07-19  Nate Chapin  <japhet@chromium.org>
 
         [V8] Wait until no v8 context is on the stack before
index fc33098..7c95380 100644 (file)
@@ -2632,7 +2632,7 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, float maximu
         bool horizontalWritingMode = root->style()->isHorizontalWritingMode();
         int docLogicalWidth = horizontalWritingMode ? root->documentRect().width() : root->documentRect().height();
         if (docLogicalWidth > pageLogicalWidth) {
-            flooredPageLogicalWidth = std::min<int>(docLogicalWidth, pageLogicalWidth * maximumShrinkFactor);
+            flooredPageLogicalWidth = std::min<float>(docLogicalWidth, pageLogicalWidth * maximumShrinkFactor);
             if (pageLogicalHeight)
                 root->setPageLogicalHeight(flooredPageLogicalWidth / pageSize.width() * pageSize.height());
             root->setLogicalWidth(flooredPageLogicalWidth);