Index: Source/core/editing/htmlediting.cpp |
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp |
index 92908f769e5911808fa7392c593488c1fda0fcff..0995247eb5e0f4bff244c40a53dbc6684dc66ea6 100644 |
--- a/Source/core/editing/htmlediting.cpp |
+++ b/Source/core/editing/htmlediting.cpp |
@@ -230,12 +230,17 @@ Position nextCandidate(const Position& position) |
Position nextVisuallyDistinctCandidate(const Position& position) |
{ |
+ // FIXME: Use PositionIterator instead. |
leviw_travelin_and_unemployed
2015/06/25 00:15:20
We use TODO(name) syntax in Blink now.
changseok
2015/06/25 03:49:39
Done.
|
Position p = position; |
Position downstreamStart = p.downstream(); |
while (!p.atEndOfTree()) { |
p = p.next(Character); |
if (p.isCandidate() && p.downstream() != downstreamStart) |
return p; |
+ if (auto* node = p.containerNode()) { |
+ if (!node->layoutObject()) |
+ p = lastPositionInOrAfterNode(node); |
+ } |
} |
return Position(); |
} |
@@ -261,12 +266,17 @@ Position previousCandidate(const Position& position) |
template <typename PositionType> |
PositionType previousVisuallyDistinctCandidateAlgorithm(const PositionType& position) |
{ |
+ // FIXME: Use PositionIterator instead. |
PositionType p = position; |
PositionType downstreamStart = p.downstream(); |
while (!p.atStartOfTree()) { |
p = p.previous(Character); |
if (p.isCandidate() && p.downstream() != downstreamStart) |
return p; |
+ if (auto* node = p.containerNode()) { |
+ if (!node->layoutObject()) |
+ p = firstPositionInOrBeforeNode(node); |
+ } |
} |
return PositionType(); |
} |