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

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

Issue 1292303005: Make core/editing/ files to match Blink coding style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-18T10:48:50 Created 5 years, 4 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/FrameSelection.h ('k') | Source/core/editing/InputMethodController.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 ec50628a75e518c198caae077e0378b28ff0284f..c0d8c9493ce6aa21b78b3cc344c5ad075808364b 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -379,8 +379,9 @@ void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, boo
m_selection.setWithoutValidation(start, end);
else
m_selection.setWithoutValidation(end, start);
- } else
+ } else {
clearDOMTreeSelection = true;
+ }
clearLayoutTreeSelection = true;
} else if (baseRemoved || extentRemoved) {
@@ -1020,9 +1021,10 @@ bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, Tex
if (position.isNull())
return false;
- if (isSpatialNavigationEnabled(m_frame))
+ if (isSpatialNavigationEnabled(m_frame)) {
if (!wasRange && alter == AlterationMove && position.deepEquivalent() == originalStartPosition.deepEquivalent())
return false;
+ }
// Some of the above operations set an xPosForVerticalArrowNavigation.
// Setting a selection will clear it, so save it to possibly restore later.
@@ -1050,11 +1052,14 @@ bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, Tex
position = m_selection.visibleBase();
}
- // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the
- // base in place and moving the extent. Matches NSTextView.
- if (!m_frame || !m_frame->editor().behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
+ // Standard Mac behavior when extending to a boundary is grow the
+ // selection rather than leaving the base in place and moving the
+ // extent. Matches NSTextView.
+ if (!m_frame || !m_frame->editor().behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary()
+ || m_selection.isCaret()
+ || !isBoundary(granularity)) {
setExtent(position, userTriggered);
- else {
+ } else {
TextDirection textDirection = directionOfEnclosingBlock();
if (direction == DirectionForward || (textDirection == LTR && direction == DirectionRight) || (textDirection == RTL && direction == DirectionLeft))
setEnd(position, userTriggered);
@@ -1196,8 +1201,9 @@ LayoutUnit FrameSelection::lineDirectionPointForBlockDirectionNavigation(EPositi
// after the selection is created and before this function is called.
x = visiblePosition.lineDirectionPointForBlockDirectionNavigation();
m_xPosForVerticalArrowNavigation = x;
- } else
+ } else {
x = m_xPosForVerticalArrowNavigation;
+ }
return x;
}
@@ -1441,9 +1447,9 @@ void FrameSelection::selectAll()
selectStartTarget = root.get();
} else {
root = m_selection.nonBoundaryShadowTreeRootNode();
- if (root)
+ if (root) {
selectStartTarget = root->shadowHost();
- else {
+ } else {
root = document->documentElement();
selectStartTarget = document->body();
}
« no previous file with comments | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698