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

Unified Diff: Source/WebCore/dom/ContainerNode.cpp

Issue 10878069: Merge 124914 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/clone-node-load-event-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/ContainerNode.cpp
===================================================================
--- Source/WebCore/dom/ContainerNode.cpp (revision 126666)
+++ Source/WebCore/dom/ContainerNode.cpp (working copy)
@@ -690,22 +690,16 @@
void ContainerNode::cloneChildNodes(ContainerNode *clone)
{
- // disable the delete button so it's elements are not serialized into the markup
- bool isEditorEnabled = false;
- if (document()->frame() && document()->frame()->editor()->canEdit()) {
- FrameSelection* selection = document()->frame()->selection();
- Element* root = selection ? selection->rootEditableElement() : 0;
- isEditorEnabled = root && isDescendantOf(root);
+ HTMLElement* deleteButtonContainerElement = 0;
+ if (Frame* frame = document()->frame())
+ deleteButtonContainerElement = frame->editor()->deleteButtonController()->containerElement();
- if (isEditorEnabled)
- document()->frame()->editor()->deleteButtonController()->disable();
- }
-
ExceptionCode ec = 0;
- for (Node* n = firstChild(); n && !ec; n = n->nextSibling())
+ for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) {
+ if (n == deleteButtonContainerElement)
+ continue;
clone->appendChild(n->cloneNode(true), ec);
- if (isEditorEnabled && document()->frame())
- document()->frame()->editor()->deleteButtonController()->enable();
+ }
}
bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
« no previous file with comments | « LayoutTests/fast/dom/clone-node-load-event-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698