Bug 117074 - [CSS Regions] REGRESSION Incorrect layer clipping inside flow thread
Summary: [CSS Regions] REGRESSION Incorrect layer clipping inside flow thread
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mihnea Ovidenie
URL:
Keywords: AdobeTracked
Depends on: 117295
Blocks: 57312 84900
  Show dependency treegraph
 
Reported: 2013-05-31 07:07 PDT by Andrei Bucur
Modified: 2013-06-06 08:20 PDT (History)
10 users (show)

See Also:


Attachments
Test case (1.75 KB, text/html)
2013-05-31 07:07 PDT, Andrei Bucur
no flags Details
Patch (354.89 KB, patch)
2013-06-04 07:53 PDT, Mihnea Ovidenie
no flags Details | Formatted Diff | Diff
Patch for landing (355.86 KB, patch)
2013-06-05 01:02 PDT, Mihnea Ovidenie
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 2013-05-31 07:07:00 PDT
Created attachment 203444 [details]
Test case

fast/regions/overflow-size-change-with-stacking-context.html is failing for some time.
Comment 1 Mihnea Ovidenie 2013-06-02 09:57:00 PDT
It fails from https://bugs.webkit.org/show_bug.cgi?id=76486 because the clip rects get transformed in RenderView coordinates - through associated render regions - while the layer bounds are still in flow thread coordinates (the flow thread is the root layer). Because of that, the intersection between the layer bounds and the clip rects fails and the layer is not displayed.
Comment 2 Mihnea Ovidenie 2013-06-04 07:53:40 PDT
Created attachment 203697 [details]
Patch
Comment 3 Dave Hyatt 2013-06-04 12:26:35 PDT
Comment on attachment 203697 [details]
Patch

r=me
Comment 4 Mihnea Ovidenie 2013-06-05 01:02:51 PDT
Created attachment 203765 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2013-06-05 01:19:47 PDT
Comment on attachment 203765 [details]
Patch for landing

Clearing flags on attachment: 203765

Committed r151202: <http://trac.webkit.org/changeset/151202>
Comment 6 WebKit Commit Bot 2013-06-05 01:19:51 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Alexandru Chiculita 2013-06-05 15:32:45 PDT
(In reply to comment #6)
> All reviewed patches have been landed.  Closing bug.

It's better if you just moved this functionality to
RenderFlowThread::mapLocalToContainer. 

That's for two reasons: 
1) the RenderFlowThread check will only be hit when there's a RenderFlowThread object
on the chain. 
2) other non-RenderBox objects will benefit from that change.

void RenderFlowThread::mapLocalToContainer(const RenderLayerModelObject*
repaintContainer, TransformState& transformState, MapCoordinatesFlags mode,
bool* wasFixed) const
{
    if (repaintContainer == this)
        return;

    // Transform from render flow coordinates into region coordinates.
    if (RenderRegion* region = mapFromFlowToRegion(transformState))
       
static_cast<RenderObject*>(region)->mapLocalToContainer(region->containerForRepaint(),
transformState, mode, wasFixed);
}
Comment 8 Mihnea Ovidenie 2013-06-06 06:12:05 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > All reviewed patches have been landed.  Closing bug.
> 
> It's better if you just moved this functionality to
> RenderFlowThread::mapLocalToContainer. 
> 
> That's for two reasons: 
> 1) the RenderFlowThread check will only be hit when there's a RenderFlowThread object
> on the chain. 
> 2) other non-RenderBox objects will benefit from that change.
> 
> void RenderFlowThread::mapLocalToContainer(const RenderLayerModelObject*
> repaintContainer, TransformState& transformState, MapCoordinatesFlags mode,
> bool* wasFixed) const
> {
>     if (repaintContainer == this)
>         return;
> 
>     // Transform from render flow coordinates into region coordinates.
>     if (RenderRegion* region = mapFromFlowToRegion(transformState))
> 
> static_cast<RenderObject*>(region)->mapLocalToContainer(region->containerForRepaint(),
> transformState, mode, wasFixed);
> }

Ok, i will fix in https://bugs.webkit.org/show_bug.cgi?id=117290
Comment 9 Mihai Maerean 2013-06-06 08:20:59 PDT
> void RenderFlowThread::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
> if (RenderRegion* region = mapFromFlowToRegion(transformState))
> static_cast<RenderObject*>(region)->mapLocalToContainer(region->containerForRepaint(),  transformState, mode, wasFixed);

You need to either make RenderRegion::mapLocalToContainer public or make RenderFlowThread a friend class RenderRegion in order to call mapLocalToContainer from RenderFlowThread (instead of using static_cast to RenderObject).