Commit 586e53d6 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Prune ComputeVisibleSelectionInDOMTreeDeprecated from RemoveFormatCommand

This patch prunes a call site of the deprecated function, which is safe
because layout is already updated in CompositeEditCommand::Apply().

Bug: 698633
Change-Id: I83c46588c07ce85b5cc765f9b080f356bcbb5885
Reviewed-on: https://chromium-review.googlesource.com/767849Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516388}
parent cfd5aaaa
......@@ -57,17 +57,18 @@ static bool IsElementForRemoveFormatCommand(const Element* element) {
}
void RemoveFormatCommand::DoApply(EditingState* editing_state) {
DCHECK(!GetDocument().NeedsLayoutTreeUpdate());
// TODO(editing-dev): Stop accessing FrameSelection in edit commands.
LocalFrame* frame = GetDocument().GetFrame();
const VisibleSelection selection =
frame->Selection().ComputeVisibleSelectionInDOMTreeDeprecated();
frame->Selection().ComputeVisibleSelectionInDOMTree();
if (selection.IsNone() || !selection.IsValidFor(GetDocument()))
return;
// Get the default style for this editable root, it's the style that we'll
// give the content that we're operating on.
Element* root = frame->Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
.RootEditableElement();
Element* root = selection.RootEditableElement();
EditingStyle* default_style = EditingStyle::Create(root);
// We want to remove everything but transparent background.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment