Index: Source/core/editing/htmlediting.cpp |
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp |
index 7d8591fc4ea59d4a734b0ca6a11b29a6f767a64a..11295afa05ba1a8866a0b4a5b4893a28398fd901 100644 |
--- a/Source/core/editing/htmlediting.cpp |
+++ b/Source/core/editing/htmlediting.cpp |
@@ -309,12 +309,12 @@ VisiblePosition lastEditablePositionBeforePositionInRoot(const Position& positio |
// Whether or not content before and after this node will collapse onto the same line as it. |
bool isBlock(const Node* node) |
{ |
- return node && node->isElementNode() && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText(); |
+ return node && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText(); |
} |
bool isInline(const Node* node) |
{ |
- return node && node->isElementNode() && node->renderer() && node->renderer()->isInline(); |
+ return node && node->renderer() && node->renderer()->isInline(); |
} |
// FIXME: Deploy this in all of the places where enclosingBlockFlow/enclosingBlockFlowOrTableElement are used. |
@@ -324,7 +324,7 @@ bool isInline(const Node* node) |
Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule) |
{ |
Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule); |
- return toElement(enclosingNode); |
+ return enclosingNode && enclosingNode->isElementNode() ? toElement(enclosingNode) : 0; |
} |
TextDirection directionOfEnclosingBlock(const Position& position) |