Assertion failure: scaleX > 0.0f && scaleX <= 1.0f && scaleY > 0.0f && scaleY <= 1.0f, at layout/generic/nsPageFrame.cpp:721
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: dholbert, Unassigned)
Details
(Keywords: assertion, testcase)
Attachments
(2 files)
STR:
- Load attached testcase in a debug build.
- Choose a real printer as your print target (not Firefox's "Save to PDF" print backend)
- Expand the "More Settings" and choose 2 or 4 for "pages per sheet".
ACTUAL RESULTS:
Fatal assertion-failure:
Assertion failure: scaleX > 0.0f && scaleX <= 1.0f && scaleY > 0.0f && scaleY <= 1.0f, at /builds/worker/checkouts/gecko/layout/generic/nsPageFrame.cpp:721
EXPECTED RESULTS:
No such fatal assertion-failure.
| Reporter | ||
Comment 1•9 months ago
•
|
||
Source reference:
https://searchfox.org/firefox-main/rev/d77116a11ffef8f77def09a5dd6082c2c2105f35/layout/generic/nsPageFrame.cpp#705-706,717-721
const nscoord cellWidth = sheetFrame->GetGridCellWidth();
const nscoord cellHeight = sheetFrame->GetGridCellHeight();
...
// Scale the page to fit, centered, in the grid cell:
float scaleX = float(cellWidth) / float(contentPageSize.width);
float scaleY = float(cellHeight) / float(contentPageSize.height);
MOZ_ASSERT(scaleX > 0.0f && scaleX <= 1.0f && scaleY > 0.0f &&
scaleY <= 1.0f);
Values from GDB:
(gdb) p cellWidth
$2 = 23840
(gdb) p cellHeight
$3 = 30720
(gdb) p contentPageSize
$4 = {
<mozilla::gfx::BaseSize<int, nsSize, int>> = {
{
{
width = 23040,
height = 28800
},
Here, contentPageSize is from the @page { size: 4in 5in; [...] in the testcase; and Firefox is trying to scale down the page size to fit into a cell in our 4-pages-per-sheet grid, and we're getting confused because 4in by 5in is already smaller (no downscaling needed) than 1/4th of an 8.5in x 11in us-letter sheet.
| Reporter | ||
Comment 2•9 months ago
|
||
This is a sign that we're accidentally scaling up the page size to fit into an N-pages-per-sheet "cell".
This is hard to see with testcase 1, but it's easier to see here with a 1in-by-1in page size. If you print preview this with a physical printer and a US-Letter sheet size, we show it faithfully as a tiny 1in by 1in square; but then if you choose pages-per-sheet:4, then we upscale the square to fill a quarter of the sheet.
| Reporter | ||
Comment 3•9 months ago
|
||
Aha, this is bug 1836534.
Description
•