@@ -112,8 +112,16 @@ class CORE_EXPORT NGLayoutResult : public RefCounted<NGLayoutResult> {
112
112
return HasRareData () ? rare_data_->column_spanner : NGBlockNode (nullptr );
113
113
}
114
114
115
+ // True if this result is the parent of a column spanner and is empty (i.e.
116
+ // has no children). This is used to determine whether the column spanner
117
+ // margins should collapse. Note that |is_empty_spanner_parent| may be false
118
+ // even if this column spanner parent is actually empty. This can happen in
119
+ // the case where the spanner parent has no children but has not broken
120
+ // previously - in which case, we shouldn't collapse the spanner margins since
121
+ // we do not want to collapse margins with a column spanner outside of this
122
+ // parent.
115
123
bool IsEmptySpannerParent () const {
116
- return HasRareData () && rare_data_-> is_empty_spanner_parent ;
124
+ return bitfields_. is_empty_spanner_parent ;
117
125
}
118
126
119
127
const NGEarlyBreak* GetEarlyBreak () const {
@@ -219,9 +227,7 @@ class CORE_EXPORT NGLayoutResult : public RefCounted<NGLayoutResult> {
219
227
// by break-{after,before,inside}:avoid or orphans / widows, or if we had to
220
228
// break at an invalid breakpoint (e.g. before/after the first/last
221
229
// child). This is used for column balancing.
222
- bool HasViolatingBreak () const {
223
- return HasRareData () && rare_data_->has_violating_break ;
224
- }
230
+ bool HasViolatingBreak () const { return bitfields_.has_violating_break ; }
225
231
226
232
SerializedScriptValue* CustomLayoutData () const {
227
233
return HasRareData () ? rare_data_->custom_layout_data .get () : nullptr ;
@@ -449,7 +455,6 @@ class CORE_EXPORT NGLayoutResult : public RefCounted<NGLayoutResult> {
449
455
line_box_bfc_block_offset(rare_data.line_box_bfc_block_offset),
450
456
annotation_overflow(rare_data.annotation_overflow),
451
457
block_end_annotation_space(rare_data.block_end_annotation_space),
452
- has_violating_break(rare_data.has_violating_break),
453
458
lines_until_clamp(rare_data.lines_until_clamp),
454
459
table_column_count_(rare_data.table_column_count_),
455
460
math_layout_data_(rare_data.math_layout_data_) {
@@ -485,16 +490,6 @@ class CORE_EXPORT NGLayoutResult : public RefCounted<NGLayoutResult> {
485
490
absl::optional<LayoutUnit> line_box_bfc_block_offset;
486
491
LayoutUnit annotation_overflow;
487
492
LayoutUnit block_end_annotation_space;
488
- bool has_violating_break = false ;
489
- // True if this result is the parent of a column spanner and is empty (i.e.
490
- // has no children). This is used to determine whether the column spanner
491
- // margins should collapse. Note that |is_empty_spanner_parent| may be false
492
- // even if this column spanner parent is actually empty. This can happen in
493
- // the case where the spanner parent has no children but has not broken
494
- // previously - in which case, we shouldn't collapse the spanner margins
495
- // since we do not want to collapse margins with a column spanner outside of
496
- // this parent.
497
- bool is_empty_spanner_parent = false ;
498
493
int lines_until_clamp = 0 ;
499
494
wtf_size_t table_column_count_ = 0 ;
500
495
std::unique_ptr<const NGGridData> grid_layout_data_;
@@ -551,6 +546,8 @@ class CORE_EXPORT NGLayoutResult : public RefCounted<NGLayoutResult> {
551
546
unsigned is_bfc_block_offset_nullopt : 1 ;
552
547
553
548
unsigned has_forced_break : 1 ;
549
+ unsigned has_violating_break : 1 ;
550
+ unsigned is_empty_spanner_parent : 1 ;
554
551
555
552
unsigned is_self_collapsing : 1 ;
556
553
unsigned is_pushed_by_floats : 1 ;
0 commit comments