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

Unified Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.h

Issue 2940153002: [LayoutNG] Implement more text-align values and BiDi base direction (Closed)
Patch Set: eae review 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
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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/ng/inline/ng_bidi_paragraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698