diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 23401a08b1a..66abfae1108 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -921,7 +921,10 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext, GetFrameType(getter_AddRefs(fType)); // split an image frame but not an image control frame if (nsLayoutAtoms::imageFrame == fType.get()) { - aMetrics.height = aReflowState.availableHeight; + float p2t; + aPresContext->GetScaledPixelsToTwips(&p2t); + // our desired height was greater than 0, so to avoid infinite splitting, use 1 pixel as the min + aMetrics.height = PR_MAX(NSToCoordRound(p2t), aReflowState.availableHeight); aStatus = NS_FRAME_NOT_COMPLETE; } } diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 23401a08b1a..66abfae1108 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -921,7 +921,10 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext, GetFrameType(getter_AddRefs(fType)); // split an image frame but not an image control frame if (nsLayoutAtoms::imageFrame == fType.get()) { - aMetrics.height = aReflowState.availableHeight; + float p2t; + aPresContext->GetScaledPixelsToTwips(&p2t); + // our desired height was greater than 0, so to avoid infinite splitting, use 1 pixel as the min + aMetrics.height = PR_MAX(NSToCoordRound(p2t), aReflowState.availableHeight); aStatus = NS_FRAME_NOT_COMPLETE; } } diff --git a/mozilla/layout/html/tests/table/images/pc.gif b/mozilla/layout/html/tests/table/images/pc.gif new file mode 100644 index 00000000000..da26d7092e2 Binary files /dev/null and b/mozilla/layout/html/tests/table/images/pc.gif differ diff --git a/mozilla/layout/html/tests/table/printing/bug124041.html b/mozilla/layout/html/tests/table/printing/bug124041.html new file mode 100644 index 00000000000..d9f2f52e114 --- /dev/null +++ b/mozilla/layout/html/tests/table/printing/bug124041.html @@ -0,0 +1,9 @@ + + + + +
+ +
diff --git a/mozilla/layout/html/tests/table/printing/bug124041_iframe.html b/mozilla/layout/html/tests/table/printing/bug124041_iframe.html new file mode 100644 index 00000000000..870ba6e93e3 --- /dev/null +++ b/mozilla/layout/html/tests/table/printing/bug124041_iframe.html @@ -0,0 +1,19 @@ + + + + + + + + + + +
+ Click here for 100,000+ Clipart images.
+
+ + + +
+
+
diff --git a/mozilla/layout/html/tests/table/printing/file_list.txt b/mozilla/layout/html/tests/table/printing/file_list.txt index ebfafe09ef5..e2fa757248d 100644 --- a/mozilla/layout/html/tests/table/printing/file_list.txt +++ b/mozilla/layout/html/tests/table/printing/file_list.txt @@ -2,6 +2,7 @@ file:///s|/mozilla/layout/html/tests/table/printing/bug102784.html file:///s|/mozilla/layout/html/tests/table/printing/bug105166.html file:///s|/mozilla/layout/html/tests/table/printing/bug111028.html +file:///s|/mozilla/layout/html/tests/table/printing/bug124041.html file:///s|/mozilla/layout/html/tests/table/printing/bug53690.html file:///s|/mozilla/layout/html/tests/table/printing/bug54829.html file:///s|/mozilla/layout/html/tests/table/printing/bug57378.html