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 @@ +
| + + | +
+ ![]() + |
|
+ + |