Closed
Bug 1250674
Opened 9 years ago
Closed 9 years ago
Don't print header/footer if larger than user defined margins
Categories
(Core :: Printing: Output, defect)
Core
Printing: Output
Tracking
()
RESOLVED
FIXED
mozilla48
People
(Reporter: tschneider, Assigned: tschneider)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [platform-rel-Google][platform-rel-GoogleDocs])
Attachments
(1 file)
3.48 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
Apps like PDF.js and Google docs take control over the entire printing page by setting margin to 0 in CSS @page rules. If these margins are smaller then the space needed to print the header of footer, user content gets overdrawn. We should therefore skip painting footers/headers should in this case. Chrome is behaving the same way. This is one of 2 requested features that keeps Google Docs from printing natively.
Assignee | ||
Comment 1•9 years ago
|
||
First shot.
Assignee | ||
Updated•9 years ago
|
Attachment #8722671 -
Flags: review?(dbaron)
Can you explain what the difference is between mPD->mReflowMargin and mPageContentMargin?
Also, how do other browsers behave?
Flags: needinfo?(tschneider)
(In reply to David Baron [:dbaron] ⌚️UTC+8 from comment #2)
> Also, how do other browsers behave?
Er, I guess you sort of answered that for Chrome in comment 0, but it's probably worth checking:
(1) whether the points where we flip from showing to not showing headers will be equivalent with this patch (under different cases, if there are relevant cases to check)
(2) perhaps check Edge as well, and maybe Safari
Assignee | ||
Comment 4•9 years ago
|
||
Chrome is using the same flip points. Safari doesn't seem to support CSS defined page margins at all. Edge behaves like Firefox does without this patch, overdrawing user content. It disables printing of headers/fooders by default tho.
Flags: needinfo?(tschneider)
Assignee | ||
Comment 5•9 years ago
|
||
> Can you explain what the difference is between mPD->mReflowMargin and mPageContentMargin?
mReflowMargin defines the default margins as defined via print.print_margin_* prefs. mPageContentMargin holds the actual, CSS specified margins, which might change individually per page.
Comment on attachment 8722671 [details] [diff] [review]
Part 1: Don't paint header/footer if larger than user defined margins
OK, r=dbaron
It would be nice to add a patch 2 that renames mReflowMargin to mDefaultPageMargin or something like that, since mReflowMargin seems like a rather confusing/ambiguous name. (If you're happy with that name, feel free to just land it with r=dbaron.)
Attachment #8722671 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 8•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 10•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Updated•8 years ago
|
platform-rel: --- → +
Whiteboard: [platform-rel-Google][platform-rel-GoogleDocs]
Comment 11•8 years ago
|
||
Header/footer is not printed anymore on svg images.
Should this fix apply for this type of files too?
Samples: https://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg
https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/410.svg
https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/compuserver_msn_Ford_Focus.svg
Thank you!
Flags: needinfo?(tschneider)
Comment 12•2 years ago
|
||
(In reply to Petruta Horea [:phorea], Desktop QA from comment #11)
Header/footer is not printed anymore on svg images.
Should this fix apply for this type of files too?
All seems to be well here now; I can't reproduce this^ described followup behavior. I'm seeing headers/footers when print-previewing those SVG files (as long as the margins in the print preview dialog are sufficient, just as for any other print-previewed content). And this is as-expected, I think.
Flags: needinfo?(tschneider)
You need to log in
before you can comment on or make changes to this bug.
Description
•