Index: third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.h |
index 6b6144ecd3eddde12e59c858ac314271530b6b50..d31796a23cda99b0519f27487ba66d4981e2c39a 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.h |
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.h |
@@ -5,6 +5,7 @@ |
#ifndef NGBidiParagraph_h |
#define NGBidiParagraph_h |
+#include "platform/text/TextDirection.h" |
#include "platform/wtf/Allocator.h" |
#include "platform/wtf/Forward.h" |
#include "platform/wtf/Vector.h" |
@@ -35,8 +36,11 @@ class NGBidiParagraph { |
// called. |
bool SetParagraph(const String&, const ComputedStyle&); |
- // Returns whether the paragraph is LTR, RTL, or MIXED. |
- UBiDiDirection Direction() const { return ubidi_getDirection(ubidi_); } |
+ // @return the entire text is undirectional and LTR. |
+ bool IsAllLtr() const { return ubidi_getDirection(ubidi_) == UBIDI_LTR; } |
eae
2017/06/20 17:54:41
Instead of IsAllLtr() could we make this more expl
|
+ |
+ // The base direction (a.k.a. paragraph direction) of this block. |
+ TextDirection BaseDirection() const { return base_direction_; } |
// Returns the end offset of a logical run that starts from the |start| |
// offset. |
@@ -50,6 +54,7 @@ class NGBidiParagraph { |
private: |
UBiDi* ubidi_ = nullptr; |
+ TextDirection base_direction_ = TextDirection::kLtr; |
}; |
} // namespace blink |