Index: Source/core/editing/VisiblePosition.cpp |
diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp |
index a0b7697fa96a6330f951c329c190ea28b4126b18..92e4490633ce67e10212a17a535366d9088b7afd 100644 |
--- a/Source/core/editing/VisiblePosition.cpp |
+++ b/Source/core/editing/VisiblePosition.cpp |
@@ -591,14 +591,14 @@ Position VisiblePosition::canonicalPosition(const Position& passedPosition) |
// The new position must be in the same editable element. Enforce that first. |
// Unless the descent is from a non-editable html element to an editable body. |
- if (node && node->hasTagName(htmlTag) && !node->rendererIsEditable() && node->document().body() && node->document().body()->rendererIsEditable()) |
+ if (isHTMLHtmlElement(node) && !node->rendererIsEditable() && node->document().body() && node->document().body()->rendererIsEditable()) |
return next.isNotNull() ? next : prev; |
Node* 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. |
- if ((editingRoot && editingRoot->hasTagName(htmlTag)) || position.deprecatedNode()->isDocumentNode()) |
+ if (isHTMLHtmlElement(editingRoot) || position.deprecatedNode()->isDocumentNode()) |
return next.isNotNull() ? next : prev; |
bool prevIsInSameEditableElement = prevNode && editableRootForPosition(prev) == editingRoot; |