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

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

Issue 98723009: Change isBlock and isInline functions to check for isElementNode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index 7a5c5cf3e59d457809197c0b1728f3ee5d9f72e4..6c00bb5d9a38062fb59b1a66e24aa76eac83c386 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -310,12 +310,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->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText();
+ return node && node->isElementNode() && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText();
}
bool isInline(const Node* node)
{
- return node && node->renderer() && node->renderer()->isInline();
+ return node && node->isElementNode() && node->renderer() && node->renderer()->isInline();
}
// FIXME: Deploy this in all of the places where enclosingBlockFlow/enclosingBlockFlowOrTableElement are used.
@@ -325,7 +325,7 @@ bool isInline(const Node* node)
Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
{
Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
- return enclosingNode && enclosingNode->isElementNode() ? toElement(enclosingNode) : 0;
+ return toElement(enclosingNode);
}
TextDirection directionOfEnclosingBlock(const Position& position)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698