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

Large child of overflow: hidden parent causes an unexpected page break. #1904

Closed
BadCoder1337 opened this issue Jul 8, 2023 · 1 comment · Fixed by #1936
Closed

Large child of overflow: hidden parent causes an unexpected page break. #1904

BadCoder1337 opened this issue Jul 8, 2023 · 1 comment · Fixed by #1936
Labels
bug Existing features not working as expected
Milestone

Comments

@BadCoder1337
Copy link

I tried to create some "pyramid" document (desired layout, source, demo) with different paper formats but got some weird PDF results in Chrome and WeasyPrint.

With @liZe help we found a minimal example showing the issue

<div style="overflow: hidden; height: 10cm; border: 1px solid red">
  <div>abc</div>
  <div style="height: 100cm">def</div>
</div>

and the workaround

img {
  display: block;
  margin-top: -100cm;
  transform: translate(0, 100cm);
}

Version Info:
Chrome 114.0.5735.199
WeasyPrint 59.0

@liZe liZe added the bug Existing features not working as expected label Jul 9, 2023
@liZe
Copy link
Member

liZe commented Jul 9, 2023

Thanks for the bug report.

Here’s the related paragraph in the specification:

In addition to any content which is not generally fragmentable, UAs may consider as monolithic any elements with overflow set to auto or scroll and any elements with overflow: hidden and a non-auto logical height (and no specified maximum logical height).

With "normal" words: we should not break boxes with defined height and hidden overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
2 participants