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

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

Issue 2745973002: [LayoutNG] Implement atomic inlines for LayoutNGInline (Closed)
Patch Set: Resolved merge conflicts Created 3 years, 9 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/ng_line_builder.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_line_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_line_builder.h
index 0ea09b880e0c96ab6022f2cc3d728f354aa9e994..af94ebd916163bc77f3a5fd098e8dfe608b1ca9c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_line_builder.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_line_builder.h
@@ -86,7 +86,20 @@ class CORE_EXPORT NGLineBuilder final {
// are placed.
void CopyFragmentDataToLayoutBlockFlow();
+ // Compute inline size of an NGLayoutInlineItem.
+ // Same as NGLayoutInlineItem::InlineSize(), except that this function can
+ // compute atomic inlines by performing layout.
+ LayoutUnit InlineSize(const NGLayoutInlineItem&);
+
private:
+ bool IsHorizontalWritingMode() const { return is_horizontal_writing_mode_; }
+
+ LayoutUnit InlineSize(const NGLayoutInlineItem&,
+ unsigned start_offset,
+ unsigned end_offset);
+ LayoutUnit InlineSizeFromLayout(const NGLayoutInlineItem&);
+ const NGLayoutResult* LayoutItem(const NGLayoutInlineItem&);
+
struct LineItemChunk {
unsigned index;
unsigned start_offset;
@@ -136,6 +149,10 @@ class CORE_EXPORT NGLineBuilder final {
void AccumulateUsedFonts(const NGLayoutInlineItem&,
const LineItemChunk&,
LineBoxData*);
+ LayoutUnit PlaceAtomicInline(const NGLayoutInlineItem&,
+ LayoutUnit estimated_baseline,
+ LineBoxData*,
+ NGFragmentBuilder*);
// Finds the next layout opportunity for the next text fragment.
void FindNextLayoutOpportunity();
@@ -143,6 +160,7 @@ class CORE_EXPORT NGLineBuilder final {
Persistent<NGInlineNode> inline_box_;
NGConstraintSpace* constraint_space_; // Not owned as STACK_ALLOCATED.
NGFragmentBuilder* containing_block_builder_;
+ Vector<RefPtr<NGLayoutResult>, 32> layout_results_;
Vector<LineBoxData, 32> line_box_data_list_;
unsigned start_index_ = 0;
unsigned start_offset_ = 0;
@@ -154,13 +172,14 @@ class CORE_EXPORT NGLineBuilder final {
LayoutUnit last_break_opportunity_position_;
LayoutUnit content_size_;
LayoutUnit max_inline_size_;
- FontBaseline baseline_type_;
NGFragmentBuilder container_builder_;
RefPtr<NGLayoutResult> container_layout_result_;
+ FontBaseline baseline_type_ = FontBaseline::AlphabeticBaseline;
NGLogicalOffset bfc_offset_;
NGLogicalRect current_opportunity_;
+ unsigned is_horizontal_writing_mode_ : 1;
#if DCHECK_IS_ON()
unsigned is_bidi_reordered_ : 1;
#endif

Powered by Google App Engine
This is Rietveld 408576698