-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
There was a problem hiding this 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.
e774481
to
cacda72
Compare
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}
cacda72
to
d7a7885
Compare
Some affected tests had slow results: Slow tests
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 |
created crbug.com/1429784, pls help admin merge, thanks! @jcscottiii |
…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]>
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}