Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.cpp |
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp |
| index 9c306c9dd320254c78ad2ed96a6a0be03fe7c60c..537e45f942a4262622f83ede8795d4c85fd5727c 100644 |
| --- a/Source/core/rendering/RenderLayer.cpp |
| +++ b/Source/core/rendering/RenderLayer.cpp |
| @@ -814,18 +814,15 @@ LayoutPoint RenderLayer::location() const |
| localPoint += offset; |
| } |
| } else if (parent()) { |
| - // FIXME: This code is very wrong. The compositing system doesn't |
| - // understand columns and we're hacking around that fact by faking |
| - // the position of the RenderLayers when we think we'll end up being |
| - // composited. Hopefully we'll be able to unwind this hack when we |
| - // implement multi-column using regions. |
| + // FIXME: This code is very wrong, but luckily only needed in the old/current multicol |
| + // implementation. The compositing system doesn't understand columns and we're hacking |
| + // around that fact by faking the position of the RenderLayers when we think we'll end up |
| + // being composited. |
| if (hasStyleDeterminedDirectCompositingReasons()) { |
| // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column. |
| // They won't split across columns properly. |
| if (!parent()->renderer()->hasColumns() && parent()->renderer()->isDocumentElement() && renderer()->view()->hasColumns()) |
| localPoint += renderer()->view()->columnOffset(localPoint); |
| - else |
| - localPoint += parent()->renderer()->columnOffset(localPoint); |
|
andersr
2014/10/07 15:51:21
Composited RenderLayers now render at flow-thread
mstensho (USE GERRIT)
2014/10/07 16:35:59
Done.
|
| } |
| if (parent()->renderer()->hasOverflowClip()) { |
| @@ -1489,15 +1486,24 @@ void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer* |
| LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingBox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer); |
| layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); |
| - // Shift the dirty rect into flow thread coordinates. |
| + // Make the dirty rect relative to the fragmentation context (multicol container, etc.). |
| + RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginationLayer()->renderer()); |
| LayoutPoint offsetOfPaginationLayerFromRoot; |
| - enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginationLayerFromRoot); |
| + // FIXME: more work needed if there are nested pagination layers. |
| + if (rootLayer != enclosingPaginationLayer() && rootLayer->enclosingPaginationLayer() == enclosingPaginationLayer()) { |
| + // The root layer is inside the fragmentation context. So we need to look inside it and find |
| + // the visual offset from the fragmentation context. |
| + LayoutPoint flowThreadOffset; |
| + rootLayer->convertToLayerCoords(enclosingPaginationLayer(), flowThreadOffset); |
| + offsetOfPaginationLayerFromRoot = -enclosingFlowThread->flowThreadPointToVisualPoint(flowThreadOffset); |
| + } else { |
| + enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginationLayerFromRoot); |
| + } |
| LayoutRect dirtyRectInFlowThread(dirtyRect); |
| dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); |
| // Tell the flow thread to collect the fragments. We pass enough information to create a minimal number of fragments based off the pages/columns |
| // that intersect the actual dirtyRect as well as the pages/columns that intersect our layer's bounding box. |
| - RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginationLayer()->renderer()); |
| enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlowThread, dirtyRectInFlowThread); |
| if (fragments.isEmpty()) |