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

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

Issue 2653523003: Make DOMSelection cache Range (Closed)
Patch Set: nit Created 3 years, 10 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/SelectionEditor.h
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.h b/third_party/WebKit/Source/core/editing/SelectionEditor.h
index cd1e2dafb5194f76847e1f55e337c58bd9b3b2e2..eb4a2019db6f8b41196f83fd80f0fbad3a1de3eb 100644
--- a/third_party/WebKit/Source/core/editing/SelectionEditor.h
+++ b/third_party/WebKit/Source/core/editing/SelectionEditor.h
@@ -82,6 +82,10 @@ class SelectionEditor final
// layout if needed.
void updateIfNeeded();
+ void cacheRangeOfDocument(Range*);
+ Range* documentCachedRange() const;
+ void clearDocumentCachedRange();
+
DECLARE_TRACE();
private:
@@ -100,11 +104,15 @@ class SelectionEditor final
VisibleSelectionInFlatTree m_selectionInFlatTree;
bool m_observingVisibleSelection;
+ // TODO(editing-dev): Removing |m_logicalRange|
// The range specified by the user, which may not be visually canonicalized
// (hence "logical"). This will be invalidated if the underlying
// |VisibleSelection| changes. If that happens, this variable will
// become |nullptr|, in which case logical positions == visible positions.
Member<Range> m_logicalRange;
+ // If document is root, document.getSelection().addRange(range) is cached on
+ // this.
+ Member<Range> m_cachedRange;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/core/editing/SelectionEditor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698