| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // ASSERT(!oldChild->isPseudoElement()) | 418 // ASSERT(!oldChild->isPseudoElement()) |
| 419 if (!oldChild || oldChild->parentNode() != this || oldChild->isPseudoElement
()) { | 419 if (!oldChild || oldChild->parentNode() != this || oldChild->isPseudoElement
()) { |
| 420 exceptionState.throwDOMException(NotFoundError, "The node to be removed
is not a child of this node."); | 420 exceptionState.throwDOMException(NotFoundError, "The node to be removed
is not a child of this node."); |
| 421 return; | 421 return; |
| 422 } | 422 } |
| 423 | 423 |
| 424 RefPtr<Node> child = oldChild; | 424 RefPtr<Node> child = oldChild; |
| 425 | 425 |
| 426 document().removeFocusedElementOfSubtree(child.get()); | 426 document().removeFocusedElementOfSubtree(child.get()); |
| 427 | 427 |
| 428 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(&document())) | 428 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(document())) |
| 429 fullscreen->removeFullScreenElementOfSubtree(child.get()); | 429 fullscreen->removeFullScreenElementOfSubtree(child.get()); |
| 430 | 430 |
| 431 // Events fired when blurring currently focused node might have moved this | 431 // Events fired when blurring currently focused node might have moved this |
| 432 // child into a different parent. | 432 // child into a different parent. |
| 433 if (child->parentNode() != this) { | 433 if (child->parentNode() != this) { |
| 434 exceptionState.throwDOMException(NotFoundError, "The node to be removed
is no longer a child of this node. Perhaps it was moved in a 'blur' event handle
r?"); | 434 exceptionState.throwDOMException(NotFoundError, "The node to be removed
is no longer a child of this node. Perhaps it was moved in a 'blur' event handle
r?"); |
| 435 return; | 435 return; |
| 436 } | 436 } |
| 437 | 437 |
| 438 willRemoveChild(*child); | 438 willRemoveChild(*child); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // this differs from other remove functions because it forcibly removes all the
children, | 502 // this differs from other remove functions because it forcibly removes all the
children, |
| 503 // regardless of read-only status or event exceptions, e.g. | 503 // regardless of read-only status or event exceptions, e.g. |
| 504 void ContainerNode::removeChildren() | 504 void ContainerNode::removeChildren() |
| 505 { | 505 { |
| 506 if (!m_firstChild) | 506 if (!m_firstChild) |
| 507 return; | 507 return; |
| 508 | 508 |
| 509 // The container node can be removed from event handlers. | 509 // The container node can be removed from event handlers. |
| 510 RefPtr<ContainerNode> protect(this); | 510 RefPtr<ContainerNode> protect(this); |
| 511 | 511 |
| 512 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(&document())) | 512 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(document())) |
| 513 fullscreen->removeFullScreenElementOfSubtree(this, true); | 513 fullscreen->removeFullScreenElementOfSubtree(this, true); |
| 514 | 514 |
| 515 // Do any prep work needed before actually starting to detach | 515 // Do any prep work needed before actually starting to detach |
| 516 // and remove... e.g. stop loading frames, fire unload events. | 516 // and remove... e.g. stop loading frames, fire unload events. |
| 517 willRemoveChildren(); | 517 willRemoveChildren(); |
| 518 | 518 |
| 519 { | 519 { |
| 520 // Removing focus can cause frames to load, either via events (focusout,
blur) | 520 // Removing focus can cause frames to load, either via events (focusout,
blur) |
| 521 // or widget updates (e.g., for <embed>). | 521 // or widget updates (e.g., for <embed>). |
| 522 SubframeLoadingDisabler disabler(*this); | 522 SubframeLoadingDisabler disabler(*this); |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 return true; | 1038 return true; |
| 1039 | 1039 |
| 1040 if (node->isElementNode() && toElement(node)->shadow()) | 1040 if (node->isElementNode() && toElement(node)->shadow()) |
| 1041 return true; | 1041 return true; |
| 1042 | 1042 |
| 1043 return false; | 1043 return false; |
| 1044 } | 1044 } |
| 1045 #endif | 1045 #endif |
| 1046 | 1046 |
| 1047 } // namespace WebCore | 1047 } // namespace WebCore |
| OLD | NEW |