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

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

Issue 2943053002: Introduce Find{Left,Right}BidiRun() and utilize in AdjustInlineBoxPositionForTextDirection() (Closed)
Patch Set: 2017-06-16T13:52:56 Created 3 years, 6 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 | « third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp ('k') | 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/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 0fe37bfec988ce5ee355ab3af0f81238c6e28496..d325380239b137b4c7a2f5ed33280e9a9ba38424 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -893,10 +893,8 @@ static InlineBoxPosition AdjustInlineBoxPositionForTextDirection(
return InlineBoxPosition(inline_box, caret_offset);
level = next_box->BidiLevel();
- InlineBox* prev_box = inline_box;
- do {
- prev_box = prev_box->PrevLeafChild();
- } while (prev_box && prev_box->BidiLevel() > level);
+ InlineBox* const prev_box =
+ InlineBoxTraversal::FindLeftBidiRun(*inline_box, level);
// For example, abc FED 123 ^ CBA
if (prev_box && prev_box->BidiLevel() == level)
@@ -912,10 +910,8 @@ static InlineBoxPosition AdjustInlineBoxPositionForTextDirection(
return InlineBoxPosition(inline_box, caret_offset);
level = inline_box->PrevLeafChild()->BidiLevel();
- InlineBox* next_box = inline_box;
- do {
- next_box = next_box->NextLeafChild();
- } while (next_box && next_box->BidiLevel() > level);
+ InlineBox* const next_box =
+ InlineBoxTraversal::FindRightBidiRun(*inline_box, level);
if (next_box && next_box->BidiLevel() == level)
return InlineBoxPosition(inline_box, caret_offset);
« no previous file with comments | « third_party/WebKit/Source/core/editing/InlineBoxTraversal.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698