Commit 188d18f2 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Prune ComputeVisibleSelectionInDOMTreeDeprecated from SpellCheckerClientImpl

This patch prunes a call site of the deprecated function by hoisting the
layout update out from it.

Bug: 698633
Change-Id: I483f06de2e1c3e0c4b99403ca9a4b2a48dae9517
Reviewed-on: https://chromium-review.googlesource.com/593208
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490721}
parent fe5b761e
...@@ -100,8 +100,13 @@ void SpellCheckerClientImpl::ToggleSpellCheckingEnabled() { ...@@ -100,8 +100,13 @@ void SpellCheckerClientImpl::ToggleSpellCheckingEnabled() {
LocalFrame* const frame = ToLocalFrame(web_view_->FocusedCoreFrame()); LocalFrame* const frame = ToLocalFrame(web_view_->FocusedCoreFrame());
if (!frame) if (!frame)
return; return;
const VisibleSelection visible_selection =
frame->Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); // TODO(editing-dev): The use of UpdateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
frame->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
const VisibleSelection& visible_selection =
frame->Selection().ComputeVisibleSelectionInDOMTree();
// If a selection is in an editable element spell check its content. // If a selection is in an editable element spell check its content.
Element* const root_editable_element = Element* const root_editable_element =
visible_selection.RootEditableElement(); visible_selection.RootEditableElement();
......
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