Skip to content

Add safePrintableInset parameter for printing.#1950

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

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

Conversation

@mstensho
Copy link
Copy Markdown

@mstensho mstensho commented Feb 25, 2026

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

Spec: https://drafts.csswg.org/css-page-3/#page-margin-safety
Spec discussion: w3c/csswg-drafts#11395
RFC: web-platform-tests/rfcs#233

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


Preview | Diff


This change is Reviewable

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
Copy Markdown
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
Copy Markdown
Member

foolip commented Feb 26, 2026

@gsnedders @jgraham could you take a look?

Copy link
Copy Markdown
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.

Comment thread 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
Copy Markdown
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
Copy Markdown
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.

Comment thread index.html

<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
Copy Markdown
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
Copy Markdown
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.

@mstensho
Copy link
Copy Markdown
Author

mstensho commented Mar 4, 2026

The spec changes have landed, and I've updated the description here accordingly. Please take a look.

@foolip
Copy link
Copy Markdown
Member

foolip commented Mar 17, 2026

Friendly ping @whimboo :)

Comment thread index.html Outdated
@mstensho mstensho requested a review from whimboo April 16, 2026 11:37
beckysiegel pushed a commit to chromium/chromium that referenced this pull request Apr 20, 2026
All css-page/ tests are run by the content_shell WPT runner anyway,
since the headless Chrome WPT runner implementation is incapable of
running pagination tests reliably.

Move existing printing/ tests for page margin safety to WPT. Marked as
tentative for now, awaiting the following to be resolved:
  w3c/webdriver#1950
  web-platform-tests/wpt#58030
  web-platform-tests/rfcs#233

Bug: 368070327
Change-Id: I1bd05c7c10dd12f49e7bc76132138190173eb71d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7415846
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617651}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 20, 2026
All css-page/ tests are run by the content_shell WPT runner anyway,
since the headless Chrome WPT runner implementation is incapable of
running pagination tests reliably.

Move existing printing/ tests for page margin safety to WPT. Marked as
tentative for now, awaiting the following to be resolved:
  w3c/webdriver#1950
  #58030
  web-platform-tests/rfcs#233

Bug: 368070327
Change-Id: I1bd05c7c10dd12f49e7bc76132138190173eb71d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7415846
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617651}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 20, 2026
All css-page/ tests are run by the content_shell WPT runner anyway,
since the headless Chrome WPT runner implementation is incapable of
running pagination tests reliably.

Move existing printing/ tests for page margin safety to WPT. Marked as
tentative for now, awaiting the following to be resolved:
  w3c/webdriver#1950
  #58030
  web-platform-tests/rfcs#233

Bug: 368070327
Change-Id: I1bd05c7c10dd12f49e7bc76132138190173eb71d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7415846
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617651}
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 28, 2026
… content_shell WPT runner., a=testonly

Automatic update from web-platform-tests
Add META safe-printable-inset support to content_shell WPT runner.

All css-page/ tests are run by the content_shell WPT runner anyway,
since the headless Chrome WPT runner implementation is incapable of
running pagination tests reliably.

Move existing printing/ tests for page margin safety to WPT. Marked as
tentative for now, awaiting the following to be resolved:
  w3c/webdriver#1950
  web-platform-tests/wpt#58030
  web-platform-tests/rfcs#233

Bug: 368070327
Change-Id: I1bd05c7c10dd12f49e7bc76132138190173eb71d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7415846
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617651}

--

wpt-commits: eeb12c584799b1a761e3b9c19e7453f0791ca7ed
wpt-pr: 59363
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.

4 participants