Index: Source/core/editing/FrameSelection.cpp |
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp |
index 94ce606d67ffa66af9ccb2649d3974f5e244f777..7fe3bc1e826e82316cbefce7fcf18192ebe7e693 100644 |
--- a/Source/core/editing/FrameSelection.cpp |
+++ b/Source/core/editing/FrameSelection.cpp |
@@ -358,16 +358,12 @@ void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, boo |
m_selection.setWithoutValidation(m_selection.start(), m_selection.end()); |
else |
m_selection.setWithoutValidation(m_selection.end(), m_selection.start()); |
- } else if (RefPtrWillBeRawPtr<Range> range = m_selection.firstRange()) { |
- TrackExceptionState exceptionState; |
- Range::CompareResults compareResult = range->compareNode(&node, exceptionState); |
- if (!exceptionState.hadException() && (compareResult == Range::NODE_BEFORE_AND_AFTER || compareResult == Range::NODE_INSIDE)) { |
- // If we did nothing here, when this node's renderer was destroyed, the rect that it |
- // occupied would be invalidated, but, selection gaps that change as a result of |
- // the removal wouldn't be invalidated. |
- // FIXME: Don't do so much unnecessary invalidation. |
- clearRenderTreeSelection = true; |
- } |
+ } else if (m_selection.intersectsNode(&node)) { |
+ // If we did nothing here, when this node's renderer was destroyed, the rect that it |
+ // occupied would be invalidated, but, selection gaps that change as a result of |
+ // the removal wouldn't be invalidated. |
+ // FIXME: Don't do so much unnecessary invalidation. |
+ clearRenderTreeSelection = true; |
} |
if (clearRenderTreeSelection) |