Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| index ab8078288b9368808d1db8f783d5c55c3ac60220..dccb50f1c9a6015666faf2c0367913af7eb63fe8 100644 |
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| @@ -617,16 +617,18 @@ PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) |
| if (!layoutObject) |
| return nullptr; |
| - // Paint starting at the nearest self painting layer, clipped to the object itself. |
| + // Paint starting at the nearest stacking context, clipped to the object itself. |
|
chrishtr
2016/05/19 17:45:16
I wonder if we should explicitly clip now, to avoi
trchen
2016/05/23 19:37:53
As discussed offline, it is already clipped.
|
| // TODO(pdr): This will also paint the content behind the object if the object contains |
|
chrishtr
2016/05/19 17:46:52
I'd change this to a note instead of a TODO. There
trchen
2016/05/23 19:37:53
Done.
|
| // transparency but the layer is opaque. We could directly call layoutObject->paint(...) |
| // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-painting children. |
| - PaintLayer* layer = layoutObject->enclosingLayer()->enclosingSelfPaintingLayer(); |
| + PaintLayer* layer = layoutObject->enclosingLayer(); |
| + if (!layer->stackingNode()->isStackingContext()) |
| + layer = layer->stackingNode()->ancestorStackingContextNode()->layer(); |
| IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncludingDescendants(); |
| FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad(absoluteBoundingBox), UseTransforms).boundingBox(); |
| DragImageBuilder dragImageBuilder(this, boundingBox, &node); |
| { |
| - PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), GlobalPaintFlattenCompositingLayers, LayoutSize(), 0); |
| + PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), GlobalPaintFlattenCompositingLayers, LayoutSize()); |
| PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTransform | PaintLayerUncachedClipRects; |
| PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintingInfo, flags); |
| } |