| Index: third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
|
| index 9d9ea95f5040feec7ebf9794627f590d1496fca5..bdc1c5a34bce91c3ad3f10d02dd894d77097d377 100644
|
| --- a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
|
| @@ -99,9 +99,9 @@ PositionInFlatTree adjustPositionInFlatTreeForStart(const PositionInFlatTree& po
|
|
|
| Position adjustPositionForEnd(const Position& currentPosition, Node* startContainerNode)
|
| {
|
| - TreeScope& treeScope = startContainerNode->treeScope();
|
| + TreeScope& treeScope = startContainerNode->treeScopeOrDocument();
|
|
|
| - ASSERT(currentPosition.computeContainerNode()->treeScope() != treeScope);
|
| + ASSERT(currentPosition.computeContainerNode()->treeScopeOrDocument() != treeScope);
|
|
|
| if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.computeContainerNode())) {
|
| if (ancestor->contains(startContainerNode))
|
| @@ -133,9 +133,9 @@ PositionInFlatTree adjustPositionInFlatTreeForEnd(const PositionInFlatTree& posi
|
|
|
| Position adjustPositionForStart(const Position& currentPosition, Node* endContainerNode)
|
| {
|
| - TreeScope& treeScope = endContainerNode->treeScope();
|
| + TreeScope& treeScope = endContainerNode->treeScopeOrDocument();
|
|
|
| - ASSERT(currentPosition.computeContainerNode()->treeScope() != treeScope);
|
| + ASSERT(currentPosition.computeContainerNode()->treeScopeOrDocument() != treeScope);
|
|
|
| if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.computeContainerNode())) {
|
| if (ancestor->contains(endContainerNode))
|
| @@ -187,10 +187,10 @@ static bool isCrossingShadowBoundaries(const VisibleSelectionInFlatTree& selecti
|
| {
|
| if (!selection.isRange())
|
| return false;
|
| - TreeScope& treeScope = selection.base().anchorNode()->treeScope();
|
| - return selection.extent().anchorNode()->treeScope() != treeScope
|
| - || selection.start().anchorNode()->treeScope() != treeScope
|
| - || selection.end().anchorNode()->treeScope() != treeScope;
|
| + TreeScope& treeScope = selection.base().anchorNode()->treeScopeOrDocument();
|
| + return selection.extent().anchorNode()->treeScopeOrDocument() != treeScope
|
| + || selection.start().anchorNode()->treeScopeOrDocument() != treeScope
|
| + || selection.end().anchorNode()->treeScopeOrDocument() != treeScope;
|
| }
|
|
|
| void SelectionAdjuster::adjustSelectionInDOMTree(VisibleSelection* selection, const VisibleSelectionInFlatTree& selectionInFlatTree)
|
| @@ -238,7 +238,7 @@ void SelectionAdjuster::adjustSelectionToAvoidCrossingShadowBoundaries(VisibleSe
|
|
|
| // TODO(hajimehoshi): Checking treeScope is wrong when a node is
|
| // distributed, but we leave it as it is for backward compatibility.
|
| - if (selection->start().anchorNode()->treeScope() == selection->end().anchorNode()->treeScope())
|
| + if (selection->start().anchorNode()->treeScopeOrDocument() == selection->end().anchorNode()->treeScopeOrDocument())
|
| return;
|
|
|
| if (selection->isBaseFirst()) {
|
|
|