| 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>
|
|
|