Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Unified Diff: third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/Position.cpp ('k') | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698