summaryrefslogtreecommitdiffstats
path: root/WebCore/editing/InsertNodeBeforeCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/editing/InsertNodeBeforeCommand.cpp')
-rw-r--r--WebCore/editing/InsertNodeBeforeCommand.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/WebCore/editing/InsertNodeBeforeCommand.cpp b/WebCore/editing/InsertNodeBeforeCommand.cpp
index 4f60963..2ce9846 100644
--- a/WebCore/editing/InsertNodeBeforeCommand.cpp
+++ b/WebCore/editing/InsertNodeBeforeCommand.cpp
@@ -46,7 +46,7 @@ InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtr<Node> insertChild, P
void InsertNodeBeforeCommand::doApply()
{
Node* parent = m_refChild->parentNode();
- if (!parent)
+ if (!parent || !parent->isContentEditable())
return;
ExceptionCode ec;
@@ -55,6 +55,9 @@ void InsertNodeBeforeCommand::doApply()
void InsertNodeBeforeCommand::doUnapply()
{
+ if (!m_insertChild->isContentEditable())
+ return;
+
ExceptionCode ec;
m_insertChild->remove(ec);
}