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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 920433002: Gracefully handle a disconnected popup menu client on disposing open popup. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rework test, mac-friendly Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 return detachingNode == this; 912 return detachingNode == this;
913 } 913 }
914 #endif 914 #endif
915 915
916 void Node::detach(const AttachContext& context) 916 void Node::detach(const AttachContext& context)
917 { 917 {
918 ASSERT(document().lifecycle().stateAllowsDetach()); 918 ASSERT(document().lifecycle().stateAllowsDetach());
919 DocumentLifecycle::DetachScope willDetach(document().lifecycle()); 919 DocumentLifecycle::DetachScope willDetach(document().lifecycle());
920 920
921 #if ENABLE(ASSERT) 921 #if ENABLE(ASSERT)
922 ASSERT(!detachingNode); 922 // The detaching might trigger destruction of a popup menu window,
923 // with ensuing detachment of its Nodes. In a separate document, so
924 // don't assert for these, but do set detachingNode to the most recent
925 // Node being detached.
926 ASSERT(!detachingNode || detachingNode->document() != document());
923 detachingNode = this; 927 detachingNode = this;
924 #endif 928 #endif
925 929
926 if (renderer()) 930 if (renderer())
927 renderer()->destroyAndCleanupAnonymousWrappers(); 931 renderer()->destroyAndCleanupAnonymousWrappers();
928 setRenderer(nullptr); 932 setRenderer(nullptr);
929 933
930 // Do not remove the element's hovered and active status 934 // Do not remove the element's hovered and active status
931 // if performing a reattach. 935 // if performing a reattach.
932 if (!context.performingReattach) { 936 if (!context.performingReattach) {
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 node->showTreeForThis(); 2438 node->showTreeForThis();
2435 } 2439 }
2436 2440
2437 void showNodePath(const blink::Node* node) 2441 void showNodePath(const blink::Node* node)
2438 { 2442 {
2439 if (node) 2443 if (node)
2440 node->showNodePathForThis(); 2444 node->showNodePathForThis();
2441 } 2445 }
2442 2446
2443 #endif 2447 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/select-popup-close-no-crash-expected.txt ('k') | Source/web/PopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698