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

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: start paint at parent stacking context & add test 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698