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

Attempt to move past monolithic content when printing. #39223

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 27, 2023

Let monolithic content take up additional space on pages they overflow
into, if this prevents content overlap (that wouldn't occur it we
weren't paginated).

When printing, when we detect that something overflows the page, we'll
store this overflow in the break token, so that we can move past it on
subsequent pages. This kind of works, because, in our implementation,
pages are stacked in the block direction, so that the block-start offset
of the next page is the same as the block-end offset of the preceding
page.

The current solution here only aims to get the basic things right-ish:
inside regular block containers, inside floats, and inside out-of-flow
positioned elements. In addition, we need to make sure that repeated
table headers and footers don't get messed up. We have to repeat those
on every page, even if there's monolithic content in the way. In
addition to actually (probably) making sense visually, our
implementation requires this: once we have decided to repeat a table
section, we need to be consistent about it, or the fragment repeated
will get upset.

For layout systems like flex, grid and tables, we don't attempt to do
anything special, for now. This shouldn't cause major problems, but it
does mean that content in a flow parallel to the one that has monolithic
content (e.g. inside sibling table cells) will be affected (pushed down)
by the monolithic content, even if there is no need to do so.

Content next to floats with monolithic content inside also doesn't
behave correctly. To fix this, we would need to translate and copy the
exclusion space from one fragmentainer to another. It should be a rather
straight-forward thing to do, but I'd like to see a use-case for it
first.

Firefox appears to do something very similar, to prevent monolithic
overflow from overlapping with subsequent content, with limitations
comparable to what this CL does.

Bug: 1402540
Change-Id: If2bfec4737ea9ee7169036144f590a913123b6be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4370688
Reviewed-by: Alison Maher <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1123282}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-4370688 branch 5 times, most recently from e774481 to cacda72 Compare March 28, 2023 18:24
Let monolithic content take up additional space on pages they overflow
into, if this prevents content overlap (that wouldn't occur it we
weren't paginated).

When printing, when we detect that something overflows the page, we'll
store this overflow in the break token, so that we can move past it on
subsequent pages. This kind of works, because, in our implementation,
pages are stacked in the block direction, so that the block-start offset
of the next page is the same as the block-end offset of the preceding
page.

The current solution here only aims to get the basic things right-ish:
inside regular block containers, inside floats, and inside out-of-flow
positioned elements. In addition, we need to make sure that repeated
table headers and footers don't get messed up. We have to repeat those
on every page, even if there's monolithic content in the way. In
addition to actually (probably) making sense visually, our
implementation requires this: once we have decided to repeat a table
section, we need to be consistent about it, or the fragment repeated
will get upset.

For layout systems like flex, grid and tables, we don't attempt to do
anything special, for now. This shouldn't cause major problems, but it
does mean that content in a flow parallel to the one that has monolithic
content (e.g. inside sibling table cells) will be affected (pushed down)
by the monolithic content, even if there is no need to do so.

Content next to floats with monolithic content inside also doesn't
behave correctly. To fix this, we would need to translate and copy the
exclusion space from one fragmentainer to another. It should be a rather
straight-forward thing to do, but I'd like to see a use-case for it
first.

Firefox appears to do something very similar, to prevent monolithic
overflow from overlapping with subsequent content, with limitations
comparable to what this CL does.

Bug: 1402540
Change-Id: If2bfec4737ea9ee7169036144f590a913123b6be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4370688
Reviewed-by: Alison Maher <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1123282}
@WeizhongX
Copy link
Contributor

python3 ./wpt run --channel=nightly --verify --verify-no-chaos-mode --verify-repeat-loop=0 --verify-repeat-restart=10 --github-checks-text-file=/home/test/artifacts/checkrun.md --affected base_head --log-mach-level=info --log-mach=- -y --no-pause --no-restart-on-unexpected --install-fonts --no-headless --verify-log-full --binary=/home/test/build/firefox/firefox firefox

Some affected tests had slow results:

Slow tests

Test Result Longest duration (ms) Timeout (ms)
/css/printing/monolithic-overflow-020-print.html FAIL 8137 10000

These may be pre-existing or newly slow tests. Slow tests indicate that a test ran very close to the test timeout limit and so may become TIMEOUT-flaky in the future. Consider speeding up the test or breaking it into multiple tests. For help, please tag @web-platform-tests/wpt-core-team in a comment.

@WeizhongX
Copy link
Contributor

created crbug.com/1429784, pls help admin merge, thanks! @jcscottiii

@jcscottiii jcscottiii merged commit 155ae72 into master Apr 3, 2023
@jcscottiii jcscottiii deleted the chromium-export-cl-4370688 branch April 3, 2023 14:59
cookiecrook pushed a commit to cookiecrook/wpt that referenced this pull request Apr 8, 2023
…tests#39223)

Let monolithic content take up additional space on pages they overflow
into, if this prevents content overlap (that wouldn't occur it we
weren't paginated).

When printing, when we detect that something overflows the page, we'll
store this overflow in the break token, so that we can move past it on
subsequent pages. This kind of works, because, in our implementation,
pages are stacked in the block direction, so that the block-start offset
of the next page is the same as the block-end offset of the preceding
page.

The current solution here only aims to get the basic things right-ish:
inside regular block containers, inside floats, and inside out-of-flow
positioned elements. In addition, we need to make sure that repeated
table headers and footers don't get messed up. We have to repeat those
on every page, even if there's monolithic content in the way. In
addition to actually (probably) making sense visually, our
implementation requires this: once we have decided to repeat a table
section, we need to be consistent about it, or the fragment repeated
will get upset.

For layout systems like flex, grid and tables, we don't attempt to do
anything special, for now. This shouldn't cause major problems, but it
does mean that content in a flow parallel to the one that has monolithic
content (e.g. inside sibling table cells) will be affected (pushed down)
by the monolithic content, even if there is no need to do so.

Content next to floats with monolithic content inside also doesn't
behave correctly. To fix this, we would need to translate and copy the
exclusion space from one fragmentainer to another. It should be a rather
straight-forward thing to do, but I'd like to see a use-case for it
first.

Firefox appears to do something very similar, to prevent monolithic
overflow from overlapping with subsequent content, with limitations
comparable to what this CL does.

Bug: 1402540
Change-Id: If2bfec4737ea9ee7169036144f590a913123b6be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4370688
Reviewed-by: Alison Maher <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1123282}

Co-authored-by: Morten Stenshorne <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants