Index: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h |
index 366aeda434147663aab92faf7af7e0eb1ab57c17..c742f727996da988e3cbf427adcd53df31b7adec 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h |
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h |
@@ -49,18 +49,19 @@ class CORE_EXPORT NGInlineNode : public NGLayoutInputNode { |
// Instruct to re-compute |PrepareLayout| on the next layout. |
void InvalidatePrepareLayout(); |
- const String& Text() const { return text_content_; } |
+ const String& Text() const { return Data().text_content_; } |
StringView Text(unsigned start_offset, unsigned end_offset) const { |
- return StringView(text_content_, start_offset, end_offset - start_offset); |
+ return StringView(Data().text_content_, start_offset, |
+ end_offset - start_offset); |
} |
- Vector<NGInlineItem>& Items() { return items_; } |
- const Vector<NGInlineItem>& Items() const { return items_; } |
+ Vector<NGInlineItem>& Items() { return MutableData().items_; } |
+ const Vector<NGInlineItem>& Items() const { return Data().items_; } |
NGInlineItemRange Items(unsigned start_index, unsigned end_index); |
void GetLayoutTextOffsets(Vector<unsigned, 32>*); |
- bool IsBidiEnabled() const { return is_bidi_enabled_; } |
+ bool IsBidiEnabled() const { return Data().is_bidi_enabled_; } |
void AssertOffset(unsigned index, unsigned offset) const; |
void AssertEndOffset(unsigned index, unsigned offset) const; |
@@ -73,7 +74,7 @@ class CORE_EXPORT NGInlineNode : public NGLayoutInputNode { |
// Prepare inline and text content for layout. Must be called before |
// calling the Layout method. |
void PrepareLayout(); |
- bool IsPrepareLayoutFinished() const { return !text_content_.IsNull(); } |
+ bool IsPrepareLayoutFinished() const { return !Text().IsNull(); } |
void CollectInlines(LayoutObject* start, LayoutBlockFlow*); |
LayoutObject* CollectInlines(LayoutObject* start, |
@@ -82,27 +83,21 @@ class CORE_EXPORT NGInlineNode : public NGLayoutInputNode { |
void SegmentText(); |
void ShapeText(); |
+ NGInlineNodeData& MutableData() { return block_->GetNGInlineNodeData(); } |
+ const NGInlineNodeData& Data() const { return block_->GetNGInlineNodeData(); } |
+ |
LayoutObject* start_inline_; |
LayoutBlockFlow* block_; |
Member<NGLayoutInputNode> next_sibling_; |
- |
- // Text content for all inline items represented by a single NGInlineNode |
- // instance. Encoded either as UTF-16 or latin-1 depending on content. |
- String text_content_; |
- Vector<NGInlineItem> items_; |
- |
- // TODO(kojii): This should move to somewhere else when we move PrepareLayout |
- // to the correct place. |
- bool is_bidi_enabled_ = false; |
}; |
inline void NGInlineNode::AssertOffset(unsigned index, unsigned offset) const { |
- items_[index].AssertOffset(offset); |
+ Items()[index].AssertOffset(offset); |
} |
inline void NGInlineNode::AssertEndOffset(unsigned index, |
unsigned offset) const { |
- items_[index].AssertEndOffset(offset); |
+ Items()[index].AssertEndOffset(offset); |
} |
DEFINE_TYPE_CASTS(NGInlineNode, |