Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: WebCore/dom/ContainerNode.cpp

Issue 3007044: Merge 63865 - 2010-07-21 Justin Schuh <jschuh@chromium.org>... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/WebKit/375/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/custom/use-invalid-html-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/use-invalid-html-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698