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

Unified Diff: Source/core/editing/IndentOutdentCommand.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/FrameSelection.cpp ('k') | Source/core/editing/InsertLineBreakCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index 2e5d21633fa89ce9cab23e7f5a59af3e88d03df6..b38760dd47aa43de6993debaab9f889b1f253aa0 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -41,7 +41,7 @@ using namespace HTMLNames;
static bool isListOrIndentBlockquote(const Node* node)
{
- return node && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(blockquoteTag));
+ return node && (isHTMLUListElement(*node) || isHTMLOListElement(*node) || node->hasTagName(blockquoteTag));
}
IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeOfAction)
@@ -62,7 +62,7 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P
RefPtr<Element> selectedListItem = enclosingBlock(lastNodeInSelectedParagraph.get());
// FIXME: we need to deal with the case where there is no li (malformed HTML)
- if (!selectedListItem->hasTagName(liTag))
+ if (!isHTMLLIElement(*selectedListItem))
return false;
// FIXME: previousElementSibling does not ignore non-rendered content like <span></span>. Should we?
@@ -134,11 +134,11 @@ void IndentOutdentCommand::outdentParagraph()
return;
// Use InsertListCommand to remove the selection from the list
- if (enclosingNode->hasTagName(olTag)) {
+ if (isHTMLOListElement(*enclosingNode)) {
applyCommandToComposite(InsertListCommand::create(document(), InsertListCommand::OrderedList));
return;
}
- if (enclosingNode->hasTagName(ulTag)) {
+ if (isHTMLUListElement(*enclosingNode)) {
applyCommandToComposite(InsertListCommand::create(document(), InsertListCommand::UnorderedList));
return;
}
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/editing/InsertLineBreakCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698