Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1982943002: Drag images should paint descendants that are painting siblings of the dragged element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments & rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 7c3d3c8fdbab02ea6d53147203d2a73ede7daee6..d253c7341028884de5238bf20049342ed5f786ef 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -618,16 +618,17 @@ PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node)
if (!layoutObject)
return nullptr;
- // Paint starting at the nearest self painting layer, clipped to the object itself.
- // TODO(pdr): This will also paint the content behind the object if the object contains
- // 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();
+ // Paint starting at the nearest stacking context, clipped to the object itself.
+ // This will also paint the contents behind the object if the object contains transparency
+ // and there are other elements in the same stacking context which stacked below.
+ 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);
}

Powered by Google App Engine
This is Rietveld 408576698