From a62ca722ae8a4b22ca0c7f9a661bd6221f3c31fc Mon Sep 17 00:00:00 2001 From: "achicu@adobe.com" Date: Tue, 27 Nov 2012 22:23:24 +0000 Subject: [PATCH] [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region https://bugs.webkit.org/show_bug.cgi?id=102826 Reviewed by David Hyatt. Source/WebCore: When the page is composited, all the elements will have a composited repaint container. In that case we will never catch the repaints in the RenderFlowThread, but they will go directly to the RenderView. There's a single case when the parent composited layer of an element inside the RenderFlowThread will get its own repaints. That case only happens when the parent composited layer is also part of the same flow thread. Right now compositing is disabled for elements inside the RenderFlowThread, so that case doesn't even happen yet. That will be fixed in https://bugs.webkit.org/show_bug.cgi?id=84900. Test: fast/repaint/region-painting-in-composited-view.html * rendering/RenderObject.cpp: (WebCore::RenderObject::containerForRepaint): LayoutTests: Added test file to check for repainting inside a RenderFlowThread when the page is in composited mode. * fast/repaint/region-painting-in-composited-view-expected.html: Added. * fast/repaint/region-painting-in-composited-view.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135921 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 12 ++++ ...-painting-in-composited-view-expected.html | 39 +++++++++++++ .../region-painting-in-composited-view.html | 58 +++++++++++++++++++ Source/WebCore/ChangeLog | 19 ++++++ Source/WebCore/rendering/RenderObject.cpp | 13 +++-- 5 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html create mode 100644 LayoutTests/fast/repaint/region-painting-in-composited-view.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 52b4c5034cc..4e741ed4ece 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2012-11-27 Alexandru Chiculita + + [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region + https://bugs.webkit.org/show_bug.cgi?id=102826 + + Reviewed by David Hyatt. + + Added test file to check for repainting inside a RenderFlowThread when the page is in composited mode. + + * fast/repaint/region-painting-in-composited-view-expected.html: Added. + * fast/repaint/region-painting-in-composited-view.html: Added. + 2012-11-27 Tony Chang Unreviewed, updating TestExpectations after input slider change. diff --git a/LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html b/LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html new file mode 100644 index 00000000000..404b5e811b2 --- /dev/null +++ b/LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html @@ -0,0 +1,39 @@ + + +Test for https://bugs.webkit.org/show_bug.cgi?id=102826 + + + + + +
+
+ + diff --git a/LayoutTests/fast/repaint/region-painting-in-composited-view.html b/LayoutTests/fast/repaint/region-painting-in-composited-view.html new file mode 100644 index 00000000000..d027117951c --- /dev/null +++ b/LayoutTests/fast/repaint/region-painting-in-composited-view.html @@ -0,0 +1,58 @@ + + +Test for https://bugs.webkit.org/show_bug.cgi?id=102826 + + + + + + + +
+
+
+
+
+ + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 692b71536cf..ddf08c8dafc 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2012-11-27 Alexandru Chiculita + + [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region + https://bugs.webkit.org/show_bug.cgi?id=102826 + + Reviewed by David Hyatt. + + When the page is composited, all the elements will have a composited repaint container. In that case we will + never catch the repaints in the RenderFlowThread, but they will go directly to the RenderView. + There's a single case when the parent composited layer of an element inside the RenderFlowThread will get + its own repaints. That case only happens when the parent composited layer is also part of the same flow thread. + Right now compositing is disabled for elements inside the RenderFlowThread, so that case doesn't even happen yet. + That will be fixed in https://bugs.webkit.org/show_bug.cgi?id=84900. + + Test: fast/repaint/region-painting-in-composited-view.html + + * rendering/RenderObject.cpp: + (WebCore::RenderObject::containerForRepaint): + 2012-11-27 Tony Chang Unreviewed, win compile fix take 2. diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp index 15dcdd05829..754aee11168 100644 --- a/Source/WebCore/rendering/RenderObject.cpp +++ b/Source/WebCore/rendering/RenderObject.cpp @@ -1290,12 +1290,15 @@ RenderLayerModelObject* RenderObject::containerForRepaint() const #endif // If we have a flow thread, then we need to do individual repaints within the RenderRegions instead. - // Return the flow thread as a repaint container in order to create a chokepoint that allows us to change + // Return the flow thread as a repaint container in order to create a checkpoint that allows us to change // repainting to do individual region repaints. - // FIXME: Composited layers inside a flow thread will bypass this mechanism and will malfunction. It's not - // clear how to address this problem for composited descendants of a RenderFlowThread. - if (!repaintContainer && inRenderFlowThread()) - repaintContainer = enclosingRenderFlowThread(); + if (inRenderFlowThread()) { + RenderFlowThread* parentRenderFlowThread = enclosingRenderFlowThread(); + // If we have already found a repaint container then we will repaint into that container only if it is part of the same + // flow thread. Otherwise we will need to catch the repaint call and send it to the flow thread. + if (!(repaintContainer && repaintContainer->inRenderFlowThread() && repaintContainer->enclosingRenderFlowThread() == parentRenderFlowThread)) + repaintContainer = parentRenderFlowThread; + } return repaintContainer; }