Commit fba16e92 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Rename OverrideBlockPercentageResolutionSize.

OverridePercentageResolutionBlockSize is a much better name.

Change-Id: I3600fb4d7b711ec1e69991ca3bbcb671fd67e68d
Reviewed-on: https://chromium-review.googlesource.com/c/1448174
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630572}
parent d1984ded
......@@ -98,7 +98,7 @@ CustomLayoutFragment* CustomLayoutFragmentRequest::PerformLayout(
}
}
box->SetOverrideBlockPercentageResolutionSize(
box->SetOverridePercentageResolutionBlockSize(
percentage_resolution_logical_height);
if (box->IsLayoutCustom())
......@@ -107,7 +107,7 @@ CustomLayoutFragment* CustomLayoutFragmentRequest::PerformLayout(
box->ForceLayout();
box->ClearOverrideContainingBlockContentSize();
box->ClearOverrideBlockPercentageResolutionSize();
box->ClearOverridePercentageResolutionBlockSize();
box->ClearOverrideSize();
if (box->IsLayoutCustom())
......
......@@ -138,7 +138,7 @@ PaintLayerType LayoutBox::LayerTypeRequired() const {
void LayoutBox::WillBeDestroyed() {
ClearOverrideSize();
ClearOverrideContainingBlockContentSize();
ClearOverrideBlockPercentageResolutionSize();
ClearOverridePercentageResolutionBlockSize();
if (IsOutOfFlowPositioned())
LayoutBlock::RemovePositionedObject(this);
......@@ -1472,17 +1472,17 @@ void LayoutBox::ClearOverrideContainingBlockContentSize() {
false;
}
LayoutUnit LayoutBox::OverrideBlockPercentageResolutionSize() const {
DCHECK(HasOverrideBlockPercentageResolutionSize());
return rare_data_->override_block_percentage_resolution_size_;
LayoutUnit LayoutBox::OverridePercentageResolutionBlockSize() const {
DCHECK(HasOverridePercentageResolutionBlockSize());
return rare_data_->override_percentage_resolution_block_size_;
}
bool LayoutBox::HasOverrideBlockPercentageResolutionSize() const {
bool LayoutBox::HasOverridePercentageResolutionBlockSize() const {
return rare_data_ &&
rare_data_->has_override_block_percentage_resolution_size_;
rare_data_->has_override_percentage_resolution_block_size_;
}
void LayoutBox::SetOverrideBlockPercentageResolutionSize(
void LayoutBox::SetOverridePercentageResolutionBlockSize(
LayoutUnit logical_height) {
DCHECK_GE(logical_height, LayoutUnit(-1));
auto& rare_data = EnsureRareData();
......@@ -1491,19 +1491,19 @@ void LayoutBox::SetOverrideBlockPercentageResolutionSize(
// cannot be in use at the same time.
DCHECK(!rare_data.has_override_available_inline_size_);
rare_data.override_block_percentage_resolution_size_ = logical_height;
rare_data.has_override_block_percentage_resolution_size_ = true;
rare_data.override_percentage_resolution_block_size_ = logical_height;
rare_data.has_override_percentage_resolution_block_size_ = true;
}
void LayoutBox::ClearOverrideBlockPercentageResolutionSize() {
void LayoutBox::ClearOverridePercentageResolutionBlockSize() {
if (!rare_data_)
return;
EnsureRareData().has_override_block_percentage_resolution_size_ = false;
EnsureRareData().has_override_percentage_resolution_block_size_ = false;
}
LayoutUnit LayoutBox::OverrideAvailableInlineSize() const {
DCHECK(HasOverrideAvailableInlineSize());
return rare_data_->override_block_percentage_resolution_size_;
return rare_data_->override_percentage_resolution_block_size_;
}
bool LayoutBox::HasOverrideAvailableInlineSize() const {
......@@ -1516,7 +1516,7 @@ void LayoutBox::SetOverrideAvailableInlineSize(LayoutUnit inline_size) {
// The actual data field is shared with override block percentage resolution
// size. They cannot be in use at the same time.
DCHECK(!rare_data.has_override_block_percentage_resolution_size_);
DCHECK(!rare_data.has_override_percentage_resolution_block_size_);
rare_data.override_available_inline_size_ = inline_size;
rare_data.has_override_available_inline_size_ = true;
......@@ -3473,7 +3473,7 @@ bool LayoutBox::SkipContainingBlockForPercentHeightCalculation(
!containing_block->IsOutOfFlowPositioned() &&
!(containing_block->IsLayoutCustom() &&
ToLayoutCustom(containing_block)->IsLoaded()) &&
!containing_block->HasOverrideBlockPercentageResolutionSize() &&
!containing_block->HasOverridePercentageResolutionBlockSize() &&
!containing_block->IsLayoutGrid() &&
containing_block->StyleRef().LogicalHeight().IsAuto();
}
......@@ -3507,11 +3507,11 @@ LayoutUnit LayoutBox::ContainingBlockLogicalHeightForPercentageResolution(
}
LayoutUnit available_height(-1);
if (containing_block_child->HasOverrideBlockPercentageResolutionSize()) {
if (containing_block_child->HasOverridePercentageResolutionBlockSize()) {
available_height =
containing_block_child->OverrideBlockPercentageResolutionSize();
} else if (cb->HasOverrideBlockPercentageResolutionSize()) {
available_height = cb->OverrideBlockPercentageResolutionSize();
containing_block_child->OverridePercentageResolutionBlockSize();
} else if (cb->HasOverridePercentageResolutionBlockSize()) {
available_height = cb->OverridePercentageResolutionBlockSize();
} else if (HasOverrideContainingBlockContentLogicalWidth() &&
IsHorizontalWritingMode() != real_cb->IsHorizontalWritingMode()) {
available_height = OverrideContainingBlockContentLogicalWidth();
......@@ -3706,7 +3706,7 @@ bool LayoutBox::LogicalHeightComputesAsNone(SizeType size_type) const {
// CustomLayout items can resolve their percentages against an available or
// percentage size override.
if (IsCustomItem() && (HasOverrideContainingBlockContentLogicalHeight() ||
HasOverrideBlockPercentageResolutionSize()))
HasOverridePercentageResolutionBlockSize()))
return false;
if (LayoutBlock* cb = ContainingBlockForAutoHeightDetection(logical_height))
......@@ -3778,8 +3778,8 @@ LayoutUnit LayoutBox::ComputeReplacedLogicalHeightUsing(
ToLayoutBoxModelObject(cb));
} else if (stretched_height != -1) {
available_height = stretched_height;
} else if (HasOverrideBlockPercentageResolutionSize()) {
available_height = OverrideBlockPercentageResolutionSize();
} else if (HasOverridePercentageResolutionBlockSize()) {
available_height = OverridePercentageResolutionBlockSize();
} else {
available_height = has_perpendicular_containing_block
? ContainingBlockLogicalWidthForContent()
......
......@@ -71,7 +71,7 @@ struct LayoutBoxRareData {
// TODO(rego): We should store these based on physical direction.
has_override_containing_block_content_logical_width_(false),
has_override_containing_block_content_logical_height_(false),
has_override_block_percentage_resolution_size_(false),
has_override_percentage_resolution_block_size_(false),
has_override_available_inline_size_(false),
has_previous_content_box_rect_and_layout_overflow_rect_(false),
percent_height_container_(nullptr),
......@@ -87,7 +87,7 @@ struct LayoutBoxRareData {
bool has_override_containing_block_content_logical_width_ : 1;
bool has_override_containing_block_content_logical_height_ : 1;
bool has_override_block_percentage_resolution_size_ : 1;
bool has_override_percentage_resolution_block_size_ : 1;
bool has_override_available_inline_size_ : 1;
bool has_previous_content_box_rect_and_layout_overflow_rect_ : 1;
......@@ -101,7 +101,7 @@ struct LayoutBoxRareData {
// LayoutNG. So, since custom layout containers are laid out by legacy, this
// should be safe.
union {
LayoutUnit override_block_percentage_resolution_size_;
LayoutUnit override_percentage_resolution_block_size_;
LayoutUnit override_available_inline_size_;
};
......@@ -790,13 +790,13 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
void SetOverrideContainingBlockContentLogicalHeight(LayoutUnit);
void ClearOverrideContainingBlockContentSize();
// When a block percentage resolution size override has been set, we'll use
// When a percentage resolution block size override has been set, we'll use
// that size to resolve block-size percentages on this box, rather than
// deducing it from the containing block.
LayoutUnit OverrideBlockPercentageResolutionSize() const;
bool HasOverrideBlockPercentageResolutionSize() const;
void SetOverrideBlockPercentageResolutionSize(LayoutUnit);
void ClearOverrideBlockPercentageResolutionSize();
LayoutUnit OverridePercentageResolutionBlockSize() const;
bool HasOverridePercentageResolutionBlockSize() const;
void SetOverridePercentageResolutionBlockSize(LayoutUnit);
void ClearOverridePercentageResolutionBlockSize();
// When an available inline size override has been set, we'll use that to fill
// available inline size, rather than deducing it from the containing block
......
......@@ -718,7 +718,7 @@ bool LayoutBoxModelObject::HasAutoHeightOrContainingBlockWithAutoHeight(
return false;
if (this_box && this_box->IsCustomItem() &&
(this_box->HasOverrideContainingBlockContentLogicalHeight() ||
this_box->HasOverrideBlockPercentageResolutionSize()))
this_box->HasOverridePercentageResolutionBlockSize()))
return false;
if (logical_height_length.IsAuto() &&
......
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