Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browsing context: print: enforce minimum page size dimensions #522

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

thiagowfx
Copy link
Member

@thiagowfx thiagowfx commented Aug 31, 2023

The minimum possible page size is 1x1 point.

1 point is equal to (2.54 / 72) cm.

Docs: https://www.w3.org/TR/css3-values/#absolute-lengths
Docs: https://stackoverflow.com/questions/139655/convert-pixels-to-points
WPT: web-platform-tests/wpt#40872
Fixed: #473


Preview | Diff

@thiagowfx thiagowfx self-assigned this Aug 31, 2023
index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Contributor

@Lightning00Blade Lightning00Blade left a comment

Choose a reason for hiding this comment

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

LGTM

@thiagowfx
Copy link
Member Author

It would be nice to have another vendor than Google review it as well: cc @whimboo @jgraham

@thiagowfx
Copy link
Member Author

Ping

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.

Sorry for the delay. These changes are in sync with the outcome of the discussion during our W3C meeting. And yes points are the right unit to use here given that this is generally used for printing.

@thiagowfx thiagowfx merged commit 3535c86 into main Sep 8, 2023
3 checks passed
@thiagowfx thiagowfx deleted the thiagowfx/print branch September 8, 2023 17:24
github-actions bot added a commit that referenced this pull request Sep 8, 2023
SHA: 3535c86
Reason: push, by thiagowfx

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jrandolf-2 jrandolf-2 restored the thiagowfx/print branch September 11, 2023 10:22
jrandolf-2 added a commit that referenced this pull request Sep 11, 2023
This original PR (#522) used invalid syntax for the minimum size.
jrandolf-2 added a commit that referenced this pull request Sep 11, 2023
This original PR (#522) used invalid syntax for the minimum size.
whimboo pushed a commit that referenced this pull request Sep 11, 2023
This original PR (#522) used invalid syntax for the minimum size.
thiagowfx pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 11, 2023
DanielRyanSmith pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 12, 2023
…oint (#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: #40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <[email protected]>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <[email protected]>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <[email protected]>
Co-authored-by: Henrik Skupin <[email protected]>
thiagowfx pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 12, 2023
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Sep 28, 2023
…ent area with less than 1x1 point, a=testonly

Automatic update from web-platform-tests
[wdspec] bidi: print: add tests for content area with less than 1x1 point (#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: #40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <[email protected]>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <[email protected]>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <[email protected]>
Co-authored-by: Henrik Skupin <[email protected]>
--

wpt-commits: e55288f2bc38fe1fce8093c116248582b05e4c33
wpt-pr: 40872
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Sep 29, 2023
…ent area with less than 1x1 point, a=testonly

Automatic update from web-platform-tests
[wdspec] bidi: print: add tests for content area with less than 1x1 point (#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: #40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <jdescottesmozilla.com>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <mailhskupin.info>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <jdescottesmozilla.com>
Co-authored-by: Henrik Skupin <mailhskupin.info>
--

wpt-commits: e55288f2bc38fe1fce8093c116248582b05e4c33
wpt-pr: 40872

UltraBlame original commit: aa78237031114b2eec468304678407198cf94fa6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Sep 29, 2023
…ent area with less than 1x1 point, a=testonly

Automatic update from web-platform-tests
[wdspec] bidi: print: add tests for content area with less than 1x1 point (#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: #40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <jdescottesmozilla.com>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <mailhskupin.info>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <jdescottesmozilla.com>
Co-authored-by: Henrik Skupin <mailhskupin.info>
--

wpt-commits: e55288f2bc38fe1fce8093c116248582b05e4c33
wpt-pr: 40872

UltraBlame original commit: aa78237031114b2eec468304678407198cf94fa6
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Sep 30, 2023
…ent area with less than 1x1 point, a=testonly

Automatic update from web-platform-tests
[wdspec] bidi: print: add tests for content area with less than 1x1 point (#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: #40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <[email protected]>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <[email protected]>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <[email protected]>
Co-authored-by: Henrik Skupin <[email protected]>
--

wpt-commits: e55288f2bc38fe1fce8093c116248582b05e4c33
wpt-pr: 40872
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Sep 30, 2023
…ent area with less than 1x1 point, a=testonly

Automatic update from web-platform-tests
[wdspec] bidi: print: add tests for content area with less than 1x1 point (#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: #40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <jdescottesmozilla.com>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <mailhskupin.info>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <jdescottesmozilla.com>
Co-authored-by: Henrik Skupin <mailhskupin.info>
--

wpt-commits: e55288f2bc38fe1fce8093c116248582b05e4c33
wpt-pr: 40872

UltraBlame original commit: aa78237031114b2eec468304678407198cf94fa6
Lightning00Blade pushed a commit to Lightning00Blade/wpt that referenced this pull request Dec 11, 2023
…oint (web-platform-tests#40872)

* [wdspec] bidi: print: fail gracefully for empty page dimensions

Chromium cannot print pages with 0x0 content area.

Closes: web-platform-tests#40870

* check for UnsupportedOperationException

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Julian Descottes <[email protected]>

* update test to match spec update

Spec: w3c/webdriver-bidi#522

* add new tests for minimum page dimensions with margins

* add new tests for invalid small page dimensions

* add inch_in_point, replace inch_in_point and inch_in_cm usages

* fix typo: page -> margin

* add missing pytest fixture

* fix indentation error, round up fraction

* Update webdriver/tests/bidi/browsing_context/print/margin.py

Co-authored-by: Henrik Skupin <[email protected]>

* test: address some review comments

* test: address some more review comments

* test: add pt_to_cm, fix background test

* test: extend test_params_page_invalid_value

* make expected_width and expected_height more readable

* dimensions: 0.01 -> 0.03

* extract constants for default page width and height

* use constant in f-string as well

---------

Co-authored-by: Julian Descottes <[email protected]>
Co-authored-by: Henrik Skupin <[email protected]>
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.

browsingContext.print: should emit InvalidArgument when printing an empty content area
3 participants