Skip to content

Commit 61a65b2

Browse files
committed
RenderFlexibleBox::m_hasDefiniteHeight should not need to be mutable
https://bugs.webkit.org/show_bug.cgi?id=224404 Reviewed by Antti Koivisto. Let's just fix constness instead. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth): (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild): (WebCore::RenderFlexibleBox::useChildAspectRatio): (WebCore::RenderFlexibleBox::childMainSizeIsDefinite): (WebCore::RenderFlexibleBox::childCrossSizeIsDefinite): (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize): (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Deleted. (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild const): Deleted. (WebCore::RenderFlexibleBox::useChildAspectRatio const): Deleted. (WebCore::RenderFlexibleBox::childMainSizeIsDefinite const): Deleted. (WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const): Deleted. (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize const): Deleted. * rendering/RenderFlexibleBox.h: Canonical link: https://commits.webkit.org/236367@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 66a202b commit 61a65b2

3 files changed

Lines changed: 37 additions & 13 deletions

File tree

Source/WebCore/ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2021-04-10 Zalan Bujtas <zalan@apple.com>
2+
3+
RenderFlexibleBox::m_hasDefiniteHeight should not need to be mutable
4+
https://bugs.webkit.org/show_bug.cgi?id=224404
5+
6+
Reviewed by Antti Koivisto.
7+
8+
Let's just fix constness instead.
9+
10+
* rendering/RenderFlexibleBox.cpp:
11+
(WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth):
12+
(WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild):
13+
(WebCore::RenderFlexibleBox::useChildAspectRatio):
14+
(WebCore::RenderFlexibleBox::childMainSizeIsDefinite):
15+
(WebCore::RenderFlexibleBox::childCrossSizeIsDefinite):
16+
(WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize):
17+
(WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Deleted.
18+
(WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild const): Deleted.
19+
(WebCore::RenderFlexibleBox::useChildAspectRatio const): Deleted.
20+
(WebCore::RenderFlexibleBox::childMainSizeIsDefinite const): Deleted.
21+
(WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const): Deleted.
22+
(WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize const): Deleted.
23+
* rendering/RenderFlexibleBox.h:
24+
125
2021-04-09 Antoine Quint <graouts@webkit.org>
226

327
calc() simplification for a multiplication should apply the multiplication to each value of an addition

Source/WebCore/rendering/RenderFlexibleBox.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ LayoutUnit RenderFlexibleBox::childIntrinsicLogicalHeight(const RenderBox& child
479479
return child.logicalHeight();
480480
}
481481

482-
LayoutUnit RenderFlexibleBox::childIntrinsicLogicalWidth(const RenderBox& child) const
482+
LayoutUnit RenderFlexibleBox::childIntrinsicLogicalWidth(const RenderBox& child)
483483
{
484484
// This should only be called if the logical width is the cross size
485485
ASSERT(!mainAxisIsChildInlineAxis(child));
@@ -499,7 +499,7 @@ LayoutUnit RenderFlexibleBox::childIntrinsicLogicalWidth(const RenderBox& child)
499499
return values.m_extent;
500500
}
501501

502-
LayoutUnit RenderFlexibleBox::crossAxisIntrinsicExtentForChild(const RenderBox& child) const
502+
LayoutUnit RenderFlexibleBox::crossAxisIntrinsicExtentForChild(const RenderBox& child)
503503
{
504504
return mainAxisIsChildInlineAxis(child) ? childIntrinsicLogicalHeight(child) : childIntrinsicLogicalWidth(child);
505505
}
@@ -768,7 +768,7 @@ Length RenderFlexibleBox::mainSizeLengthForChild(SizeType sizeType, const Render
768768
return { };
769769
}
770770

771-
bool RenderFlexibleBox::useChildAspectRatio(const RenderBox& child) const
771+
bool RenderFlexibleBox::useChildAspectRatio(const RenderBox& child)
772772
{
773773
if (!childHasAspectRatio(child))
774774
return false;
@@ -833,7 +833,7 @@ void RenderFlexibleBox::setFlowAwareLocationForChild(RenderBox& child, const Lay
833833
child.setLocation(location.transposedPoint());
834834
}
835835

836-
bool RenderFlexibleBox::childMainSizeIsDefinite(const RenderBox& child, const Length& flexBasis) const
836+
bool RenderFlexibleBox::childMainSizeIsDefinite(const RenderBox& child, const Length& flexBasis)
837837
{
838838
if (flexBasis.isAuto())
839839
return false;
@@ -878,7 +878,7 @@ bool RenderFlexibleBox::childCrossSizeShouldUseContainerCrossSize(const RenderBo
878878
return false;
879879
}
880880

881-
bool RenderFlexibleBox::childCrossSizeIsDefinite(const RenderBox& child, const Length& length) const
881+
bool RenderFlexibleBox::childCrossSizeIsDefinite(const RenderBox& child, const Length& length)
882882
{
883883
if (length.isAuto())
884884
return false;
@@ -1612,7 +1612,7 @@ bool RenderFlexibleBox::needToStretchChildLogicalHeight(const RenderBox& child)
16121612
return child.style().logicalHeight().isAuto();
16131613
}
16141614

1615-
bool RenderFlexibleBox::childHasIntrinsicMainAxisSize(const RenderBox& child) const
1615+
bool RenderFlexibleBox::childHasIntrinsicMainAxisSize(const RenderBox& child)
16161616
{
16171617
if (mainAxisIsChildInlineAxis(child))
16181618
return false;

Source/WebCore/rendering/RenderFlexibleBox.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ class RenderFlexibleBox : public RenderBlock {
116116
Length crossSizeLengthForChild(SizeType, const RenderBox&) const;
117117
bool shouldApplyMinSizeAutoForChild(const RenderBox&) const;
118118
LayoutUnit crossAxisExtentForChild(const RenderBox& child) const;
119-
LayoutUnit crossAxisIntrinsicExtentForChild(const RenderBox& child) const;
119+
LayoutUnit crossAxisIntrinsicExtentForChild(const RenderBox& child);
120120
LayoutUnit childIntrinsicLogicalHeight(const RenderBox& child) const;
121-
LayoutUnit childIntrinsicLogicalWidth(const RenderBox& child) const;
121+
LayoutUnit childIntrinsicLogicalWidth(const RenderBox& child);
122122
LayoutUnit mainAxisExtentForChild(const RenderBox& child) const;
123123
LayoutUnit mainAxisContentExtentForChildIncludingScrollbar(const RenderBox& child) const;
124124
LayoutUnit crossAxisExtent() const;
@@ -142,17 +142,17 @@ class RenderFlexibleBox : public RenderBlock {
142142
LayoutUnit crossAxisScrollbarExtent() const;
143143
LayoutUnit crossAxisScrollbarExtentForChild(const RenderBox& child) const;
144144
LayoutPoint flowAwareLocationForChild(const RenderBox& child) const;
145-
bool useChildAspectRatio(const RenderBox& child) const;
145+
bool useChildAspectRatio(const RenderBox& child);
146146
bool childCrossSizeShouldUseContainerCrossSize(const RenderBox& child) const;
147147
LayoutUnit computeMainSizeFromAspectRatioUsing(const RenderBox& child, Length crossSizeLength) const;
148148
void setFlowAwareLocationForChild(RenderBox& child, const LayoutPoint&);
149149
LayoutUnit computeInnerFlexBaseSizeForChild(RenderBox& child, LayoutUnit mainAxisBorderAndPadding);
150150
void adjustAlignmentForChild(RenderBox& child, LayoutUnit);
151151
ItemPosition alignmentForChild(const RenderBox& child) const;
152-
bool childMainSizeIsDefinite(const RenderBox&, const Length& flexBasis) const;
153-
bool childCrossSizeIsDefinite(const RenderBox&, const Length& flexBasis) const;
152+
bool childMainSizeIsDefinite(const RenderBox&, const Length& flexBasis);
153+
bool childCrossSizeIsDefinite(const RenderBox&, const Length& flexBasis);
154154
bool needToStretchChildLogicalHeight(const RenderBox& child) const;
155-
bool childHasIntrinsicMainAxisSize(const RenderBox& child) const;
155+
bool childHasIntrinsicMainAxisSize(const RenderBox& child);
156156
Overflow mainAxisOverflowForChild(const RenderBox& child) const;
157157
Overflow crossAxisOverflowForChild(const RenderBox& child) const;
158158
void cacheChildMainSize(const RenderBox& child);
@@ -218,7 +218,7 @@ class RenderFlexibleBox : public RenderBlock {
218218
int m_numberOfInFlowChildrenOnFirstLine { -1 };
219219

220220
// This is SizeIsUnknown outside of layoutBlock()
221-
mutable SizeDefiniteness m_hasDefiniteHeight { SizeDefiniteness::Unknown };
221+
SizeDefiniteness m_hasDefiniteHeight { SizeDefiniteness::Unknown };
222222
bool m_inLayout { false };
223223
bool m_shouldResetChildLogicalHeightBeforeLayout { false };
224224
};

0 commit comments

Comments
 (0)