RESOLVED FIXED 132601
[CSS Regions] Block incorrectly sized when containing an unsplittable box
https://bugs.webkit.org/show_bug.cgi?id=132601
Summary [CSS Regions] Block incorrectly sized when containing an unsplittable box
Andrei Bucur
Reported 2014-05-06 01:46:46 PDT
Created attachment 230892 [details] Repro See the attachment. The green background should not have been painted in the second region.
Attachments
Repro (1.05 KB, text/html)
2014-05-06 01:46 PDT, Andrei Bucur
no flags
Patch (12.35 KB, patch)
2014-05-16 08:32 PDT, Radu Stavila
abucur: review-
Patch v2 (17.80 KB, patch)
2014-05-19 15:07 PDT, Radu Stavila
no flags
Patch v2 with slight improvement (18.50 KB, patch)
2014-05-20 01:42 PDT, Radu Stavila
no flags
Radu Stavila
Comment 1 2014-05-06 06:38:42 PDT
Further findings: - if the child element is display:inline-block, the second region contains a part of the element's parent with a height equal to the height of the child element that is overflowing the first region. If the parent contains another child after the first one, this second child will NOT be painted at the top of the second region - INCORRECT BEHAVIOR - if the child element is display:block, the parent is not painted in the second region unless it has another child, after the first one. If it does, the second child is painted started at the top of the second region - CORRECT BEHAVIOR
Radu Stavila
Comment 2 2014-05-16 08:32:19 PDT
Andrei Bucur
Comment 3 2014-05-16 09:15:53 PDT
Comment on attachment 231573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=231573&action=review > Source/WebCore/rendering/RenderBlockLineLayout.cpp:723 > + if (view().layoutState() && view().layoutState()->isPaginated()) { It should probably be best if this was a helper method on RenderBlockFlow with the line box as a parameter. > Source/WebCore/rendering/RenderBlockLineLayout.cpp:726 > + if (firstRun && firstRun->renderer().isBox() && toRenderBox(firstRun->renderer()).isUnsplittableForPagination()) { What about cases when the line is really big (e.g. there's a span on the line with a large font-size)? Anything placed on a line is unsplittable because the line is unsplittable. I don't think having a box on the line is necessary to trigger this "pull up" condition. > Source/WebCore/rendering/RenderBlockLineLayout.cpp:727 > + LayoutUnit lineLogicalTop = logicalTopForChild(toRenderBox(firstRun->renderer())); Here you should use the information computed by the RootInlineBox::alignBoxesInBlockDirection function. That function places the line inside the RenderBlockFlow so after it is called you can use lineBox->logicalTop().
Radu Stavila
Comment 4 2014-05-19 15:07:48 PDT
Created attachment 231726 [details] Patch v2
Radu Stavila
Comment 5 2014-05-20 01:42:02 PDT
Created attachment 231757 [details] Patch v2 with slight improvement
Antti Koivisto
Comment 6 2014-05-20 07:05:29 PDT
Comment on attachment 231757 [details] Patch v2 with slight improvement r=me
WebKit Commit Bot
Comment 7 2014-05-20 07:35:26 PDT
Comment on attachment 231757 [details] Patch v2 with slight improvement Clearing flags on attachment: 231757 Committed r169110: <http://trac.webkit.org/changeset/169110>
WebKit Commit Bot
Comment 8 2014-05-20 07:35:30 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.