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

Unified Diff: Source/core/editing/VisiblePosition.cpp

Issue 421293004: Move Node::enclosingBlockFlowElement() to htmlediting.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 6 years, 5 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
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisiblePosition.cpp
diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp
index a5ec11bf2d5d76146cbab5f419b8de9404ac786b..f914254b8907754e8fd16084404d62eb3168304d 100644
--- a/Source/core/editing/VisiblePosition.cpp
+++ b/Source/core/editing/VisiblePosition.cpp
@@ -613,7 +613,7 @@ Position VisiblePosition::canonicalPosition(const Position& passedPosition)
return Position();
// The new position should be in the same block flow element. Favor that.
- Node* originalBlock = node ? node->enclosingBlockFlowElement() : 0;
+ Node* originalBlock = node ? enclosingBlockFlowElement(*node) : 0;
bool nextIsOutsideOriginalBlock = !nextNode->isDescendantOf(originalBlock) && nextNode != originalBlock;
bool prevIsOutsideOriginalBlock = !prevNode->isDescendantOf(originalBlock) && prevNode != originalBlock;
if (nextIsOutsideOriginalBlock && !prevIsOutsideOriginalBlock)
@@ -758,12 +758,12 @@ bool setEnd(Range *r, const VisiblePosition &visiblePosition)
return !exceptionState.hadException();
}
-Element* enclosingBlockFlowElement(const VisiblePosition &visiblePosition)
+Element* enclosingBlockFlowElement(const VisiblePosition& visiblePosition)
{
if (visiblePosition.isNull())
- return NULL;
+ return 0;
- return visiblePosition.deepEquivalent().deprecatedNode()->enclosingBlockFlowElement();
+ return enclosingBlockFlowElement(*visiblePosition.deepEquivalent().deprecatedNode());
}
bool isFirstVisiblePositionInNode(const VisiblePosition &visiblePosition, const Node *node)
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698