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

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

Issue 2386073003: Prune createVisibleSelectionDeprecated from FrameSelection (Closed)
Patch Set: Move layout from FrameSelection::setSelectedRange to DOMSelection::addRange Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index 73136ce983b8d43220fa26e51654abc49057bda2..4b379b6c1f203194c4aed59ce1d5689f9d86a0f6 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -233,6 +233,13 @@ void DOMSelection::collapseToEnd(ExceptionState& exceptionState) {
return;
}
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // In the long term, we should change FrameSelection::setSelection to take a
+ // parameter that does not require clean layout, so that modifying selection
+ // no longer performs synchronous layout by itself.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
frame()->selection().moveTo(selection.end(), SelDefaultAffinity);
}
@@ -248,6 +255,13 @@ void DOMSelection::collapseToStart(ExceptionState& exceptionState) {
return;
}
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // In the long term, we should change FrameSelection::setSelection to take a
+ // parameter that does not require clean layout, so that modifying selection
+ // no longer performs synchronous layout by itself.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
frame()->selection().moveTo(selection.start(), SelDefaultAffinity);
}
@@ -444,6 +458,13 @@ void DOMSelection::addRange(Range* newRange) {
return;
}
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // In the long term, we should change FrameSelection::setSelection to take a
+ // parameter that does not require clean layout, so that modifying selection
+ // no longer performs synchronous layout by itself.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
Xiaocheng 2016/10/04 01:01:40 Originally, DOMSelection::addRange doesn't trigger
yosin_UTC9 2016/10/04 01:52:06 Upon failure, we don't grantee state. So, it shoul
+
if (selection.isNone()) {
selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY);
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698