diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h b/chromium/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h index 17b4d018433..b773e07908c 100644 --- a/chromium/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h +++ b/chromium/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h @@ -133,14 +133,18 @@ class CORE_EXPORT NGConstraintSpaceBuilder final { space_.EnsureRareData()->fragmentainer_block_size = size; } - // Shrink the fragmentainer block-size, to reserve space at the end. This is - // needed for repeated table footers. - void ReserveSpaceAtFragmentainerEnd(LayoutUnit space) { + // Shrink the fragmentainer block-size, to reserve space for repeated table + // headers and footers. If there's a repeated header, the argument to + // SetFragmentainerOffset() also needs to be compensated for the block-size + // taken up by the repeated header, so that offset 0 is exactly where the + // non-repeated content starts / resumes after the repeated header. + void ReserveSpaceInFragmentainer(LayoutUnit space) { #if DCHECK_IS_ON() DCHECK(is_fragmentainer_block_size_set_); #endif - DCHECK_GE(space_.rare_data_->fragmentainer_block_size, space); space_.rare_data_->fragmentainer_block_size -= space; + space_.rare_data_->fragmentainer_block_size = + space_.rare_data_->fragmentainer_block_size.ClampNegativeToZero(); } void SetFragmentainerOffset(LayoutUnit offset) { |