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

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

Issue 2728493002: Re-format PositionIterator.cpp to be PRESUBMIT friendly (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/PositionIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/PositionIterator.cpp b/third_party/WebKit/Source/core/editing/PositionIterator.cpp
index 21cdcc6d338394692d52c4973a6615ccef06caca..479ce26245df541a68e5cadf6c843662f04884e0 100644
--- a/third_party/WebKit/Source/core/editing/PositionIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/PositionIterator.cpp
@@ -273,32 +273,32 @@ void PositionIteratorAlgorithm<Strategy>::decrement() {
m_offsetsInAnchorNode[m_depthToAnchorNode] = kInvalidOffset;
++m_depthToAnchorNode;
return;
- } else {
- if (m_offsetInAnchor && m_anchorNode->layoutObject()) {
- // Case #3-a. This is a reverse of increment()::Case#2.
- // In this case |anchor| is a leaf(E,F,C,G or H) and
- // |m_offsetInAnchor| is not on the beginning of |anchor|.
- // Then just decrement |m_offsetInAnchor|.
- m_offsetInAnchor =
- previousGraphemeBoundaryOf(m_anchorNode, m_offsetInAnchor);
- return;
- } else {
- // Case #3-b. This is a reverse of increment()::Case#1.
- // In this case |anchor| is a leaf(E,F,C,G or H) and
- // |m_offsetInAnchor| is on the beginning of |anchor|.
- // Let |anchor| is E,
- // next |anchor| is B and |child| is E.
- m_nodeAfterPositionInAnchor = m_anchorNode;
- m_anchorNode = Strategy::parent(*m_anchorNode);
- if (!m_anchorNode)
- return;
- DCHECK_GT(m_depthToAnchorNode, 0u);
- --m_depthToAnchorNode;
- if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset)
- m_offsetsInAnchorNode[m_depthToAnchorNode] =
- Strategy::index(*m_nodeAfterPositionInAnchor);
- }
}
+
+ if (m_offsetInAnchor && m_anchorNode->layoutObject()) {
+ // Case #3-a. This is a reverse of increment()::Case#2.
+ // In this case |anchor| is a leaf(E,F,C,G or H) and
+ // |m_offsetInAnchor| is not on the beginning of |anchor|.
+ // Then just decrement |m_offsetInAnchor|.
+ m_offsetInAnchor =
+ previousGraphemeBoundaryOf(m_anchorNode, m_offsetInAnchor);
+ return;
+ }
+ // Case #3-b. This is a reverse of increment()::Case#1.
+ // In this case |anchor| is a leaf(E,F,C,G or H) and
+ // |m_offsetInAnchor| is on the beginning of |anchor|.
+ // Let |anchor| is E,
+ // next |anchor| is B and |child| is E.
+ m_nodeAfterPositionInAnchor = m_anchorNode;
+ m_anchorNode = Strategy::parent(*m_anchorNode);
+ if (!m_anchorNode)
+ return;
+ DCHECK_GT(m_depthToAnchorNode, 0u);
+ --m_depthToAnchorNode;
+ if (m_offsetsInAnchorNode[m_depthToAnchorNode] != kInvalidOffset)
+ return;
+ m_offsetsInAnchorNode[m_depthToAnchorNode] =
+ Strategy::index(*m_nodeAfterPositionInAnchor);
}
template <typename Strategy>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698