| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef InlineBoxTraversal_h | 5 #ifndef InlineBoxTraversal_h |
| 6 #define InlineBoxTraversal_h | 6 #define InlineBoxTraversal_h |
| 7 | 7 |
| 8 #include "platform/wtf/Allocator.h" | 8 #include "platform/wtf/Allocator.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class InlineBox; | 12 class InlineBox; |
| 13 | 13 |
| 14 // This class provides common traveral functions on list of |InlineBox|. | 14 // This class provides common traveral functions on list of |InlineBox|. |
| 15 class InlineBoxTraversal final { | 15 class InlineBoxTraversal final { |
| 16 STATIC_ONLY(InlineBoxTraversal); | 16 STATIC_ONLY(InlineBoxTraversal); |
| 17 | 17 |
| 18 public: | 18 public: |
| 19 // TODO(yosin): We should take |bidi_level| from |InlineBox::BidiLevel()|, | 19 // TODO(yosin): We should take |bidi_level| from |InlineBox::BidiLevel()|, |
| 20 // once all call sites satisfy it. | 20 // once all call sites satisfy it. |
| 21 |
| 22 // Returns |InlineBox| which is less than or equal to |bidi_level| of |
| 23 // left/right of specified |InlineBox|. |
| 24 static InlineBox* FindLeftBidiRun(const InlineBox&, unsigned bidi_level); |
| 25 static InlineBox* FindRightBidiRun(const InlineBox&, unsigned bidi_level); |
| 26 |
| 21 // Find left boundary variations | 27 // Find left boundary variations |
| 22 static InlineBox* FindLeftBoundaryOfBidiRunIgnoringLineBreak( | 28 static InlineBox* FindLeftBoundaryOfBidiRunIgnoringLineBreak( |
| 23 const InlineBox&, | 29 const InlineBox&, |
| 24 unsigned bidi_level); | 30 unsigned bidi_level); |
| 25 static InlineBox* FindLeftBoundaryOfEntireBidiRun(const InlineBox&, | 31 static InlineBox* FindLeftBoundaryOfEntireBidiRun(const InlineBox&, |
| 26 unsigned bidi_level); | 32 unsigned bidi_level); |
| 27 static InlineBox* FindLeftBoundaryOfEntireBidiRunIgnoringLineBreak( | 33 static InlineBox* FindLeftBoundaryOfEntireBidiRunIgnoringLineBreak( |
| 28 const InlineBox&, | 34 const InlineBox&, |
| 29 unsigned bidi_level); | 35 unsigned bidi_level); |
| 30 | 36 |
| 31 // Find right boundary variations | 37 // Find right boundary variations |
| 32 static InlineBox* FindRightBoundaryOfBidiRunIgnoringLineBreak( | 38 static InlineBox* FindRightBoundaryOfBidiRunIgnoringLineBreak( |
| 33 const InlineBox&, | 39 const InlineBox&, |
| 34 unsigned bidi_level); | 40 unsigned bidi_level); |
| 35 static InlineBox* FindRightBoundaryOfEntireBidiRun(const InlineBox&, | 41 static InlineBox* FindRightBoundaryOfEntireBidiRun(const InlineBox&, |
| 36 unsigned bidi_level); | 42 unsigned bidi_level); |
| 37 static InlineBox* FindRightBoundaryOfEntireBidiRunIgnoringLineBreak( | 43 static InlineBox* FindRightBoundaryOfEntireBidiRunIgnoringLineBreak( |
| 38 const InlineBox&, | 44 const InlineBox&, |
| 39 unsigned bidi_level); | 45 unsigned bidi_level); |
| 40 }; | 46 }; |
| 41 | 47 |
| 42 } // namespace blink | 48 } // namespace blink |
| 43 | 49 |
| 44 #endif // InlineBoxTraversal_h | 50 #endif // InlineBoxTraversal_h |
| OLD | NEW |