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

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

Issue 1958093002: CONTINUED Make FrameSelection to hold non-canonicalized positions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2017-01-16T20:04:35 Created 3 years, 11 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/VisibleSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
index c2dac8421a0b8aeb429250c91966d3afb40fa4b8..354b8ad17df63e0a8d05f84d2bc450501ab1c457 100644
--- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -480,7 +480,8 @@ void VisibleSelectionTemplate<Strategy>::validate(TextGranularity granularity) {
// TODO(xiaochengh): Add a DocumentLifecycle::DisallowTransitionScope here.
m_granularity = granularity;
- m_hasTrailingWhitespace = false;
+ if (m_granularity != WordGranularity)
+ m_hasTrailingWhitespace = false;
setBaseAndExtentToDeepEquivalents();
if (m_base.isNull() || m_extent.isNull()) {
m_base = m_extent = m_start = m_end = PositionTemplate<Strategy>();
@@ -516,6 +517,9 @@ void VisibleSelectionTemplate<Strategy>::validate(TextGranularity granularity) {
m_start = mostForwardCaretPosition(m_start);
m_end = mostBackwardCaretPosition(m_end);
}
+ if (!m_hasTrailingWhitespace)
+ return;
+ appendTrailingWhitespace();
}
template <typename Strategy>

Powered by Google App Engine
This is Rietveld 408576698