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

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-06T13:02:21 rebase 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/SelectionEditor.h ('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 a06bc771a81ae07c735ce3bf5af79e7c00e81880..14f7509c4de98e7fd4807ce221e35998cc3d7757 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 createRange(firstEphemeralRangeOf(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);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698