Bug 132601 - [CSS Regions] Block incorrectly sized when containing an unsplittable box
Summary: [CSS Regions] Block incorrectly sized when containing an unsplittable box
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Radu Stavila
URL:
Keywords: AdobeTracked
Depends on:
Blocks: 57312
  Show dependency treegraph
 
Reported: 2014-05-06 01:46 PDT by Andrei Bucur
Modified: 2014-05-20 07:35 PDT (History)
7 users (show)

See Also:


Attachments
Repro (1.05 KB, text/html)
2014-05-06 01:46 PDT, Andrei Bucur
no flags Details
Patch (12.35 KB, patch)
2014-05-16 08:32 PDT, Radu Stavila
abucur: review-
Details | Formatted Diff | Diff
Patch v2 (17.80 KB, patch)
2014-05-19 15:07 PDT, Radu Stavila
no flags Details | Formatted Diff | Diff
Patch v2 with slight improvement (18.50 KB, patch)
2014-05-20 01:42 PDT, Radu Stavila
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Bucur 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.
Comment 1 Radu Stavila 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
Comment 2 Radu Stavila 2014-05-16 08:32:19 PDT
Created attachment 231573 [details]
Patch
Comment 3 Andrei Bucur 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().
Comment 4 Radu Stavila 2014-05-19 15:07:48 PDT
Created attachment 231726 [details]
Patch v2
Comment 5 Radu Stavila 2014-05-20 01:42:02 PDT
Created attachment 231757 [details]
Patch v2 with slight improvement
Comment 6 Antti Koivisto 2014-05-20 07:05:29 PDT
Comment on attachment 231757 [details]
Patch v2 with slight improvement

r=me
Comment 7 WebKit Commit Bot 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>
Comment 8 WebKit Commit Bot 2014-05-20 07:35:30 PDT
All reviewed patches have been landed.  Closing bug.