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

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

Issue 2563403002: [LayoutNG] Add Bidi reordering and fill in NGPhysicalTextFragment (Closed)
Patch Set: ikilpatrick review Created 4 years 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/ng_physical_text_fragment.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_text_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_text_fragment.h
index ab4b00a7145ab013d1a25e6db8c226ddd642b22e..001447d6e6d91cb953f9e4f934d241c53a8d66be 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_text_fragment.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_text_fragment.h
@@ -7,6 +7,7 @@
#include "core/CoreExport.h"
#include "core/layout/ng/ng_block_node.h"
+#include "core/layout/ng/ng_inline_node.h"
#include "core/layout/ng/ng_physical_fragment_base.h"
#include "platform/heap/Handle.h"
@@ -15,6 +16,9 @@ namespace blink {
class CORE_EXPORT NGPhysicalTextFragment final : public NGPhysicalFragmentBase {
public:
NGPhysicalTextFragment(
+ const NGInlineNode* node,
+ unsigned start_index,
+ unsigned end_index,
NGPhysicalSize size,
NGPhysicalSize overflow,
HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants,
@@ -23,11 +27,30 @@ class CORE_EXPORT NGPhysicalTextFragment final : public NGPhysicalFragmentBase {
overflow,
kFragmentText,
out_of_flow_descendants,
- out_of_flow_positions) {}
+ out_of_flow_positions),
+ node_(node),
+ start_index_(start_index),
+ end_index_(end_index) {}
DEFINE_INLINE_TRACE_AFTER_DISPATCH() {
+ visitor->trace(node_);
NGPhysicalFragmentBase::traceAfterDispatch(visitor);
}
+
+ const NGInlineNode* Node() const { return node_; }
+
+ // The range of NGLayoutInlineItem.
+ // |StartIndex| shows the lower logical index, so the visual order iteration
+ // for RTL should be done from |EndIndex - 1| to |StartIndex|.
+ unsigned StartIndex() const { return start_index_; }
+ unsigned EndIndex() const { return end_index_; }
+
+ private:
+ // TODO(kojii): NGInlineNode is to access text content and NGLayoutInlineItem.
+ // Review if it's better to point them.
+ Member<const NGInlineNode> node_;
+ unsigned start_index_;
+ unsigned end_index_;
};
DEFINE_TYPE_CASTS(NGPhysicalTextFragment,

Powered by Google App Engine
This is Rietveld 408576698