web-platform-tests / web-platform-tests/rfcs

Consider changing the behavior of <meta name="page-ranges"> in Print Reftests

Open
#176 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
110
Forks
90
PR merge metrics
No merged PRs in 30d

Description

In the RFC that introduced Print Reftests, a new page-ranges meta value was introduced.

What I would like to be able to do is have some complicated page styling in a test, then test different page ranges against multiple references. So, for example, I might test pages 1-2 against a different two page reference, then page 3 against a single page reference, then pages 4-6 against a different 3 page reference. This would really help wih testing that the print output of a document can contain a range of page sizes, orientations, margins, etc., and that @page rules are being applied correctly to the correct pages.

Unfortunately that isn't supported the way the RFC is written. You can specify multiple meta tags that specify a page range, and each tag's page range is applied either to the test or a reference.

First, it's not clear to me why a page range should be applicable to a reference. Surely references should be as simple as possible, and references should just be crafted more simply so as to not require a page range?

Besides that, being able to apply a page range to references seems a bit weird, and of very limited utility. I say that because if you can only specify a single range for the test itself, then it only seems to make sense to specify at most a single reference, regardless of whether or not you can specify a page range for it. As specified in the RCF, you could in principal specify multiple references with different ranges...but then what are you comparing? You're checking that multiple "references" all look the same as the "test" (or range of pages from it). ... You've now kinda inverts the "test"-"reference" relationship, where the test is now really acting as the reference to multiple "references".

There are currently only 4 WPT tests that are using page-ranges. Could we change the behavior so that ranges are always applicable to the test, and what you're doing when specifying a range in a meta tag is saying "this range from the test should look the same as this entire references, the reference having the same number of pages as the range from the test"?

@jgraham @gsnedders

Contributor guide

No contributing guide indexed for this repository

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

Start by reading rfcs/print_test.md, then inspect the four WPT tests currently using page-ranges. Determine how the proposed test-range-to-full-reference behavior affects the RFC and those tests; done means the intended semantics are agreed and the RFC and affected examples consistently describe the new behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.