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

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

Issue 434393003: Use tighter typing in editing: VisiblePosition & VisibleSelection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/editing/VisiblePosition.h ('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 1fb03e16434de9fb2368f3fdc063558a3080ce71..6f43eafb0198aaad4089e7fbe8c8d828fd1176be 100644
--- a/Source/core/editing/VisiblePosition.cpp
+++ b/Source/core/editing/VisiblePosition.cpp
@@ -594,7 +594,7 @@ Position VisiblePosition::canonicalPosition(const Position& passedPosition)
if (isHTMLHtmlElement(node) && !node->hasEditableStyle() && node->document().body() && node->document().body()->hasEditableStyle())
return next.isNotNull() ? next : prev;
- Node* editingRoot = editableRootForPosition(position);
+ Element* editingRoot = editableRootForPosition(position);
// If the html element is editable, descending into its body will look like a descent
// from non-editable to editable content since rootEditableElement() always stops at the body.
@@ -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 ? enclosingBlockFlowElement(*node) : 0;
+ Element* originalBlock = node ? enclosingBlockFlowElement(*node) : 0;
bool nextIsOutsideOriginalBlock = !nextNode->isDescendantOf(originalBlock) && nextNode != originalBlock;
bool prevIsOutsideOriginalBlock = !prevNode->isDescendantOf(originalBlock) && prevNode != originalBlock;
if (nextIsOutsideOriginalBlock && !prevIsOutsideOriginalBlock)
@@ -750,7 +750,7 @@ Element* enclosingBlockFlowElement(const VisiblePosition& visiblePosition)
return enclosingBlockFlowElement(*visiblePosition.deepEquivalent().deprecatedNode());
}
-bool isFirstVisiblePositionInNode(const VisiblePosition &visiblePosition, const Node *node)
+bool isFirstVisiblePositionInNode(const VisiblePosition& visiblePosition, const ContainerNode* node)
{
if (visiblePosition.isNull())
return false;
@@ -762,7 +762,7 @@ bool isFirstVisiblePositionInNode(const VisiblePosition &visiblePosition, const
return previous.isNull() || !previous.deepEquivalent().deprecatedNode()->isDescendantOf(node);
}
-bool isLastVisiblePositionInNode(const VisiblePosition &visiblePosition, const Node *node)
+bool isLastVisiblePositionInNode(const VisiblePosition& visiblePosition, const ContainerNode* node)
{
if (visiblePosition.isNull())
return false;
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698