[Needs Google fix] Google Docs page positioning is incorrect, due to @page size styling getting lost
Categories
(Web Compatibility :: Site Reports, defect, P2)
Tracking
(Not tracked)
People
(Reporter: jwatt, Unassigned)
References
(Blocks 1 open bug)
Details
I have a couple of testcases for Gsuite printing that are positioning incorrectly.
The first page of this test displays the issue:
https://docs.google.com/document/d/1SetfZ2cx7J0BJanXnWTABzKexzwP4p-dQ--XSEAeiqs/edit
The Google Docs "Page setup" settings (accessed via the Google Docs menu File -> Page Setup
) has the page size set to A4, and Google Docs sets the page margins to zero in an @page
block in the source.
When I print with Firefox's printing UI, the "Paper size" field is automatically set to "A4" and the "Margins" field is automatically set to "None".
Despite this, the page contents do not look perferctly aligned in the center of the page in print preview. The first page looks offset slightly towards the top-left corner of the page.
If I change the Margins
field to Minimal
the page contents then appear nicely centered. I suspect, therefore, that the issue is likely that some code that we have somewhere that makes decisions about positioning is acting on margin values that have been clamped up to the printer's mimimal margin values. Or something like that.
Reporter | ||
Updated•6 months ago
|
Comment 1•6 months ago
•
|
||
I think this is explained by bug 1865203.
I think the STR here result in us printing an A4-sized <canvas>
onto a US-Letter-sized page, and then printing that US-Letter-sized page onto an A4 sheet of paper.
In particular:
- Google Docs is generating A4-sized content (like a canvas that's roughly the size of an A4 page)
- ... and then they're putting it on a US-letter-sized CSS page (
@page { size:8.5in 11in [...]
), which results in some distortion to fit. (This is a Google Docs bug, I think; I reached out to some GDocs folks and I'm waiting to hear back about it.) - ... and then if the user chooses to print that to an A4-sized page (as jwatt did in comment 0 STR, probably using A4-page-size-defaults from his printer or from his previous settings), then it's still not really right, because we're still printing a US Letter sized page (from the @page definition) and we're just smooshing it to fit his printer's A4-sized sheets of paper.
Comment 2•5 months ago
|
||
The severity field is not set for this bug.
:jfkthame, could you have a look please?
For more information, please visit BugBot documentation.
Comment 3•5 months ago
|
||
Marking this S3 for now (though it sounds like it may simply be a manifestation of bug 1865203, and could perhaps be dup'd to that).
Comment 4•5 months ago
|
||
Indeed; and bug 1867106 is even closer to the root issue here. (I just duped bug 1865203 to that one.)
Once Google has updated things on their side (per bug 1867106 comment 4), we should retest the STR here and bug 1865203, to be sure things are fixed.
Reporter | ||
Updated•5 months ago
|
Updated•5 months ago
|
Reporter | ||
Comment 6•5 months ago
•
|
||
Google has fixed up their code to use setProperty
(working around bug 1867106), which appears to have fixed this.
Comment 7•5 months ago
•
|
||
Verified fixed. My STR in dup bug 1865203 produce EXPECTED RESULTS now.
Comment 8•5 months ago
|
||
Let's reclassify as Web Compat since this was fixed by a change to the website in question, rather than a Gecko change.
Comment 9•5 months ago
|
||
(Let's also adjust the bug title to make the issue-that-was-fixed clearer, and to remove the implication that this was specific to situations with zero margins.)
Comment 10•5 months ago
•
|
||
(In reply to Jonathan Watt [:jwatt] from comment #6)
Google has fixed up their code to use
setProperty
[...] which appears to have fixed this.
Update: we got a heads-up that Google folks need to roll back the deployment that included this^ fix (to address an unrelated issue), so this might be broken again for a little bit.
Comment 11•2 months ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #10)
(In reply to Jonathan Watt [:jwatt] from comment #6)
Google has fixed up their code to use
setProperty
[...] which appears to have fixed this.Update: we got a heads-up that Google folks need to roll back the deployment that included this^ fix (to address an unrelated issue), so this might be broken again for a little bit.
Update again: I believe this was re-deployed (or maybe the roll-back never happened? not sure.)
At least, I'm not seeing any centering/clipping issues when print-previewing the Google Doc document in this bug & in dupe bug 1865203.
Description
•