OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |