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

Unified Diff: third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp

Issue 2171493003: [Editing][DOM][CodeHealth] Make Node::hasEditableStyle global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
index 8a12f1e3019bf3f1dbc5a96bfa9ca025ee641d00..116f844ce9e813ee271691f6ec34780bfb1b7a8b 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
@@ -236,17 +236,17 @@ bool InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HT
Node* listChildNode = enclosingListChild(selectionNode);
bool switchListType = false;
if (listChildNode) {
- if (!listChildNode->parentNode()->hasEditableStyle())
+ if (!hasEditableStyle(*listChildNode->parentNode()))
return false;
// Remove the list child.
HTMLElement* listElement = enclosingList(listChildNode);
if (listElement) {
- if (!listElement->hasEditableStyle()) {
+ if (!hasEditableStyle(*listElement)) {
// Since, |listElement| is uneditable, we can't move |listChild|
// out from |listElement|.
return false;
}
- if (!listElement->parentNode()->hasEditableStyle()) {
+ if (!hasEditableStyle(*listElement->parentNode())) {
// Since parent of |listElement| is uneditable, we can not remove
// |listElement| for switching list type neither unlistify.
return false;
@@ -260,8 +260,8 @@ bool InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HT
if (editingState->isAborted())
return false;
}
- DCHECK(listElement->hasEditableStyle());
- DCHECK(listElement->parentNode()->hasEditableStyle());
+ DCHECK(hasEditableStyle(*listElement));
+ DCHECK(hasEditableStyle(*listElement->parentNode()));
if (!listElement->hasTagName(listTag)) {
// |listChildNode| will be removed from the list and a list of type
// |m_type| will be created.
@@ -330,7 +330,7 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart,
{
// Since, unlistify paragraph inserts nodes into parent and removes node
// from parent, if parent of |listElement| should be editable.
- DCHECK(listElement->parentNode()->hasEditableStyle());
+ DCHECK(hasEditableStyle(*listElement->parentNode()));
Node* nextListChild;
Node* previousListChild;
VisiblePosition start;

Powered by Google App Engine
This is Rietveld 408576698