Skip to content

Add safePrintableInset parameter for printing.#1950

Open
mstensho wants to merge 2 commits intow3c:masterfrom
mstensho:mstensho/safe-printable-inset
Open

Add safePrintableInset parameter for printing.#1950
mstensho wants to merge 2 commits intow3c:masterfrom
mstensho:mstensho/safe-printable-inset

Conversation

@mstensho
Copy link

@mstensho mstensho commented Feb 25, 2026

This is for testing the page-margin-safety descriptor in @page and
page margin box contexts.

Spec discussion: w3c/csswg-drafts#11395
Spec change: w3c/csswg-drafts#13190
RFC: web-platform-tests/rfcs#233

wptrunner and webdriver code changes:
web-platform-tests/wpt#58030


Preview | Diff

This is for testing the `page-margin-safety` descriptor in `@page` and
page margin box contexts.

Spec discussion: w3c/csswg-drafts#11395
Spec change: w3c/csswg-drafts#13190
RFC: web-platform-tests/rfcs#233

wptrunner and webdriver code changes:
web-platform-tests/wpt#58030
@foolip
Copy link
Member

foolip commented Feb 25, 2026

@AutomatedTester it's been a while since I contributed to this spec. I seem to have write access so I could review and merge this, but what's the proper procedure these days?

@foolip
Copy link
Member

foolip commented Feb 26, 2026

@gsnedders @jgraham could you take a look?

Copy link
Contributor

@whimboo whimboo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As referenced this is not yet a public available feature so we need to wait until the feature spec is done. Nevertheless here a quick feedback.

Upon agreement it might be good to as well to get it added to WebDriver BiDi.

index.html Outdated
Comment on lines 11320 to 11323
<li><p>If <var>safePrintableInset</var> is not a <a>Number</a>, or is a
negative number, return <a>error</a> with <a>error code</a> <a>invalid
argument</a>.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets stay in sync with other params and avoid adding line breaks within a definition:

Suggested change
<li><p>If <var>safePrintableInset</var> is not a <a>Number</a>, or is a
negative number, return <a>error</a> with <a>error code</a> <a>invalid
argument</a>.
<li><p>If <var>safePrintableInset</var> is not a <a>Number</a>, or is less then 0, return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. but not taken verbatim. Less than 0.


<li><p>Let <var>safePrintableInset</var> be the result of <a>getting a
property with default</a> named "<code>safePrintableInset</code>" and with
default <code>0</code> from <var>parameters</var>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only defines the extraction of the safePrintableInset parameter but I do not see how it actually affects printing. So how can WebDriver actually control the right printing behavior of the browser?

I can see in the feature spec that page-margin-safety has the states none | clamp | add, while here a number is used. Will it be added as a paper setting similar to margin?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is used to implement page-margin-safety. I added some spec text now.

For real printers in a real browser, try printing with Margins: Minimum. This is what this value is about. With page-margin-safety, this becomes web-exposed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants