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..eb88454fb3e8853c5a566d1f68ca5b4ab1d50e64 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,13 @@ 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 unidirectional. |
+ bool IsUnidirectional() const { |
+ return ubidi_getDirection(ubidi_) != UBIDI_MIXED; |
+ } |
+ |
+ // 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 +56,7 @@ class NGBidiParagraph { |
private: |
UBiDi* ubidi_ = nullptr; |
+ TextDirection base_direction_ = TextDirection::kLtr; |
}; |
} // namespace blink |