w3c / w3c/csswg-drafts

[css-page-3] Specify how to handle page sizes with zero area

Open
#8,335 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-page-3
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

Filing this issue to hopefully get some clarification on two related issues that I came across recently when thinking about @page { size: ... } which I think need to be addressed in the spec, for the size descriptor in @page rules:
https://w3c.github.io/csswg-drafts/css-page-3/#page-size-prop

(1) What should be done if 0 is specified for size? (for either or both of the width & height components)

(2) Or, for nonzero page sizes -- what should be done if the size isn't larger than the specified margins for the page?

(In case 2, the naive approach would produce a sheet of paper with zero space for content, which is not great.)

Based on my testing in https://bugzilla.mozilla.org/show_bug.cgi?id=1807985 , it looks like Chromium handles both of these by falling back, effectively treating the size as auto at used value time, I think. I suggest we add that to the spec.

(I've got a bunch of testcases attached to https://bugzilla.mozilla.org/show_bug.cgi?id=1807985 as well, FWIW.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the CSS Page 3 size descriptor section linked in the issue and the test cases attached to Mozilla bug 1807985. Determine the specified behavior for zero-area sizes and sizes no larger than the margins, then update the specification to document the agreed handling and verify it against the reported browser behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.