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

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

Issue 2741173002: Reduce canonicalization when dragging (Closed)
Patch Set: update Created 3 years, 9 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 | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/SelectionEditor.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
index 14f7509c4de98e7fd4807ce221e35998cc3d7757..615c5d770b4043b30b15b649f011dc21ed370af3 100644
--- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
@@ -370,7 +370,13 @@ void SelectionEditor::updateCachedVisibleSelectionIfNeeded() const {
if (!needsUpdateVisibleSelection())
return;
+ m_styleVersion = document().styleVersion();
+ m_cacheIsDirty = false;
m_cachedVisibleSelectionInDOMTree = createVisibleSelection(m_selection);
+ if (m_cachedVisibleSelectionInDOMTree.isNone()) {
+ m_cachedVisibleSelectionInFlatTree = VisibleSelectionInFlatTree();
+ return;
+ }
m_cachedVisibleSelectionInFlatTree = createVisibleSelection(
SelectionInFlatTree::Builder()
.setBaseAndExtent(toPositionInFlatTree(m_selection.base()),
@@ -380,8 +386,6 @@ void SelectionEditor::updateCachedVisibleSelectionIfNeeded() const {
.setGranularity(m_selection.granularity())
.setIsDirectional(m_selection.isDirectional())
.build());
- m_styleVersion = document().styleVersion();
- m_cacheIsDirty = false;
}
void SelectionEditor::cacheRangeOfDocument(Range* range) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698