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

Unified Diff: Source/core/editing/InsertListCommand.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
Index: Source/core/editing/InsertListCommand.cpp
diff --git a/Source/core/editing/InsertListCommand.cpp b/Source/core/editing/InsertListCommand.cpp
index df9cb378959c13b2bc5e9afe24d067c4a0ae7413..6de0c13ab2d15d5181f054b843e3213b97ec8f87 100644
--- a/Source/core/editing/InsertListCommand.cpp
+++ b/Source/core/editing/InsertListCommand.cpp
@@ -262,7 +262,8 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart,
Node* previousListChild;
VisiblePosition start;
VisiblePosition end;
- if (listChildNode->hasTagName(liTag)) {
+ ASSERT(listChildNode);
+ if (isHTMLLIElement(*listChildNode)) {
start = VisiblePosition(firstPositionInNode(listChildNode));
end = VisiblePosition(lastPositionInNode(listChildNode));
nextListChild = listChildNode->nextSibling();
@@ -374,7 +375,7 @@ PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePositio
Position insertionPos(start.deepEquivalent().upstream());
// Also avoid the containing list item.
Node* listChild = enclosingListChild(insertionPos.deprecatedNode());
- if (listChild && listChild->hasTagName(liTag))
+ if (isHTMLLIElement(listChild))
insertionPos = positionInParentBeforeNode(*listChild);
insertNodeAt(listElement, insertionPos);
« no previous file with comments | « Source/core/editing/InsertLineBreakCommand.cpp ('k') | Source/core/editing/InsertParagraphSeparatorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698