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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 if (removedChild->inDocument()) | 598 if (removedChild->inDocument()) |
599 removedChild->removedFromDocument(); | 599 removedChild->removedFromDocument(); |
600 // removeChild() calls removedFromTree(true) if the child was not in the | 600 // removeChild() calls removedFromTree(true) if the child was not in the |
601 // document. There is no explanation for this discrepancy between remove
Child() | 601 // document. There is no explanation for this discrepancy between remove
Child() |
602 // and its optimized version removeChildren(). | 602 // and its optimized version removeChildren(). |
603 } | 603 } |
604 } | 604 } |
605 | 605 |
606 bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
ol shouldLazyAttach) | 606 bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
ol shouldLazyAttach) |
607 { | 607 { |
| 608 RefPtr<ContainerNode> protector(this); |
| 609 |
608 // Check that this node is not "floating". | 610 // Check that this node is not "floating". |
609 // If it is, it can be deleted as a side effect of sending mutation events. | 611 // If it is, it can be deleted as a side effect of sending mutation events. |
610 ASSERT(refCount() || parentOrHostNode()); | 612 ASSERT(refCount() || parentOrHostNode()); |
611 | 613 |
612 ec = 0; | 614 ec = 0; |
613 | 615 |
614 // Make sure adding the new child is ok | 616 // Make sure adding the new child is ok |
615 checkAddChild(newChild.get(), ec); | 617 checkAddChild(newChild.get(), ec); |
616 if (ec) | 618 if (ec) |
617 return false; | 619 return false; |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) | 1166 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) |
1165 return true; | 1167 return true; |
1166 | 1168 |
1167 RefPtr<ContainerNode> protector(this); | 1169 RefPtr<ContainerNode> protector(this); |
1168 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL)
; | 1170 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL)
; |
1169 dispatchEvent(beforeLoadEvent.get()); | 1171 dispatchEvent(beforeLoadEvent.get()); |
1170 return !beforeLoadEvent->defaultPrevented(); | 1172 return !beforeLoadEvent->defaultPrevented(); |
1171 } | 1173 } |
1172 | 1174 |
1173 } // namespace WebCore | 1175 } // namespace WebCore |
OLD | NEW |