Skip to content

Better define Print "formatting hints" #1895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gsnedders opened this issue Apr 23, 2025 · 3 comments
Open

Better define Print "formatting hints" #1895

gsnedders opened this issue Apr 23, 2025 · 3 comments

Comments

@gsnedders
Copy link
Member

https://w3c.github.io/webdriver/#print-page has:

In addition, the following formatting hints should be applied by the UA:

If scale is not equal to 1:
Zoom the size of the content by a factor scale

If background is false:
Suppress output of background images

If shrinkToFit is true:
Resize the content to match the page width, overriding any page width specified in the content

These seem basically entirely undefined.

What does "zoom the size of the content" mean? Does this effectively just "set the zoom property on the root element"?

While "suppress output of the background images" is clear, I expect we should actually just define this by reference to https://drafts.csswg.org/css-color-adjust-1/#propdef-print-color-adjust (which is admittedly very open-ended!).

"Resize the content to match the page width" is also incredibly vague. Like, we're always setting a page width and height, thus aren't we setting the size of the page box, and thus the content won't be larger than the width?

@OrKoN
Copy link
Contributor

OrKoN commented Apr 24, 2025

Related w3c/webdriver-bidi#686

@gsnedders
Copy link
Member Author

Also related: web-platform-tests/rfcs#221 (because it's hard to do in wptrunner as long as the formatting hints are so broadly defined).

@gsnedders
Copy link
Member Author

While "suppress output of the background images" is clear, I expect we should actually just define this by reference to https://drafts.csswg.org/css-color-adjust-1/#propdef-print-color-adjust (which is admittedly very open-ended!).

The other thing about the spec there is it says:

If user agents allow users to control this aspect of the document’s display, the user preference must be respected more strongly than the hint provided by print-color-adjust.

If background is true/false, defaulting to false, and if it is considered a user preference for print-color-adjust, then there is no way to test print-color-adjust support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants