w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
368 stars 42 forks source link

Clarify empty page vs empty content for "browsingContext.print" command #797

Open whimboo opened 1 week ago

whimboo commented 1 week ago

At the moment the browsingContext.print command has to raise a invalid argument error if the page dimensions are lower than 0.0352 in (2.54 / 72). This is fine, but we have tests under web-platform which assume the same behavior when the actual content area is below that threshold. In that specific case the margin is set to the page height, width or both.

Test results can be seen at wpt.fyi.

Even through the content area is empty it doesn't affect the page size. And as such we basically should not raise an invalid argument error. This is probably an oversight when we landed those tests, and needs to be clarified by Google folks.

@OrKoN can you please have a look? Thanks

CC @jgraham @juliandescottes @lutien @gsnedders

gsnedders commented 1 week ago

See also: https://github.com/w3c/webdriver-bidi/issues/473

whimboo commented 1 week ago

Interesting is as well the following comment: https://github.com/w3c/csswg-drafts/issues/8335#issuecomment-1611841208

When a page uses the @page media query and sets a size of the page that is too small Chrome seems to ignore it. Is that still true? I haven't tested it.

If we agree that a zero-sized content needs to raise we have to update the BiDi spec to make that clear.