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

Unified Diff: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.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/CompositeEditCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
index a0a7e3dd9a427bcb3fd356f2c86ff50d667260ac..ec8bd88321ea34762ba6f85124a59440a7cae30b 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -321,7 +321,7 @@ bool CompositeEditCommand::isRemovableBlock(const Node* node)
void CompositeEditCommand::insertNodeBefore(Node* insertChild, Node* refChild, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
{
DCHECK_NE(document().body(), refChild);
- ABORT_EDITING_COMMAND_IF(!refChild->parentNode()->hasEditableStyle() && refChild->parentNode()->inActiveDocument());
+ ABORT_EDITING_COMMAND_IF(!hasEditableStyle(*refChild->parentNode()) && refChild->parentNode()->inActiveDocument());
applyCommandToComposite(InsertNodeBeforeCommand::create(insertChild, refChild, shouldAssumeContentIsAlwaysEditable), editingState);
}
@@ -386,7 +386,7 @@ void CompositeEditCommand::appendNode(Node* node, ContainerNode* parent, Editing
// produced by JavaScript.
ABORT_EDITING_COMMAND_IF(!canHaveChildrenForEditing(parent)
&& !(parent->isElementNode() && toElement(parent)->tagQName() == objectTag));
- ABORT_EDITING_COMMAND_IF(!parent->hasEditableStyle() && parent->inActiveDocument());
+ ABORT_EDITING_COMMAND_IF(!hasEditableStyle(*parent) && parent->inActiveDocument());
applyCommandToComposite(AppendNodeCommand::create(parent, node), editingState);
}
@@ -659,7 +659,7 @@ bool CompositeEditCommand::shouldRebalanceLeadingWhitespaceFor(const String& tex
bool CompositeEditCommand::canRebalance(const Position& position) const
{
Node* node = position.computeContainerNode();
- if (!position.isOffsetInAnchor() || !node || !node->isTextNode() || !node->layoutObjectIsRichlyEditable())
+ if (!position.isOffsetInAnchor() || !node || !node->isTextNode() || !layoutObjectIsRichlyEditable(*node))
return false;
Text* textNode = toText(node);
@@ -1402,7 +1402,7 @@ bool CompositeEditCommand::breakOutOfEmptyListItem(EditingState* editingState)
// FIXME: Can't we do something better when the immediate parent wasn't a list node?
if (!listNode
|| (!isHTMLUListElement(*listNode) && !isHTMLOListElement(*listNode))
- || !listNode->hasEditableStyle()
+ || !hasEditableStyle(*listNode)
|| listNode == rootEditableElement(*emptyListItem))
return false;

Powered by Google App Engine
This is Rietveld 408576698