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

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

Issue 2723133004: Get rid of redundant member variable SelectionEditor::m_logicalRange (Closed)
Patch Set: 2017-03-03T19:30:02 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.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
index cbf5174bbe79a2e473cd2bfea18c64318f559894..e250ad787c35753bc1483c8815678f44299afd7e 100644
--- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
@@ -61,7 +61,6 @@ void SelectionEditor::clearVisibleSelection() {
}
void SelectionEditor::dispose() {
- resetLogicalRange();
clearDocumentCachedRange();
clearVisibleSelection();
}
@@ -122,7 +121,6 @@ void SelectionEditor::setSelection(const SelectionInDOMTree& newSelection) {
newSelection.assertValidFor(document());
if (m_selection == newSelection)
return;
- resetLogicalRange();
clearDocumentCachedRange();
markCacheDirty();
m_selection = newSelection;
@@ -350,24 +348,7 @@ void SelectionEditor::didSplitTextNode(const Text& oldNode) {
didFinishTextChange(newBase, newExtent);
}
-void SelectionEditor::resetLogicalRange() {
- // 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
- if (!m_logicalRange)
- return;
- m_logicalRange->dispose();
- m_logicalRange = nullptr;
-}
-
-void SelectionEditor::setLogicalRange(Range* range) {
- DCHECK_EQ(range->ownerDocument(), document());
- DCHECK(!m_logicalRange) << "A logical range should be one.";
- m_logicalRange = range;
-}
-
Range* SelectionEditor::firstRange() const {
- if (m_logicalRange)
- return m_logicalRange->cloneRange();
return firstRangeOf(computeVisibleSelectionInDOMTree());
}
@@ -420,7 +401,6 @@ DEFINE_TRACE(SelectionEditor) {
visitor->trace(m_selection);
visitor->trace(m_cachedVisibleSelectionInDOMTree);
visitor->trace(m_cachedVisibleSelectionInFlatTree);
- visitor->trace(m_logicalRange);
visitor->trace(m_cachedRange);
SynchronousMutationObserver::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698