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

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

Issue 2950053002: Make Position::BeforeNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-21T17:56:36 Created 3 years, 6 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/ApplyStyleCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
index b2cda7c3237226d6c3a149b7412e5424120e1bf2..3a156401f1a5a73f426182251b4ee6822a63bcae 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -1068,7 +1068,7 @@ bool ApplyStyleCommand::ShouldApplyInlineStyleToRun(EditingStyle* style,
if (!style->StyleIsPresentInComputedStyleOfNode(node))
return true;
if (styled_inline_element_ &&
- !EnclosingElementWithTag(Position::BeforeNode(node),
+ !EnclosingElementWithTag(Position::BeforeNode(*node),
styled_inline_element_->TagQName()))
return true;
}
@@ -1590,7 +1590,7 @@ void ApplyStyleCommand::SplitTextElementAtStart(const Position& start,
SplitTextNodeContainingElement(ToText(start.ComputeContainerNode()),
start.OffsetInContainerNode());
- UpdateStartEnd(Position::BeforeNode(start.ComputeContainerNode()), new_end);
+ UpdateStartEnd(Position::BeforeNode(*start.ComputeContainerNode()), new_end);
}
void ApplyStyleCommand::SplitTextElementAtEnd(const Position& start,
@@ -1834,11 +1834,11 @@ Position ApplyStyleCommand::PositionToComputeInlineStyleChange(
// relevant styles from the current run.
if (!start_node->IsElementNode()) {
dummy_element = HTMLSpanElement::Create(GetDocument());
- InsertNodeAt(dummy_element, Position::BeforeNode(start_node),
+ InsertNodeAt(dummy_element, Position::BeforeNode(*start_node),
editing_state);
if (editing_state->IsAborted())
return Position();
- return Position::BeforeNode(dummy_element);
+ return Position::BeforeNode(*dummy_element);
}
return FirstPositionInOrBeforeNode(start_node);

Powered by Google App Engine
This is Rietveld 408576698