summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
index 89a0f8a..8e4f950 100644
--- a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
+++ b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
@@ -988,6 +988,10 @@ Position CompositeEditCommand::positionAvoidingSpecialElementBoundary(const Posi
VisiblePosition visiblePos(original);
Node* enclosingAnchor = enclosingAnchorElement(original);
Position result = original;
+
+ if (!enclosingAnchor)
+ return result;
+
// Don't avoid block level anchors, because that would insert content into the wrong paragraph.
if (enclosingAnchor && !isBlock(enclosingAnchor)) {
VisiblePosition firstInAnchor(firstDeepEditingPositionForNode(enclosingAnchor));
@@ -1020,6 +1024,9 @@ Position CompositeEditCommand::positionAvoidingSpecialElementBoundary(const Posi
pushAnchorElementDown(enclosingAnchor);
enclosingAnchor = enclosingAnchorElement(original);
}
+ if (!enclosingAnchor)
+ return original;
+
result = positionBeforeNode(enclosingAnchor);
}
}