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

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

Issue 252783002: Make Range.detach() a no-op (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 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 | « Source/core/editing/FormatBlockCommand.cpp ('k') | Source/core/editing/SpellChecker.cpp » ('j') | 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 c592a8c6008170e3f0a454d3e52de08daf5cfb20..fe14377b9881103aafa44ea48e8220685f035f50 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -1409,20 +1409,15 @@ bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, SetSelec
// 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
- TrackExceptionState exceptionState;
- bool collapsed = range->collapsed(exceptionState);
- if (exceptionState.hadException())
- return false;
-
m_logicalRange = nullptr;
stopObservingVisibleSelectionChangeIfNecessary();
// FIXME: Can we provide extentAffinity?
- VisiblePosition visibleStart(range->startPosition(), collapsed ? affinity : DOWNSTREAM);
+ VisiblePosition visibleStart(range->startPosition(), range->collapsed() ? affinity : DOWNSTREAM);
VisiblePosition visibleEnd(range->endPosition(), SEL_DEFAULT_AFFINITY);
setSelection(VisibleSelection(visibleStart, visibleEnd), options);
- m_logicalRange = range->cloneRange(ASSERT_NO_EXCEPTION);
+ m_logicalRange = range->cloneRange();
startObservingVisibleSelectionChange();
return true;
@@ -1431,7 +1426,7 @@ bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, SetSelec
PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const
{
if (m_logicalRange)
- return m_logicalRange->cloneRange(ASSERT_NO_EXCEPTION);
+ return m_logicalRange->cloneRange();
return m_selection.firstRange();
}
« no previous file with comments | « Source/core/editing/FormatBlockCommand.cpp ('k') | Source/core/editing/SpellChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698