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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 void ContainerNode::childrenChanged(bool changedByParser, Node*, Node*, int chil
dCountDelta) | 683 void ContainerNode::childrenChanged(bool changedByParser, Node*, Node*, int chil
dCountDelta) |
684 { | 684 { |
685 document()->incDOMTreeVersion(); | 685 document()->incDOMTreeVersion(); |
686 if (!changedByParser && childCountDelta) | 686 if (!changedByParser && childCountDelta) |
687 document()->updateRangesAfterChildrenChanged(this); | 687 document()->updateRangesAfterChildrenChanged(this); |
688 invalidateNodeListCachesInAncestors(); | 688 invalidateNodeListCachesInAncestors(); |
689 } | 689 } |
690 | 690 |
691 void ContainerNode::cloneChildNodes(ContainerNode *clone) | 691 void ContainerNode::cloneChildNodes(ContainerNode *clone) |
692 { | 692 { |
693 // disable the delete button so it's elements are not serialized into the ma
rkup | 693 HTMLElement* deleteButtonContainerElement = 0; |
694 bool isEditorEnabled = false; | 694 if (Frame* frame = document()->frame()) |
695 if (document()->frame() && document()->frame()->editor()->canEdit()) { | 695 deleteButtonContainerElement = frame->editor()->deleteButtonController()
->containerElement(); |
696 FrameSelection* selection = document()->frame()->selection(); | |
697 Element* root = selection ? selection->rootEditableElement() : 0; | |
698 isEditorEnabled = root && isDescendantOf(root); | |
699 | 696 |
700 if (isEditorEnabled) | 697 ExceptionCode ec = 0; |
701 document()->frame()->editor()->deleteButtonController()->disable(); | 698 for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) { |
| 699 if (n == deleteButtonContainerElement) |
| 700 continue; |
| 701 clone->appendChild(n->cloneNode(true), ec); |
702 } | 702 } |
703 | |
704 ExceptionCode ec = 0; | |
705 for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) | |
706 clone->appendChild(n->cloneNode(true), ec); | |
707 if (isEditorEnabled && document()->frame()) | |
708 document()->frame()->editor()->deleteButtonController()->enable(); | |
709 } | 703 } |
710 | 704 |
711 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const | 705 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const |
712 { | 706 { |
713 if (!renderer()) | 707 if (!renderer()) |
714 return false; | 708 return false; |
715 // What is this code really trying to do? | 709 // What is this code really trying to do? |
716 RenderObject *o = renderer(); | 710 RenderObject *o = renderer(); |
717 RenderObject *p = o; | 711 RenderObject *p = o; |
718 | 712 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 if (shouldLazyAttach) | 982 if (shouldLazyAttach) |
989 child->lazyAttach(); | 983 child->lazyAttach(); |
990 else | 984 else |
991 child->attach(); | 985 child->attach(); |
992 } | 986 } |
993 | 987 |
994 dispatchChildInsertionEvents(child); | 988 dispatchChildInsertionEvents(child); |
995 } | 989 } |
996 | 990 |
997 } // namespace WebCore | 991 } // namespace WebCore |
OLD | NEW |