Bug 131161

Summary: [CSS Regions] Elements with overflow:auto are not painted inside regions when following a float
Product: WebKit Reporter: Radu Stavila <stavila>
Component: CSSAssignee: Radu Stavila <stavila>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kondapallykalyan, simon.fraser, WebkitBugTracker
Priority: P2 Keywords: AdobeTracked
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 57312    
Attachments:
Description Flags
Test-case
none
Patch
hyatt: review-
Patch implementing reviewer feedback
none
Patch implementing reviewer feedback none

Description Radu Stavila 2014-04-03 05:57:16 PDT
Created attachment 228502 [details]
Test-case

Elements with overflow:auto are not painted inside regions when following a float. See attached test-case. The blue div should be painted next to the float but it doesn't appear at all.
Comment 1 Radu Stavila 2014-04-24 05:37:38 PDT
Further findings:
1. Adding margin-left to the overflow:auto element causes it to appear. However, hit-testing inside it is not working.
2. Setting scrollbar preferences to always show causes the element to appear. The float before it now has a strange disabled scrollbar. The same as above, hit-testing is not working in the overflow:auto element.
Comment 2 Radu Stavila 2014-05-05 06:17:33 PDT
Created attachment 230822 [details]
Patch
Comment 3 Radu Stavila 2014-05-05 06:36:47 PDT
Added patch for the painting of the overflow:auto elements.

Additional issues:
- invalid scrollbar appears in some situations: https://bugs.webkit.org/show_bug.cgi?id=132562
- hit-testing does not work properly on the overflow:auto element: https://bugs.webkit.org/show_bug.cgi?id=132563
Comment 4 Dave Hyatt 2014-05-05 07:52:21 PDT
Comment on attachment 230822 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=230822&action=review

r-

> Source/WebCore/rendering/RenderLayer.cpp:5657
> +            // Boxes inside flow threads don't have their logical left computed to avoid
> +            // floats. Instead, that information is kept in their RenderBoxRegionInfo structure.
> +            // As such, the layer bounds must be enlarged to encompass their background rect
> +            // to ensure intersecting them won't result in an empty rect, which would eventually
> +            // cause paint rejection.
> +            if (flowThread) {
> +                if (flowThread->style().isHorizontalWritingMode())
> +                    layerBounds.shiftMaxXEdgeTo(std::max(layerBounds.maxX(), backgroundRect.rect().maxX()));
> +                else
> +                    layerBounds.shiftMaxYEdgeTo(std::max(layerBounds.maxY(), backgroundRect.rect().maxY()));
> +            }

Don't run this code for columns, so change to if (flowThread && flowThread->isNamedRenderFlowThread())
Comment 5 Radu Stavila 2014-05-05 07:57:31 PDT
Created attachment 230830 [details]
Patch implementing reviewer feedback
Comment 6 Radu Stavila 2014-05-05 07:59:46 PDT
Created attachment 230831 [details]
Patch implementing reviewer feedback
Comment 7 Dave Hyatt 2014-05-05 08:00:39 PDT
Comment on attachment 230831 [details]
Patch implementing reviewer feedback

r=me
Comment 8 WebKit Commit Bot 2014-05-05 09:15:16 PDT
Comment on attachment 230831 [details]
Patch implementing reviewer feedback

Clearing flags on attachment: 230831

Committed r168288: <http://trac.webkit.org/changeset/168288>
Comment 9 WebKit Commit Bot 2014-05-05 09:15:21 PDT
All reviewed patches have been landed.  Closing bug.