| Index: third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp b/third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp
|
| index f85c063f9600c5516641a6243309a8fe79ddfda5..fccec0eae520758a21e2c8fac23f8c3b457762bb 100644
|
| --- a/third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp
|
| @@ -47,6 +47,16 @@ struct TraverseRightIgnoringLineBreak {
|
| };
|
|
|
| template <typename TraversalStrategy>
|
| +InlineBox* FindBidiRun(const InlineBox& start, unsigned bidi_level) {
|
| + for (InlineBox* runner = TraversalStrategy::Forward(start); runner;
|
| + runner = TraversalStrategy::Forward(*runner)) {
|
| + if (runner->BidiLevel() <= bidi_level)
|
| + return runner;
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| +template <typename TraversalStrategy>
|
| InlineBox* FindBoudnaryOfBidiRun(const InlineBox& start, unsigned bidi_level) {
|
| InlineBox* result = const_cast<InlineBox*>(&start);
|
| for (InlineBox* runner = TraversalStrategy::Forward(start); runner;
|
| @@ -73,6 +83,16 @@ InlineBox* FindBoudnaryOfEntireBidiRun(const InlineBox& start,
|
|
|
| } // namespace
|
|
|
| +InlineBox* InlineBoxTraversal::FindLeftBidiRun(const InlineBox& box,
|
| + unsigned bidi_level) {
|
| + return FindBidiRun<TraverseLeft>(box, bidi_level);
|
| +}
|
| +
|
| +InlineBox* InlineBoxTraversal::FindRightBidiRun(const InlineBox& box,
|
| + unsigned bidi_level) {
|
| + return FindBidiRun<TraverseRight>(box, bidi_level);
|
| +}
|
| +
|
| InlineBox* InlineBoxTraversal::FindLeftBoundaryOfBidiRunIgnoringLineBreak(
|
| const InlineBox& inline_box,
|
| unsigned bidi_level) {
|
|
|