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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2292913002: Ensure clean layout before calling plainText() (flat tree version) (Closed)
Patch Set: 201608301918 Created 4 years, 4 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/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 2a2de00affe2c588c740a2593162894d6dc99f54..b07f0766af86f9dad1d5f5308f83f19ee61d5400 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -316,6 +316,13 @@ void SelectionController::selectClosestWordFromHitTestResult(const HitTestResult
}
if (selectInputEventType == SelectInputEventType::Touch) {
+ if (pos.isNull())
+ return;
+
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ pos.deepEquivalent().document()->updateStyleAndLayoutIgnorePendingStylesheets();
yosin_UTC9 2016/08/31 04:58:21 There are only two call sites of selectClosestWord
Xiaocheng 2016/09/02 05:37:24 Done.
+
// If node doesn't have text except space, tab or line break, do not
// select that 'empty' area.
EphemeralRangeInFlatTree range(newSelection.start(), newSelection.end());

Powered by Google App Engine
This is Rietveld 408576698