| 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 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 { | 540 { |
| 541 // Removing focus can cause frames to load, either via events (focusout,
blur) | 541 // Removing focus can cause frames to load, either via events (focusout,
blur) |
| 542 // or widget updates (e.g., for <embed>). | 542 // or widget updates (e.g., for <embed>). |
| 543 SubframeLoadingDisabler disabler(this); | 543 SubframeLoadingDisabler disabler(this); |
| 544 | 544 |
| 545 // Exclude this node when looking for removed focusedElement since only | 545 // Exclude this node when looking for removed focusedElement since only |
| 546 // children will be removed. | 546 // children will be removed. |
| 547 // This must be later than willRemoveChildren, which might change focus | 547 // This must be later than willRemoveChildren, which might change focus |
| 548 // state of a child. | 548 // state of a child. |
| 549 document().removeFocusedElementOfSubtree(this, true); | 549 document().removeFocusedElementOfSubtree(this, true); |
| 550 |
| 551 // Removing a node from a selection can cause widget updates. |
| 552 document().nodeChildrenWillBeRemoved(this); |
| 550 } | 553 } |
| 551 | 554 |
| 552 document().nodeChildrenWillBeRemoved(this); | |
| 553 | 555 |
| 554 NodeVector removedChildren; | 556 NodeVector removedChildren; |
| 555 { | 557 { |
| 556 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 558 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 557 { | 559 { |
| 558 NoEventDispatchAssertion assertNoEventDispatch; | 560 NoEventDispatchAssertion assertNoEventDispatch; |
| 559 removedChildren.reserveInitialCapacity(childNodeCount()); | 561 removedChildren.reserveInitialCapacity(childNodeCount()); |
| 560 while (m_firstChild) { | 562 while (m_firstChild) { |
| 561 removedChildren.append(m_firstChild); | 563 removedChildren.append(m_firstChild); |
| 562 removeBetween(0, m_firstChild->nextSibling(), *m_firstChild); | 564 removeBetween(0, m_firstChild->nextSibling(), *m_firstChild); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 return true; | 991 return true; |
| 990 | 992 |
| 991 if (node->isElementNode() && toElement(node)->shadow()) | 993 if (node->isElementNode() && toElement(node)->shadow()) |
| 992 return true; | 994 return true; |
| 993 | 995 |
| 994 return false; | 996 return false; |
| 995 } | 997 } |
| 996 #endif | 998 #endif |
| 997 | 999 |
| 998 } // namespace WebCore | 1000 } // namespace WebCore |
| OLD | NEW |