Title: [151339] trunk/Source/WebCore
Revision
151339
Author
ach...@adobe.com
Date
2013-06-07 15:36:23 -0700 (Fri, 07 Jun 2013)

Log Message

[CSS Regions] Layers inside the RenderFlowThread should be collected by the layer of RenderView
https://bugs.webkit.org/show_bug.cgi?id=117270

Reviewed by David Hyatt.

RenderNamedFlowThreads are attached to the RenderView, but they are painted
and hit-tested through their regions. The easiest way to prevent the RenderView
from seeing the RenderNamedFlowThreads as its own children was to avoid collecting
the layers of the RenderNamedFlowThreads as children layers of the RenderView.

However, most of the code is analyzing the layers tree starting from the root,
so having the RenderNamedFlowThread participate in the layer tree is needed
in order to enable compositing for layers inside the flow thread.

This patch makes the RenderNamedFlowThread visible to the RenderView, but
ignores it when iterates the children of the RenderView in paint and hit-test methods.

No new tests, no visible changes.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::hitTestList):
(WebCore::RenderLayer::calculateLayerBounds):
(WebCore::RenderLayer::collectLayers):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151338 => 151339)


--- trunk/Source/WebCore/ChangeLog	2013-06-07 22:04:59 UTC (rev 151338)
+++ trunk/Source/WebCore/ChangeLog	2013-06-07 22:36:23 UTC (rev 151339)
@@ -1,3 +1,32 @@
+2013-06-07  Alexandru Chiculita  <ach...@adobe.com>
+
+        [CSS Regions] Layers inside the RenderFlowThread should be collected by the layer of RenderView
+        https://bugs.webkit.org/show_bug.cgi?id=117270
+
+        Reviewed by David Hyatt.
+
+        RenderNamedFlowThreads are attached to the RenderView, but they are painted 
+        and hit-tested through their regions. The easiest way to prevent the RenderView 
+        from seeing the RenderNamedFlowThreads as its own children was to avoid collecting
+        the layers of the RenderNamedFlowThreads as children layers of the RenderView.
+
+        However, most of the code is analyzing the layers tree starting from the root,
+        so having the RenderNamedFlowThread participate in the layer tree is needed
+        in order to enable compositing for layers inside the flow thread.
+
+        This patch makes the RenderNamedFlowThread visible to the RenderView, but
+        ignores it when iterates the children of the RenderView in paint and hit-test methods.
+
+        No new tests, no visible changes.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintList):
+        (WebCore::RenderLayer::hitTestList):
+        (WebCore::RenderLayer::calculateLayerBounds):
+        (WebCore::RenderLayer::collectLayers):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::writeLayers):
+
 2013-06-07  Bear Travis  <betra...@adobe.com>
 
         [CSS Exclusions][CSS Shapes] Incorrect compile flag in LayoutState.h

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (151338 => 151339)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-06-07 22:04:59 UTC (rev 151338)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-06-07 22:36:23 UTC (rev 151339)
@@ -4021,6 +4021,8 @@
 
     for (size_t i = 0; i < list->size(); ++i) {
         RenderLayer* childLayer = list->at(i);
+        if (childLayer->isOutOfFlowRenderFlowThread())
+            continue;
         if (!childLayer->isPaginated())
             childLayer->paintLayer(context, paintingInfo, paintFlags);
         else
@@ -4858,6 +4860,8 @@
     RenderLayer* resultLayer = 0;
     for (int i = list->size() - 1; i >= 0; --i) {
         RenderLayer* childLayer = list->at(i);
+        if (childLayer->isOutOfFlowRenderFlowThread())
+            continue;
         RenderLayer* hitLayer = 0;
         HitTestResult tempResult(result.hitTestLocation());
         if (childLayer->isPaginated())
@@ -5507,6 +5511,9 @@
         size_t listSize = normalFlowList->size();
         for (size_t i = 0; i < listSize; ++i) {
             RenderLayer* curLayer = normalFlowList->at(i);
+            // RenderView will always return the size of the document, before reaching this point,
+            // so there's no way we could hit a RenderNamedFlowThread here.
+            ASSERT(!curLayer->isOutOfFlowRenderFlowThread());
             if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) {
                 IntRect curAbsBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags);
                 unionBounds.unite(curAbsBounds);
@@ -5838,7 +5845,7 @@
     bool isStacking = behavior == StopAtStackingContexts ? isStackingContext() : isStackingContainer();
     // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists.
     bool includeHiddenLayer = includeHiddenLayers || (m_hasVisibleContent || (m_hasVisibleDescendant && isStacking));
-    if (includeHiddenLayer && !isNormalFlowOnly() && !isOutOfFlowRenderFlowThread()) {
+    if (includeHiddenLayer && !isNormalFlowOnly()) {
         // Determine which buffer the child should be in.
         OwnPtr<Vector<RenderLayer*> >& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
 

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (151338 => 151339)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2013-06-07 22:04:59 UTC (rev 151338)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2013-06-07 22:36:23 UTC (rev 151339)
@@ -770,14 +770,22 @@
     }
 
     if (Vector<RenderLayer*>* posList = l->posZOrderList()) {
-        int currIndent = indent;
-        if (behavior & RenderAsTextShowLayerNesting) {
-            writeIndent(ts, indent);
-            ts << " positive z-order list(" << posList->size() << ")\n";
-            ++currIndent;
+        size_t layerCount = 0;
+        for (unsigned i = 0; i != posList->size(); ++i)
+            if (!posList->at(i)->isOutOfFlowRenderFlowThread())
+                ++layerCount;
+        if (layerCount) {
+            int currIndent = indent;
+            if (behavior & RenderAsTextShowLayerNesting) {
+                writeIndent(ts, indent);
+                ts << " positive z-order list(" << layerCount << ")\n";
+                ++currIndent;
+            }
+            for (unsigned i = 0; i != posList->size(); ++i) {
+                if (!posList->at(i)->isOutOfFlowRenderFlowThread())
+                    writeLayers(ts, rootLayer, posList->at(i), paintDirtyRect, currIndent, behavior);
+            }
         }
-        for (unsigned i = 0; i != posList->size(); ++i)
-            writeLayers(ts, rootLayer, posList->at(i), paintDirtyRect, currIndent, behavior);
     }
     
     // Altough the RenderFlowThread requires a layer, it is not collected by its parent,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to