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

Unified Diff: Source/core/editing/FrameSelection.cpp

Issue 315663006: FrameSelection::textWasReplaced and setSelectedRange shouldn't trigger synchronous layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index b17d02cffe1fd1c102dda897746bccb9de644ac7..ac3ccc5a65ff6b2c5d4d958d4a8c06317312d0d5 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -471,7 +471,6 @@ void FrameSelection::updateSelectionIfNeeded(const Position& base, const Positio
return;
VisibleSelection newSelection;
newSelection.setWithoutValidation(base, extent);
- m_frame->document()->updateLayout();
setSelection(newSelection, DoNotSetFocus);
}
@@ -1409,17 +1408,13 @@ bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, SetSelec
return false;
ASSERT(range->startContainer()->document() == range->endContainer()->document());
- m_frame->document()->updateLayoutIgnorePendingStylesheets();
-
// Non-collapsed ranges are not allowed to start at the end of a line that is wrapped,
// they start at the beginning of the next line instead
m_logicalRange = nullptr;
stopObservingVisibleSelectionChangeIfNecessary();
- // FIXME: Can we provide extentAffinity?
- VisiblePosition visibleStart(range->startPosition(), range->collapsed() ? affinity : DOWNSTREAM);
- VisiblePosition visibleEnd(range->endPosition(), SEL_DEFAULT_AFFINITY);
- setSelection(VisibleSelection(visibleStart, visibleEnd), options);
+ VisibleSelection newSelection(range, affinity);
+ setSelection(newSelection, options);
m_logicalRange = range->cloneRange();
startObservingVisibleSelectionChange();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698