[css3-page] implement @page rule size attribute
Categories
(Core :: CSS Parsing and Computation, enhancement, P1)
Tracking
()
People
(Reporter: teoli, Assigned: alaskanemily)
References
(Blocks 7 open bugs, )
Details
(5 keywords, Whiteboard: [DevRel:P3][layout:backlog][print2020])
CSS Paged Media Level 3 define the size attribute that allows to define the orientation of a page when printing it. @page{ size:landscape; } or (default value) @page{ size:portrait; } I'm cc/ Brendan as I'm wondering if fixing this is necessary to fix some pdf.js bugs like bug 844090 . Finally, it looks (but I weren't able to confirm/infirm it) that WebKit implement this property unprefixed.
Comment 1•11 years ago
|
||
(In reply to Jean-Yves Perrier [:teoli] from comment #0) > > Finally, it looks (but I weren't able to confirm/infirm it) that WebKit > implement this property unprefixed. It is un-prefixed, at least on Chrome 27.0.1438.7 dev / OS X 10.8.3. (Note that, on OS X, it only works inside Chrome's own print-dialog. The OS X print dialog settings override it, tested both in Chrome and Webkit nightly. It is not unexpected - user setting)
Comment 2•11 years ago
|
||
Jean-Yves, Consider these as suggestions. 1- bug 137367 comment 8 suggests to set this kind of bug report's component field to Printing: Output and not Style System (CSS) 2- You can expect some people to search for this bug with the string "@page" and/or with "size: landscape" (with a blank space separating the 2 words). CSS3 Paged Media may have better chances to be used for searching since the spec uses "Paged Media" and bug 286443 uses such terminology. And bug 286443 should definitely be a meta type of bug report. So, I suggest the following as new summary: [CSS3 Paged Media] Support for @page { size: landscape } 3- Maybe add testcase-wanted keyword; I would. Gérard
Comment 3•11 years ago
|
||
Are you only considering supporting 'landscape' and 'portrait'? I'd love to enable native printing for Firefox in Google Docs (to print directly and not have to generate PDF server-side). But the lack of 'size' prevents that. We set rules like size: 8.5in 11in; or pixel-sized rules, since we allow adjustment of page size and need precise control over how the page is printed. These values are specified for the property: http://www.w3.org/TR/css3-page/#page-size-prop @philippe, the OS dialog doesn't respect the size property, although it's possible to use @media queries together with @page to target different page size targets. See: http://www.w3.org/TR/css3-page/#page-size-media-query -Fil
Comment 4•11 years ago
|
||
> Are you only considering supporting 'landscape' and 'portrait'? This bug 851441 report is only about supporting @page {size: landscape } where landscape is a reserved keyword. > I'd love to enable native printing for Firefox in Google Docs (to print > directly and not have to generate PDF server-side). But the lack of 'size' > prevents that. > > We set rules like size: 8.5in 11in; or pixel-sized rules, since we allow > adjustment of page size and need precise control over how the page is > printed. These values are specified for the property: > http://www.w3.org/TR/css3-page/#page-size-prop Fil, if you want to help, you can be helpful here: please create another bug report for this. Give it the summary: [CSS3 Paged Media] Support for @page { size: <page-size> } (eg. size: 4in 6in) and make it blocking bug 286443 and Component field should be Printing: Output How to Write a Proper Bug https://quality.mozilla.org/docs/bugzilla/starter-kit/how-to-write-a-proper-bug/ Bug writing guidelines https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines Gérard
Comment 5•11 years ago
|
||
> please create another bug report for this. Bug 851937: [CSS3 Paged Media] Support for @page size has been created for this.
Comment 6•11 years ago
|
||
Does this block or depend on bug #851937?
Comment 7•11 years ago
|
||
Yes, I'd say this bug blocks bug 851937. We created this bug 851441 because several people in another bug report (can't find which now) were strongly requesting support for @page {size: landscape }.
Comment 8•11 years ago
|
||
> We created this bug 851441 because several people in another bug report > (can't find which now) bug 115199 comment #141 > were strongly requesting support for @page {size: > landscape }.
Comment 11•10 years ago
|
||
Any news about this issue guys? :)
Comment 12•9 years ago
|
||
Note that CSS.supports('size', 'landscape'); and @supports incorrectly reports support for the size property. CSS.supports('size', 'bogus') correctly returns false, so somehow Firefox's CSS parser recognizes this property. Why is the property parsed but not used?
Comment 13•9 years ago
|
||
It's not clear to me whether @page-specific properties like size should be handled by @supports and CSS.supports() even if we implemented support for them. We currently parse and expose these properties on regular declarations, like |p { size: landscape; }| and again I'm not sure whether that's correct. I've asked here about that: https://lists.w3.org/Archives/Public/www-style/2015Mar/0387.html We have parsed marks, orphans, size and widows for a long time, without actual support for their behaviour. I don't know why that is.
In the very early days of Gecko, all the properties in CSS 2 were added at the style system level. The print-specific ones are the only ones that we haven't taken out. (Basically everything that's CSS_PROP_BACKENDONLY, plus any @page stuff.) We should fix it, but just never got around to it.
Updated•9 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Updated•7 years ago
|
Comment 15•7 years ago
|
||
Simple test: http://www.gtalbot.org/BugzillaSection/Bug1363148-page-size-landscape.html
Comment 16•7 years ago
|
||
> Simple test: > http://www.gtalbot.org/BugzillaSection/Bug1363148-page-size-landscape.html Argh... got confused with bug number. Please use instead: size: landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape.html 3 additional tests: size: 4in 6in landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape-002.html size: letter landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape-003.html size: legal landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape-004.html Chrome 58 does not pass Bug851441-page-size-landscape-002 but passes the other 3 tests.
Comment 17•7 years ago
|
||
I am removing page-size-landscape-002 (size: 4in 6in landscape) because it uses invalid syntax. Value: <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ] means that portrait or landscape can only be added alongside of one of page-size reserved keywords.
Comment 18•6 years ago
|
||
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Updated•5 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 19•4 years ago
|
||
Now that we triage by severity, setting priority to P1 to reflect backlog prioritization on this bug as either in-progress, or planned development in the near term. See https://wiki.mozilla.org/Platform/Layout#Backlog_Tracking_in_Bugzilla
Updated•4 years ago
|
Comment 20•4 years ago
|
||
[print2020_v79] here means that this is being worked on in the v79 timescale, not that it is expected to be completed for v79.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment hidden (advocacy) |
Updated•4 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 23•5 months ago
|
||
This bug appears to address situations where specific test pages have an attribute that forces either portrait or landscape orientation on print preview and print itself. It would also appear that this issue was fixed in Nightly v94.0a1 from 2021-09-30. A specific pushlog could not be provided due to the very old change (mozregression is unable to finish bisection because autoland builds are too old to still be around).
The following cases were tested on Windows 10, MacOS 11 and Ubuntu 22:
size: landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape.html
size: portrait (by modifying the page above)
3 additional tests:
size: letter landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape-003.html
size: legal landscape http://www.gtalbot.org/BugzillaSection/Bug851441-page-size-landscape-004.html
Landscape (or portrait) orientation is forced in print preview and portrait (or landscape) orientation cannot be enabled.
Updated•3 months ago
|
Description
•