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

Unified Diff: Source/WebCore/page/Frame.cpp

Issue 10763005: Merge 121388 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « LayoutTests/fast/events/drag-display-none-element-expected.txt ('k') | Source/WebCore/page/mac/FrameMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/Frame.cpp
===================================================================
--- Source/WebCore/page/Frame.cpp (revision 122138)
+++ Source/WebCore/page/Frame.cpp (working copy)
@@ -1049,38 +1049,39 @@
#if !PLATFORM(MAC) && !PLATFORM(WIN)
struct ScopedFramePaintingState {
- ScopedFramePaintingState(Frame* theFrame, RenderObject* theRenderer)
- : frame(theFrame)
- , renderer(theRenderer)
+ ScopedFramePaintingState(Frame* frame, Node* node)
+ : frame(frame)
+ , node(node)
, paintBehavior(frame->view()->paintBehavior())
, backgroundColor(frame->view()->baseBackgroundColor())
{
+ ASSERT(!node || node->renderer());
+ if (node)
+ node->renderer()->updateDragState(true);
}
~ScopedFramePaintingState()
{
- if (renderer)
- renderer->updateDragState(false);
+ if (node && node->renderer())
+ node->renderer()->updateDragState(false);
frame->view()->setPaintBehavior(paintBehavior);
frame->view()->setBaseBackgroundColor(backgroundColor);
frame->view()->setNodeToDraw(0);
}
Frame* frame;
- RenderObject* renderer;
+ Node* node;
PaintBehavior paintBehavior;
Color backgroundColor;
};
DragImageRef Frame::nodeImage(Node* node)
{
- RenderObject* renderer = node->renderer();
- if (!renderer)
+ if (!node->renderer())
return 0;
- const ScopedFramePaintingState state(this, renderer);
+ const ScopedFramePaintingState state(this, node);
- renderer->updateDragState(true);
m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositingLayers);
// When generating the drag image for an element, ignore the document background.
@@ -1088,6 +1089,11 @@
m_doc->updateLayout();
m_view->setNodeToDraw(node); // Enable special sub-tree drawing mode.
+ // Document::updateLayout may have blown away the original RenderObject.
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return 0;
+
LayoutRect topLevelRect;
IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
« no previous file with comments | « LayoutTests/fast/events/drag-display-none-element-expected.txt ('k') | Source/WebCore/page/mac/FrameMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698