Commit 3d53764a authored by thatcher's avatar thatcher

Reviewed by Harrison.

        <rdar://problem/4796730> table deletion elements are serialized out if they are visible when innerHTML or a Web Archive is made

        Disable the delete button controller when cloning nodes, Mail does this before saving a draft.

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::cloneChildNodes):
        * editing/markup.cpp:
        (WebCore::createFragmentFromNodes):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e3143cdd
2006-11-17 Timothy Hatcher <timothy@apple.com>
Reviewed by Harrison.
<rdar://problem/4796730> table deletion elements are serialized out if they are visible when innerHTML or a Web Archive is made
Disable the delete button controller when cloning nodes, Mail does this before saving a draft.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes):
* editing/markup.cpp:
(WebCore::createFragmentFromNodes):
2006-11-17 Justin Garcia <justin.garcia@apple.com> 2006-11-17 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison Reviewed by harrison
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include "config.h" #include "config.h"
#include "ContainerNode.h" #include "ContainerNode.h"
#include "DeleteButtonController.h"
#include "Document.h" #include "Document.h"
#include "Editor.h"
#include "EventNames.h" #include "EventNames.h"
#include "ExceptionCode.h" #include "ExceptionCode.h"
#include "FrameView.h" #include "FrameView.h"
...@@ -652,9 +654,14 @@ void ContainerNode::removedFromTree(bool deep) ...@@ -652,9 +654,14 @@ void ContainerNode::removedFromTree(bool deep)
void ContainerNode::cloneChildNodes(Node *clone) void ContainerNode::cloneChildNodes(Node *clone)
{ {
// disable the delete button so it's elements are not serialized into the markup
if (document()->frame())
document()->frame()->editor()->deleteButtonController()->disable();
ExceptionCode ec = 0; ExceptionCode ec = 0;
for (Node* n = firstChild(); n && !ec; n = n->nextSibling()) for (Node* n = firstChild(); n && !ec; n = n->nextSibling())
clone->appendChild(n->cloneNode(true), ec); clone->appendChild(n->cloneNode(true), ec);
if (document()->frame())
document()->frame()->editor()->deleteButtonController()->enable();
} }
bool ContainerNode::getUpperLeftCorner(int &xPos, int &yPos) const bool ContainerNode::getUpperLeftCorner(int &xPos, int &yPos) const
......
...@@ -693,7 +693,11 @@ PassRefPtr<DocumentFragment> createFragmentFromNodes(Document *document, const V ...@@ -693,7 +693,11 @@ PassRefPtr<DocumentFragment> createFragmentFromNodes(Document *document, const V
{ {
if (!document) if (!document)
return 0; return 0;
// disable the delete button so it's elements are not serialized into the markup
if (document->frame())
document->frame()->editor()->deleteButtonController()->disable();
RefPtr<DocumentFragment> fragment = document->createDocumentFragment(); RefPtr<DocumentFragment> fragment = document->createDocumentFragment();
ExceptionCode ec = 0; ExceptionCode ec = 0;
...@@ -706,6 +710,9 @@ PassRefPtr<DocumentFragment> createFragmentFromNodes(Document *document, const V ...@@ -706,6 +710,9 @@ PassRefPtr<DocumentFragment> createFragmentFromNodes(Document *document, const V
ASSERT(ec == 0); ASSERT(ec == 0);
} }
if (document->frame())
document->frame()->editor()->deleteButtonController()->enable();
return fragment.release(); return fragment.release();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment