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); |