Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat -webkit-line-clamp boxes as monolithic.
It seems pointless to let them fragment, and our implementation didn't behave when they fragmented anyway. Apart from counting lines incorrectly in resumed fragments, we also had a stack overflow issue, due to RelayoutIgnoringLineClamp() and RelayoutAndBreakEarlier() invoking each other indefinitely. RelayoutIgnoringLineClamp() would kick in if the number of lines was equal to the -webkit-line-clamp value, regardless of whether there'd be more lines to come in the next fragmentainer. When going back to re-layout after having determined the orphans/widows requirements (RelayoutAndBreakEarlier()) and set an early-break, this could trigger RelayoutIgnoringLineClamp(), which would restart orphans/widows calculation, since the early-break wasn't carried over (this could be fixed, but it seems rather meaningless). Making such boxes monolithic will disable fragmentation inside, so that the two re-layout mechanisms never meet and therefore never get an opportunity to start fighting each other. We used to crash when printing youtube.com. Bug: 1372637 Change-Id: I3c3a072d9d5025205e6d3600738329df8d3da0f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3948644 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1058563}
- Loading branch information