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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 Node::childrenChanged(changedByParser, beforeChange, afterChange, childCount
Delta); | 668 Node::childrenChanged(changedByParser, beforeChange, afterChange, childCount
Delta); |
669 if (!changedByParser && childCountDelta) | 669 if (!changedByParser && childCountDelta) |
670 document()->nodeChildrenChanged(this); | 670 document()->nodeChildrenChanged(this); |
671 if (document()->hasNodeListCaches()) | 671 if (document()->hasNodeListCaches()) |
672 notifyNodeListsChildrenChanged(); | 672 notifyNodeListsChildrenChanged(); |
673 } | 673 } |
674 | 674 |
675 void ContainerNode::cloneChildNodes(ContainerNode *clone) | 675 void ContainerNode::cloneChildNodes(ContainerNode *clone) |
676 { | 676 { |
677 // disable the delete button so it's elements are not serialized into the ma
rkup | 677 // disable the delete button so it's elements are not serialized into the ma
rkup |
678 if (document()->frame()) | 678 bool isEditorEnabled = document()->frame() && document()->frame()->editor()-
>canEdit(); |
| 679 if (isEditorEnabled) |
679 document()->frame()->editor()->deleteButtonController()->disable(); | 680 document()->frame()->editor()->deleteButtonController()->disable(); |
680 ExceptionCode ec = 0; | 681 ExceptionCode ec = 0; |
681 for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) | 682 for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) |
682 clone->appendChild(n->cloneNode(true), ec); | 683 clone->appendChild(n->cloneNode(true), ec); |
683 if (document()->frame()) | 684 if (isEditorEnabled && document()->frame()) |
684 document()->frame()->editor()->deleteButtonController()->enable(); | 685 document()->frame()->editor()->deleteButtonController()->enable(); |
685 } | 686 } |
686 | 687 |
687 // FIXME: This doesn't work correctly with transforms. | 688 // FIXME: This doesn't work correctly with transforms. |
688 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const | 689 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const |
689 { | 690 { |
690 if (!renderer()) | 691 if (!renderer()) |
691 return false; | 692 return false; |
692 // What is this code really trying to do? | 693 // What is this code really trying to do? |
693 RenderObject *o = renderer(); | 694 RenderObject *o = renderer(); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) | 973 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) |
973 return true; | 974 return true; |
974 | 975 |
975 RefPtr<ContainerNode> protector(this); | 976 RefPtr<ContainerNode> protector(this); |
976 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL)
; | 977 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL)
; |
977 dispatchEvent(beforeLoadEvent.get()); | 978 dispatchEvent(beforeLoadEvent.get()); |
978 return !beforeLoadEvent->defaultPrevented(); | 979 return !beforeLoadEvent->defaultPrevented(); |
979 } | 980 } |
980 | 981 |
981 } // namespace WebCore | 982 } // namespace WebCore |
OLD | NEW |