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

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

Issue 196683003: Use new is*Element() helper functions more in editing code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleUnits.cpp
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index 723a7c3e4acdb54e0924fd81f80c9d1b2d148f7e..ed06b271c355b8370642f2001afa7163acb97a5a 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -39,6 +39,7 @@
#include "core/editing/TextIterator.h"
#include "core/editing/VisiblePosition.h"
#include "core/editing/htmlediting.h"
+#include "core/html/HTMLBRElement.h"
#include "core/rendering/InlineTextBox.h"
#include "core/rendering/RenderBlockFlow.h"
#include "core/rendering/RenderObject.h"
@@ -89,7 +90,7 @@ static Position previousRootInlineBoxCandidatePosition(Node* node, const Visible
if (highestEditableRoot(firstPositionInOrBeforeNode(previousNode), editableType) != highestRoot)
break;
- Position pos = previousNode->hasTagName(brTag) ? positionBeforeNode(previousNode) :
+ Position pos = isHTMLBRElement(*previousNode) ? positionBeforeNode(previousNode) :
createLegacyEditingPosition(previousNode, caretMaxOffset(previousNode));
if (pos.isCandidate())
@@ -813,7 +814,7 @@ static VisiblePosition endPositionForLine(const VisiblePosition& c, LineEndpoint
}
Position pos;
- if (endNode->hasTagName(brTag))
+ if (isHTMLBRElement(*endNode))
pos = positionBeforeNode(endNode);
else if (endBox->isInlineTextBox() && endNode->isTextNode()) {
InlineTextBox* endTextBox = toInlineTextBox(endBox);
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698