| Index: Source/core/editing/VisiblePosition.cpp
|
| diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp
|
| index df1efaa592ec6b89a9fbe29afe283ed5c5b6ed62..571d07688dab58e36844d5e659059ee2897d28fc 100644
|
| --- a/Source/core/editing/VisiblePosition.cpp
|
| +++ b/Source/core/editing/VisiblePosition.cpp
|
| @@ -35,6 +35,7 @@
|
| #include "core/editing/VisibleUnits.h"
|
| #include "core/editing/htmlediting.h"
|
| #include "core/html/HTMLElement.h"
|
| +#include "core/html/HTMLHtmlElement.h"
|
| #include "core/platform/graphics/FloatQuad.h"
|
| #include "core/rendering/RenderBlock.h"
|
| #include "core/rendering/RootInlineBox.h"
|
| @@ -534,14 +535,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 (node && 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 ((editingRoot && isHTMLHtmlElement(editingRoot)) || position.deprecatedNode()->isDocumentNode())
|
| return next.isNotNull() ? next : prev;
|
|
|
| bool prevIsInSameEditableElement = prevNode && editableRootForPosition(prev) == editingRoot;
|
|
|