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

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

Issue 2491763004: Revert of Utilize FrameSelection::setSelection() taking SelectionInDOMTree/SelectionInFlatTree (Closed)
Patch Set: Created 4 years, 1 month 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 c28eff62c570923843f83084db8d82d4a0f5ebc7..0a1501f0ffea6ca18800ee7703434d1d08b6bad4 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -222,9 +222,16 @@
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();
+
SelectionInDOMTree::Builder builder;
builder.collapse(selection.end());
- frame()->selection().setSelection(builder.build());
+ frame()->selection().setSelection(createVisibleSelection(builder.build()));
}
void DOMSelection::collapseToStart(ExceptionState& exceptionState) {
@@ -239,9 +246,16 @@
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();
+
SelectionInDOMTree::Builder builder;
builder.collapse(selection.start());
- frame()->selection().setSelection(builder.build());
+ frame()->selection().setSelection(createVisibleSelection(builder.build()));
}
void DOMSelection::empty() {
« 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