Index: Source/core/editing/VisibleSelection.cpp |
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp |
index 96ae7ec131164fceecc3237eaddb76c1f3565a66..31d3a7288d4d636a902a12e2952549e190623b99 100644 |
--- a/Source/core/editing/VisibleSelection.cpp |
+++ b/Source/core/editing/VisibleSelection.cpp |
@@ -470,17 +470,17 @@ void VisibleSelection::setWithoutValidation(const Position& base, const Position |
static Position adjustPositionForEnd(const Position& currentPosition, Node* startContainerNode) |
{ |
- TreeScope& treeScope = startContainerNode->treeScope(); |
+ NonNullPtr<TreeScope> treeScope = startContainerNode->treeScope(); |
- ASSERT(¤tPosition.containerNode()->treeScope() != &treeScope); |
+ ASSERT(currentPosition.containerNode()->treeScope() != treeScope); |
- if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.containerNode())) { |
+ if (Node* ancestor = treeScope->ancestorInThisScope(currentPosition.containerNode())) { |
if (ancestor->contains(startContainerNode)) |
return positionAfterNode(ancestor); |
return positionBeforeNode(ancestor); |
} |
- if (Node* lastChild = treeScope.rootNode()->lastChild()) |
+ if (Node* lastChild = treeScope->rootNode()->lastChild()) |
return positionAfterNode(lastChild); |
return Position(); |
@@ -488,17 +488,17 @@ static Position adjustPositionForEnd(const Position& currentPosition, Node* star |
static Position adjustPositionForStart(const Position& currentPosition, Node* endContainerNode) |
{ |
- TreeScope& treeScope = endContainerNode->treeScope(); |
+ NonNullPtr<TreeScope> treeScope = endContainerNode->treeScope(); |
- ASSERT(¤tPosition.containerNode()->treeScope() != &treeScope); |
+ ASSERT(currentPosition.containerNode()->treeScope() != treeScope); |
- if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.containerNode())) { |
+ if (Node* ancestor = treeScope->ancestorInThisScope(currentPosition.containerNode())) { |
if (ancestor->contains(endContainerNode)) |
return positionBeforeNode(ancestor); |
return positionAfterNode(ancestor); |
} |
- if (Node* firstChild = treeScope.rootNode()->firstChild()) |
+ if (Node* firstChild = treeScope->rootNode()->firstChild()) |
return positionBeforeNode(firstChild); |
return Position(); |
@@ -509,7 +509,7 @@ void VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries() |
if (m_base.isNull() || m_start.isNull() || m_end.isNull()) |
return; |
- if (&m_start.anchorNode()->treeScope() == &m_end.anchorNode()->treeScope()) |
+ if (m_start.anchorNode()->treeScope() == m_end.anchorNode()->treeScope()) |
return; |
if (m_baseIsFirst) { |
@@ -520,7 +520,7 @@ void VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries() |
m_start = m_extent; |
} |
- ASSERT(&m_start.anchorNode()->treeScope() == &m_end.anchorNode()->treeScope()); |
+ ASSERT(m_start.anchorNode()->treeScope() == m_end.anchorNode()->treeScope()); |
} |
void VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries() |