Commit 2fd97a3d authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[FragmentItem] Make delta_to_next_for_same_layout_object_ mutable

This member needs to be set in |LayoutBox::AddLayoutResult|,
after |NGFragmentItems| was built and set to the cached list.

Since this member is used as a cached index, allow changing
by marking it as |mutable|.

This change is needed to properly mark |NGFragmentItem| as
|const|.

This patch has no behavior changes.

Bug: 982194
Change-Id: I83131b744cd73994b861be9eb374e5e5e47fd5c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138998Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756990}
parent 44a955f1
......@@ -435,7 +435,7 @@ void NGFragmentItem::RecalcInkOverflow(
}
}
void NGFragmentItem::SetDeltaToNextForSameLayoutObject(wtf_size_t delta) {
void NGFragmentItem::SetDeltaToNextForSameLayoutObject(wtf_size_t delta) const {
DCHECK_NE(delta, 0u);
delta_to_next_for_same_layout_object_ = delta;
}
......
......@@ -129,7 +129,7 @@ class CORE_EXPORT NGFragmentItem : public RefCounted<NGFragmentItem>,
wtf_size_t DeltaToNextForSameLayoutObject() const {
return delta_to_next_for_same_layout_object_;
}
void SetDeltaToNextForSameLayoutObject(wtf_size_t delta);
void SetDeltaToNextForSameLayoutObject(wtf_size_t delta) const;
const PhysicalRect& RectInContainerBlock() const { return rect_; }
const PhysicalOffset& OffsetInContainerBlock() const { return rect_.offset; }
......@@ -359,7 +359,7 @@ class CORE_EXPORT NGFragmentItem : public RefCounted<NGFragmentItem>,
std::unique_ptr<NGInkOverflow> ink_overflow_;
// Item index delta to the next item for the same |LayoutObject|.
wtf_size_t delta_to_next_for_same_layout_object_ = 0;
mutable wtf_size_t delta_to_next_for_same_layout_object_ = 0;
// Note: We should not add |bidi_level_| because it is used only for layout.
unsigned type_ : 2; // ItemType
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment