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

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

Issue 268593009: Block empty space selection Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | Source/core/editing/VisibleUnits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 6a79d0460bdb1014b6a2de6b0ee85b7dc1819002..e677c388e3fc85deb1a654ebbaa1e3f2e7b6c449 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -356,6 +356,13 @@ void VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity(Text
// last word to the line break (also RightWordIfOnBoundary);
VisiblePosition start = VisiblePosition(m_start, m_affinity);
VisiblePosition originalEnd(m_end, m_affinity);
+
+ if (!isContentEditable() && isStartOfWordASpace(start)) {
+ start = start.next();
+ if (comparePositions(start, originalEnd) >= 0)
+ originalEnd = originalEnd.next();
+ }
Yuta Kitamura 2014/05/07 11:09:08 It's totally unclear to me why |start| and |end| n
+
EWordSide side = RightWordIfOnBoundary;
if (isEndOfEditableOrNonEditableContent(start) || (isEndOfLine(start) && !isStartOfLine(start) && !isEndOfParagraph(start)))
side = LeftWordIfOnBoundary;
« no previous file with comments | « no previous file | Source/core/editing/VisibleUnits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698