diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-12-07 18:06:50 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-12-09 14:33:15 +0000 |
commit | 15f8e8e3971c73b9ca8058c7441e5bce8ac42fa9 (patch) | |
tree | bce4542b789daf4e6cefe4ca1a07dd6693703d3d | |
parent | 9b21229bf0228ee08261a62ddd67210d2293dd81 (diff) |
[Backport] Make WebViewImpl::textInputInfo update layout before working on ranges.
EphemeralRange is supposed to operate on the same version of the tree
it was created. Unfortunately, the updateStyleAndLayout call in
plainText was causing a DOM mutation in some cases, thus
invalidating the range. Let's not do that.
BUG=639728
R=esprehn
Review-Url: https://codereview.chromium.org/2272793002
Cr-Commit-Position: refs/heads/master@{#414826}
(cherry picked from commit f202a1b8dc8660efa8b173efcaab00675b922daa)
Change-Id: If2562d47a7e86c857b1722dce7d0e2110af5a11a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/third_party/WebKit/Source/web/WebViewImpl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/web/WebViewImpl.cpp b/chromium/third_party/WebKit/Source/web/WebViewImpl.cpp index 3e92e32a2f8..532fa99c939 100644 --- a/chromium/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/chromium/third_party/WebKit/Source/web/WebViewImpl.cpp @@ -2451,6 +2451,10 @@ WebTextInputInfo WebViewImpl::textInputInfo() if (!focused->editor().canEdit()) return info; + // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets needs to be audited. + // see http://crbug.com/590369 for more details. + focused->document()->updateStyleAndLayoutIgnorePendingStylesheets(); + // Emits an object replacement character for each replaced element so that // it is exposed to IME and thus could be deleted by IME on android. info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIteratorEmitsObjectReplacementCharacter); |