Skip to content

Commit a84350e

Browse files
committed
[css-anchor-position-1] Implement anchor-center alignment value
https://bugs.webkit.org/show_bug.cgi?id=275451 Reviewed by Antti Koivisto. This change implements `anchor-center` CSS value as specified in: https://drafts.csswg.org/css-anchor-position-1/#anchor-center * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-htb-htb-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-htb-vrl-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-vrl-htb-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-vrl-vrl-expected.txt: * Source/WebCore/css/CSSProperties.json: * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::computePositionedLogicalWidth const): (WebCore::RenderBox::computePositionedLogicalHeight const): (WebCore::isObjectAncestorContainerOf): (WebCore::findClosestCommonContainer): (WebCore::RenderBox::computeAnchorCenteredPosition const): * Source/WebCore/rendering/RenderBox.h: * Source/WebCore/rendering/RenderElement.cpp: (WebCore::RenderElement::defaultAnchor const): (WebCore::RenderElement::defaultAnchorRenderer const): * Source/WebCore/rendering/RenderElement.h: * Source/WebCore/rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * Source/WebCore/rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForGridItem const): (WebCore::RenderGrid::rowAxisPositionForGridItem const): * Source/WebCore/style/AnchorPositionEvaluator.cpp: (WebCore::Style::AnchorPositionEvaluator::computeAnchorRectRelativeToContainingBlock): (WebCore::Style::computeInsetValue): (WebCore::Style::computeAnchorRectRelativeToContainingBlock): Deleted. * Source/WebCore/style/AnchorPositionEvaluator.h: Canonical link: https://commits.webkit.org/287144@main
1 parent 6926aa6 commit a84350e

File tree

14 files changed

+177
-132
lines changed

14 files changed

+177
-132
lines changed

LayoutTests/TestExpectations

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7976,7 +7976,6 @@ webkit.org/b/282024 fast/text/text-box-edge-with-margin-padding-border-simple.ht
79767976
# -- Anchor Positioning -- #
79777977

79787978
# general failures
7979-
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-002.html [ ImageOnlyFailure ]
79807979
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-scroll.html [ ImageOnlyFailure ]
79817980
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-position-top-layer-001.html [ ImageOnlyFailure ]
79827981
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-position-top-layer-003.html [ ImageOnlyFailure ]
Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
11

22
PASS .target 1
3-
FAIL .target 2 assert_equals:
4-
<div class="container">
5-
<div class="anchor"></div>
6-
<div class="target" style="max-width: 60px;" data-expected-width="60" data-offset-x="35"></div>
7-
</div>
8-
offsetLeft expected 35 but got 0
3+
PASS .target 2
94
PASS .target 3
10-
FAIL .target 4 assert_equals:
11-
<div class="container">
12-
<div class="anchor"></div>
13-
<div class="target" style="right: 20px;" data-expected-width="80" data-offset-x="20"></div>
14-
</div>
15-
offsetLeft expected 20 but got 0
5+
PASS .target 4
166
PASS .target 5
17-
FAIL .target 6 assert_equals:
18-
<div class="container">
19-
<div class="anchor"></div>
20-
<div class="target" style="max-width: 100px; right: -20px;" data-expected-width="100" data-offset-x="15"></div>
21-
</div>
22-
offsetLeft expected 15 but got 20
7+
PASS .target 6
238
PASS .target 7
24-
FAIL .target 8 assert_equals:
25-
<div class="container">
26-
<div class="anchor"></div>
27-
<div class="target" style="left: 10px; right: 20px;" data-expected-width="70" data-offset-x="30"></div>
28-
</div>
29-
offsetLeft expected 30 but got 10
9+
PASS .target 8
3010
PASS .target 9
3111
PASS .target 10
3212

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11

2-
FAIL .target 1 assert_equals:
3-
<div class="container">
4-
<div class="anchor"></div>
5-
<div class="target" data-expected-height="100" data-offset-y="0"></div>
6-
</div>
7-
height expected 100 but got 50
8-
FAIL .target 2 assert_equals:
9-
<div class="container">
10-
<div class="anchor"></div>
11-
<div class="target" style="max-height: 60px;" data-expected-height="60" data-offset-y="35"></div>
12-
</div>
13-
height expected 60 but got 50
2+
PASS .target 1
3+
PASS .target 2
144
PASS .target 3
15-
FAIL .target 4 assert_equals:
16-
<div class="container">
17-
<div class="anchor"></div>
18-
<div class="target" style="bottom: 20px;" data-expected-height="80" data-offset-y="20"></div>
19-
</div>
20-
offsetTop expected 20 but got 0
5+
PASS .target 4
216
PASS .target 5
22-
FAIL .target 6 assert_equals:
23-
<div class="container">
24-
<div class="anchor"></div>
25-
<div class="target" style="max-height: 100px; bottom: -20px;" data-expected-height="100" data-offset-y="15"></div>
26-
</div>
27-
offsetTop expected 15 but got 20
7+
PASS .target 6
288
PASS .target 7
29-
FAIL .target 8 assert_equals:
30-
<div class="container">
31-
<div class="anchor"></div>
32-
<div class="target" style="top: 10px; bottom: 20px;" data-expected-height="70" data-offset-y="30"></div>
33-
</div>
34-
offsetTop expected 30 but got 10
9+
PASS .target 8
3510
PASS .target 9
3611
PASS .target 10
3712

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11

2-
FAIL .target 1 assert_equals:
3-
<div class="container">
4-
<div class="anchor"></div>
5-
<div class="target" data-expected-width="100" data-offset-x="0"></div>
6-
</div>
7-
width expected 100 but got 50
8-
FAIL .target 2 assert_equals:
9-
<div class="container">
10-
<div class="anchor"></div>
11-
<div class="target" style="max-width: 60px;" data-expected-width="60" data-offset-x="35"></div>
12-
</div>
13-
width expected 60 but got 50
2+
PASS .target 1
3+
PASS .target 2
144
PASS .target 3
15-
FAIL .target 4 assert_equals:
16-
<div class="container">
17-
<div class="anchor"></div>
18-
<div class="target" style="right: 20px;" data-expected-width="80" data-offset-x="20"></div>
19-
</div>
20-
offsetLeft expected 20 but got 0
5+
PASS .target 4
216
PASS .target 5
22-
FAIL .target 6 assert_equals:
23-
<div class="container">
24-
<div class="anchor"></div>
25-
<div class="target" style="max-width: 100px; right: -20px;" data-expected-width="100" data-offset-x="15"></div>
26-
</div>
27-
offsetLeft expected 15 but got 20
7+
PASS .target 6
288
PASS .target 7
29-
FAIL .target 8 assert_equals:
30-
<div class="container">
31-
<div class="anchor"></div>
32-
<div class="target" style="left: 10px; right: 20px;" data-expected-width="70" data-offset-x="30"></div>
33-
</div>
34-
offsetLeft expected 30 but got 10
9+
PASS .target 8
3510
PASS .target 9
3611
PASS .target 10
3712

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
11

22
PASS .target 1
3-
FAIL .target 2 assert_equals:
4-
<div class="container">
5-
<div class="anchor"></div>
6-
<div class="target" style="max-height: 60px;" data-expected-height="60" data-offset-y="35"></div>
7-
</div>
8-
offsetTop expected 35 but got 0
3+
PASS .target 2
94
PASS .target 3
10-
FAIL .target 4 assert_equals:
11-
<div class="container">
12-
<div class="anchor"></div>
13-
<div class="target" style="bottom: 20px;" data-expected-height="80" data-offset-y="20"></div>
14-
</div>
15-
offsetTop expected 20 but got 0
5+
PASS .target 4
166
PASS .target 5
17-
FAIL .target 6 assert_equals:
18-
<div class="container">
19-
<div class="anchor"></div>
20-
<div class="target" style="max-height: 100px; bottom: -20px;" data-expected-height="100" data-offset-y="15"></div>
21-
</div>
22-
offsetTop expected 15 but got 20
7+
PASS .target 6
238
PASS .target 7
24-
FAIL .target 8 assert_equals:
25-
<div class="container">
26-
<div class="anchor"></div>
27-
<div class="target" style="top: 10px; bottom: 20px;" data-expected-height="70" data-offset-y="30"></div>
28-
</div>
29-
offsetTop expected 30 but got 10
9+
PASS .target 8
3010
PASS .target 9
3111
PASS .target 10
3212

Source/WebCore/css/CSSProperties.json

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7284,11 +7284,7 @@
72847284
"start",
72857285
"end",
72867286
"self-start",
7287-
"self-end",
7288-
{
7289-
"value": "anchor-center",
7290-
"settings-flag": "cssAnchorPositioningEnabled"
7291-
}
7287+
"self-end"
72927288
],
72937289
"codegen-properties": {
72947290
"aliases": [
@@ -7297,7 +7293,7 @@
72977293
"initial": "initialDefaultAlignment",
72987294
"converter": "SelfOrDefaultAlignmentData",
72997295
"parser-function": "consumeAlignItems",
7300-
"parser-grammar-unused": "normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ] | anchor-center",
7296+
"parser-grammar-unused": "normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]",
73017297
"parser-grammar-unused-reason": "Needs support for ordered groups, '&&' groups and optionals.",
73027298
"comment": "Alternate definition in css-flexbox - flex-start | flex-end | center | baseline | stretch"
73037299
},
@@ -7323,11 +7319,7 @@
73237319
"start",
73247320
"end",
73257321
"self-start",
7326-
"self-end",
7327-
{
7328-
"value": "anchor-center",
7329-
"settings-flag": "cssAnchorPositioningEnabled"
7330-
}
7322+
"self-end"
73317323
],
73327324
"codegen-properties": {
73337325
"aliases": [
@@ -7336,7 +7328,7 @@
73367328
"initial": "initialSelfAlignment",
73377329
"converter": "SelfOrDefaultAlignmentData",
73387330
"parser-function": "consumeAlignSelf",
7339-
"parser-grammar-unused": "auto | normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ] | anchor-center",
7331+
"parser-grammar-unused": "auto | normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]",
73407332
"parser-grammar-unused-reason": "Needs support for ordered groups, '&&' groups and optionals.",
73417333
"comment": "Alternate definition in css-flexbox - auto | flex-start | flex-end | center | baseline | stretch"
73427334
},
@@ -7528,7 +7520,7 @@
75287520
"initial": "initialSelfAlignment",
75297521
"converter": "SelfOrDefaultAlignmentData",
75307522
"parser-function": "consumeJustifySelf",
7531-
"parser-grammar-unused": "auto | normal | stretch | <baseline-position> | [ <overflow-position>? [ <self-position> | left | right ] ] | anchor-center",
7523+
"parser-grammar-unused": "auto | normal | stretch | <baseline-position> | [ <overflow-position>? [ <self-position> | left | right ] ]",
75327524
"parser-grammar-unused-reason": "Needs support for ordered groups, '&&' groups and optionals."
75337525
},
75347526
"specification": {
@@ -7543,7 +7535,7 @@
75437535
],
75447536
"converter": "SelfOrDefaultAlignmentData",
75457537
"parser-function": "consumeJustifyItems",
7546-
"parser-grammar-unused": "[ normal | stretch | anchor-center | <baseline-position> | [ <overflow-position>? [ <self-position> | left | right ] ] | legacy | legacy ] && [ left | right | center | anchor-center ]",
7538+
"parser-grammar-unused": "[ normal | stretch | <baseline-position> | [ <overflow-position>? [ <self-position> | left | right ] ] | legacy | legacy ] && [ left | right | center ]",
75477539
"parser-grammar-unused-reason": "Needs support for ordered groups, '&&' groups and optionals."
75487540
},
75497541
"specification": {
@@ -11016,7 +11008,7 @@
1101611008
}
1101711009
},
1101811010
"<self-position>": {
11019-
"grammar": "center | start | end | self-start | self-end | flex-start | flex-end",
11011+
"grammar": "center | start | end | self-start | self-end | flex-start | flex-end | anchor-center",
1102011012
"specification": {
1102111013
"category": "css-align",
1102211014
"url": "https://www.w3.org/TR/css-align-3/#typedef-self-position"

Source/WebCore/rendering/RenderBox.cpp

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "config.h"
2727
#include "RenderBox.h"
2828

29+
#include "AnchorPositionEvaluator.h"
2930
#include "BackgroundPainter.h"
3031
#include "BorderPainter.h"
3132
#include "BorderShape.h"
@@ -4035,6 +4036,21 @@ void RenderBox::computePositionedLogicalWidth(LogicalExtentComputedValues& compu
40354036
Length logicalLeftLength = style().logicalLeft();
40364037
Length logicalRightLength = style().logicalRight();
40374038

4039+
// https://drafts.csswg.org/css-anchor-position-1/#anchor-center
4040+
auto defaultAnchorBoxForAnchorCenter = [&]() -> CheckedPtr<const RenderBoxModelObject> {
4041+
if ((container()->isHorizontalWritingMode() != isHorizontalWritingMode() && style().alignSelf().position() == ItemPosition::AnchorCenter)
4042+
|| (container()->isHorizontalWritingMode() == isHorizontalWritingMode() && style().justifySelf().position() == ItemPosition::AnchorCenter))
4043+
return dynamicDowncast<const RenderBoxModelObject>(defaultAnchorRenderer());
4044+
return nullptr;
4045+
}();
4046+
// Any auto inset properties resolve to 0 if the box is absolutely positioned and does have a default anchor box.
4047+
if (defaultAnchorBoxForAnchorCenter) {
4048+
if (logicalLeftLength.isAuto())
4049+
logicalLeftLength = Length(0, LengthType::Fixed);
4050+
if (logicalRightLength.isAuto())
4051+
logicalRightLength = Length(0, LengthType::Fixed);
4052+
}
4053+
40384054
/*---------------------------------------------------------------------------*\
40394055
* For the purposes of this section and the next, the term "static position"
40404056
* (of an element) refers, roughly, to the position an element would have had
@@ -4118,6 +4134,9 @@ void RenderBox::computePositionedLogicalWidth(LogicalExtentComputedValues& compu
41184134
computedValues.m_margins.m_end = minValues.m_margins.m_end;
41194135
}
41204136

4137+
if (defaultAnchorBoxForAnchorCenter)
4138+
computeAnchorCenteredPosition(computedValues, defaultAnchorBoxForAnchorCenter, logicalLeftLength, logicalRightLength, containerLogicalWidth, true);
4139+
41214140
computedValues.m_extent += bordersPlusPadding;
41224141
if (auto* containingBox = dynamicDowncast<RenderBox>(containerBlock)) {
41234142
if (containingBox->shouldPlaceVerticalScrollbarOnLeft() && isHorizontalWritingMode())
@@ -4458,6 +4477,21 @@ void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& comp
44584477
Length logicalTopLength = styleToUse.logicalTop();
44594478
Length logicalBottomLength = styleToUse.logicalBottom();
44604479

4480+
// https://drafts.csswg.org/css-anchor-position-1/#anchor-center
4481+
auto defaultAnchorBoxForAnchorCenter = [&]() -> CheckedPtr<const RenderBoxModelObject> {
4482+
if ((container()->isHorizontalWritingMode() != isHorizontalWritingMode() && style().justifySelf().position() == ItemPosition::AnchorCenter)
4483+
|| (container()->isHorizontalWritingMode() == isHorizontalWritingMode() && style().alignSelf().position() == ItemPosition::AnchorCenter))
4484+
return dynamicDowncast<const RenderBoxModelObject>(defaultAnchorRenderer());
4485+
return nullptr;
4486+
}();
4487+
// Any auto inset properties resolve to 0 if the box is absolutely positioned and does have a default anchor box.
4488+
if (defaultAnchorBoxForAnchorCenter) {
4489+
if (logicalTopLength.isAuto())
4490+
logicalTopLength = Length(0, LengthType::Fixed);
4491+
if (logicalBottomLength.isAuto())
4492+
logicalBottomLength = Length(0, LengthType::Fixed);
4493+
}
4494+
44614495
/*---------------------------------------------------------------------------*\
44624496
* For the purposes of this section and the next, the term "static position"
44634497
* (of an element) refers, roughly, to the position an element would have had
@@ -4521,6 +4555,9 @@ void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& comp
45214555
}
45224556
}
45234557

4558+
if (defaultAnchorBoxForAnchorCenter)
4559+
computeAnchorCenteredPosition(computedValues, defaultAnchorBoxForAnchorCenter, logicalTopLength, logicalBottomLength, containerLogicalHeight, false);
4560+
45244561
// Set final height value.
45254562
computedValues.m_extent += bordersPlusPadding;
45264563

@@ -5946,4 +5983,79 @@ void RenderBox::removeShapeOutsideInfo()
59465983
shapeOutsideInfoMap().remove(*this);
59475984
}
59485985

5986+
// FIXME: Consider extracting to RenderElement as the same is used in LocalFrameViewLayoutContext.cpp.
5987+
static bool isObjectAncestorContainerOf(const RenderElement& ancestor, const RenderElement& descendant)
5988+
{
5989+
for (auto* renderer = &descendant; renderer; renderer = renderer->container()) {
5990+
if (renderer == &ancestor)
5991+
return true;
5992+
}
5993+
return false;
5994+
}
5995+
5996+
static CheckedPtr<const RenderBlock> findClosestCommonContainer(const RenderElement& elementA, const RenderElement& elementB)
5997+
{
5998+
CheckedPtr closestCommonContainer = dynamicDowncast<RenderBlock>(&elementA);
5999+
while (closestCommonContainer && !isObjectAncestorContainerOf(*closestCommonContainer, elementB))
6000+
closestCommonContainer = dynamicDowncast<RenderBlock>(closestCommonContainer->container());
6001+
return closestCommonContainer;
6002+
}
6003+
6004+
// https://drafts.csswg.org/css-anchor-position-1/#anchor-center
6005+
void RenderBox::computeAnchorCenteredPosition(LogicalExtentComputedValues& computedValues, CheckedPtr<const RenderBoxModelObject> defaultAnchorBox, Length logicalLeftLength, Length logicalRightLength, LayoutUnit containerLogicalWidth, bool computeHorizontally) const
6006+
{
6007+
// Calculate desired anchor-centered position.
6008+
CheckedPtr closestCommonContainer = findClosestCommonContainer(*this, *defaultAnchorBox);
6009+
LayoutRect relativeAnchorRect = Style::AnchorPositionEvaluator::computeAnchorRectRelativeToContainingBlock(*defaultAnchorBox, *closestCommonContainer);
6010+
LayoutUnit desiredPosition = computeHorizontally == isHorizontalWritingMode()
6011+
? relativeAnchorRect.x() + (relativeAnchorRect.width() - computedValues.m_extent) / 2
6012+
: relativeAnchorRect.y() + (relativeAnchorRect.height() - computedValues.m_extent) / 2;
6013+
LayoutUnit desiredEnd = desiredPosition + computedValues.m_extent;
6014+
6015+
LayoutUnit actualLeft = valueForLength(logicalLeftLength, containerLogicalWidth);
6016+
LayoutUnit actualRight = valueForLength(logicalRightLength, containerLogicalWidth);
6017+
auto* parentContainer = downcast<RenderBox>(container());
6018+
6019+
// Switch from rl to lr as all the calculations are done in lr.
6020+
if (!container()->isHorizontalWritingMode() && isHorizontalWritingMode()) {
6021+
auto borderAndPaddingLeft = computeHorizontally ? (parentContainer->borderLeft() + parentContainer->paddingLeft()) : (parentContainer->borderTop() + parentContainer->paddingTop());
6022+
computedValues.m_position = borderAndPaddingLeft + actualLeft;
6023+
}
6024+
6025+
// https://drafts.csswg.org/css-align-3/#auto-safety-position
6026+
6027+
LayoutUnit insetModifiedContainingBlockPosition = computedValues.m_position;
6028+
LayoutUnit insetModifiedContainingBlockEnd = computedValues.m_position - actualLeft + containerLogicalWidth - actualRight;
6029+
LayoutUnit containingBlockPosition = insetModifiedContainingBlockPosition - actualLeft;
6030+
LayoutUnit containingBlockEnd = containingBlockPosition + containerLogicalWidth;
6031+
6032+
// 4.4.1.2.1.
6033+
LayoutUnit defaultOverflowRectPosition = std::min(containingBlockPosition, insetModifiedContainingBlockPosition);
6034+
LayoutUnit defaultOverflowRectEnd = std::max(containingBlockEnd, insetModifiedContainingBlockEnd);
6035+
LayoutUnit defaultOverflowRectSize = defaultOverflowRectEnd - defaultOverflowRectPosition;
6036+
6037+
const bool overflowsInsetModifiedContainingBlock = desiredPosition < insetModifiedContainingBlockPosition || desiredEnd > insetModifiedContainingBlockEnd;
6038+
const bool overflowsDefaultOverflowRect = desiredPosition < defaultOverflowRectPosition || desiredEnd > defaultOverflowRectEnd;
6039+
6040+
// 4.4.1.2.2.
6041+
if (overflowsInsetModifiedContainingBlock && !overflowsDefaultOverflowRect)
6042+
computedValues.m_position = desiredPosition;
6043+
// 4.4.1.2.3.
6044+
else if (defaultOverflowRectSize >= computedValues.m_extent && overflowsDefaultOverflowRect) {
6045+
if (desiredPosition < defaultOverflowRectPosition)
6046+
computedValues.m_position = desiredPosition + (defaultOverflowRectPosition - desiredPosition);
6047+
else
6048+
computedValues.m_position = desiredPosition - (desiredEnd - defaultOverflowRectEnd);
6049+
} else if (defaultOverflowRectSize < computedValues.m_extent) // 4.4.1.2.4.
6050+
computedValues.m_position = insetModifiedContainingBlockPosition;
6051+
else
6052+
computedValues.m_position = desiredPosition;
6053+
6054+
// Switch back from lr to rl if necessary.
6055+
if (!container()->isHorizontalWritingMode() && isHorizontalWritingMode()) {
6056+
auto parentContainerLogicalWidth = computeHorizontally == isHorizontalWritingMode() ? parentContainer->width() : parentContainer->height();
6057+
computedValues.m_position = parentContainerLogicalWidth - (computedValues.m_position + computedValues.m_extent);
6058+
}
6059+
}
6060+
59496061
} // namespace WebCore

Source/WebCore/rendering/RenderBox.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ class RenderBox : public RenderBoxModelObject {
770770
ShapeOutsideInfo& ensureShapeOutsideInfo();
771771
void removeShapeOutsideInfo();
772772

773+
void computeAnchorCenteredPosition(LogicalExtentComputedValues&, CheckedPtr<const RenderBoxModelObject> defaultAnchorBox, Length logicalLeftLength, Length logicalRightLength, LayoutUnit containerLogicalWidth, bool computeHorizontally) const;
774+
773775
private:
774776
// The width/height of the contents + borders + padding. The x/y location is relative to our container (which is not always our parent).
775777
LayoutRect m_frameRect;

0 commit comments

Comments
 (0)