Commit graph

143 commits

Author SHA1 Message Date
Cosmin Sabou
543905e105 Backed out 3 changesets (bug 1809568) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset eaa7fe280317 (bug 1809568)
Backed out changeset ab0f2bcb2d9b (bug 1809568)
Backed out changeset a481bf06452b (bug 1809568)
2023-05-01 21:42:14 +03:00
David Shin
d2ebe93a83 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 17:04:27 +00:00
Iulian Moraru
c9ffb3ffa8 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp. CLOSED TREE
Backed out changeset 573dc0bd9554 (bug 1809568)
Backed out changeset b8401947aea0 (bug 1809568)
Backed out changeset 7ecabe895121 (bug 1809568)
2023-05-01 17:59:21 +03:00
David Shin
8ff73f5fcc Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 13:44:43 +00:00
David Shin
a47e766d75 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-24 16:23:16 +00:00
Norisz Fay
97050950be Backed out changeset 11ba57726279 (bug 1812679) for causing Wr failures on text-combine-upright-value-all-002.html 2023-03-24 01:51:06 +02:00
David Shin
6cb3b01af3 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 17:36:49 +00:00
Stanca Serban
7c4f609327 Backed out changeset 49646b0d59aa (bug 1812679) for causing mochitests failures in layout/style/test/test_revert.html. CLOSED TREE 2023-03-23 17:39:13 +02:00
David Shin
2f94be9968 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 14:35:12 +00:00
David Shin
f5a42005e2 Bug 1811311 - Part 3: Refactor GetNaturalBaselineBOffset to return Maybe<nscoord>. r=layout-reviewers,emilio
Changed from returning `bool` & taking an out parameter.

Differential Revision: https://phabricator.services.mozilla.com/D168998
2023-02-23 14:53:27 +00:00
David Shin
5c7c22165f Bug 1811311 - Part 1: Unite baseline-related functions in nsIFrame into one. r=emilio
Before, there existed 3 virtual functions that calculated baselines:

- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`

Each of them had slightly different behaviours:

- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
  Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
  baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
   start/end edge, depending on the caller-supplied baseline. Others always
   return offset from border box start edge.

Now:

- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
  - `SynthesizeFallbackBaseline` to generate a baseline for elements that
    doesn't have one.
  - `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D167990
2023-02-23 14:53:26 +00:00
Emilio Cobos Álvarez
3ad7017163 Bug 1807963 - Remove non-standard values of caption-side for good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-01-09 18:02:23 +00:00
Cosmin Sabou
4ab6fc29e0 Backed out changeset c34c31220275 (bug 1807963) for causing reftest unexpected passes on 446100-1c.html. 2023-01-09 15:01:55 +02:00
Emilio Cobos Álvarez
7b821c0133 Bug 1807963 - Remove non-standard values of caption-side for good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-01-09 10:39:44 +00:00
Stanca Serban
81bfc93257 Backed out changeset e018ba23c07d (bug 1807963) for causing wpt failures in caption.html. CLOSED TREE 2023-01-09 10:42:21 +02:00
Emilio Cobos Álvarez
5b925c72c8 Bug 1807963 - Remove non-standard values of caption-side for good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-01-09 07:05:14 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
David Shin
2f5572a9aa Bug 1673677: Ensure nested orthogonal table's baseline is equivalent to contain: layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D155615
2022-11-17 15:01:16 +00:00
Ting-Yu Lin
514d412f9b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Noemi Erli
7c40c0e983 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin
192956df1b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin
040feb02dd Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Ting-Yu Lin
c99b45fa14 Bug 1798373 Part 6 - Change nsContainerFrame::AppendFrames() to take rvalue reference of nsFrameList. r=emilio
Change nsBlockFrame::AppendFrames() helper, too.

Differential Revision: https://phabricator.services.mozilla.com/D160842
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
4787078c5c Bug 1798373 Part 5 - Change nsContainerFrame::SetInitialChildList() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160841
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
fc3719b5aa Bug 1798373 Part 4 - Remove nsFrameList::SetFrames() that takes nsFrameList. r=emilio
SetFrame() is equivalent to `operator=`, so external callers can use `operator=`
instead. For the two callers wanting to set `nsFrameList` to `AbsoluteFrameList`
in `nsCSSFrameConstructor`, removing SetFrame() disallows it. However, we can
easily change the declaration from `nsFrameList` to a `AbsoluteFrameList` to
resolve the problem.

Differential Revision: https://phabricator.services.mozilla.com/D160840
2022-11-01 21:15:53 +00:00
Ting-Yu Lin
adf4fab73c Bug 1798373 Part 2 - Change nsFrameList::AppendFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160838
2022-11-01 21:15:52 +00:00
Ting-Yu Lin
569c5f244b Bug 1798373 Part 1 - Change nsFrameList::InsertFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160837
2022-11-01 21:15:52 +00:00
Ting-Yu Lin
f101e2077d Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Emilio Cobos Álvarez
a8cfb8a96f Bug 1472602 - Sticky/relative position fixes in nsTableWrapperFrame. r=dholbert
Captions should be relatively-positioned (other browsers support this as
well). This ensures we correctly save their normal positions and thus
that the sticky scroll container knows how to reposition them correctly.

Avoid registering inner table frames with the sticky scroll container to
make the assertion sound in cases of sticky-positioned tables.

Differential Revision: https://phabricator.services.mozilla.com/D147092
2022-05-23 23:40:42 +00:00
Iulian Moraru
3fb8d69e14 Backed out changeset e3377838e213 (bug 1472602) for causing multiple failures related to StickyScrollContainer. CLOSED TREE 2022-05-24 01:14:50 +03:00
Emilio Cobos Álvarez
86ec9c28f7 Bug 1472602 - Sticky/relative position fixes in nsTableWrapperFrame. r=dholbert
Captions should be relatively-positioned (other browsers support this as
well). This ensures we correctly save their normal positions and thus
that the sticky scroll container knows how to reposition them correctly.

Avoid registering inner table frames with the sticky scroll container to
make the assertion sound in cases of sticky-positioned tables.

Differential Revision: https://phabricator.services.mozilla.com/D147092
2022-05-23 20:43:15 +00:00
Ting-Yu Lin
72ec26664d Bug 1692116 Part 2 - Fix table flex item's flex base size & hypothetical main size in a column flex container. r=dholbert
Bug 1674302 made table flex item to be able to grow or shrink towards
another size. However, for an inflexible table flex item, its
hypothetical main size is the final main size. We have to compute the
flex base size correctly when generating FlexItem.

With Part 1, it's easy to change nsTableWrapperFrame::ComputeSize() to
return the correct block-size.

Differential Revision: https://phabricator.services.mozilla.com/D106156
2021-02-25 20:06:10 +00:00
Ting-Yu Lin
96a2597206 Bug 1692116 Part 1 - Let nsTableWrapperFrame::ComputeAutoSize() return a resolved block-size. r=dholbert
We already compute both the inner table frame and the caption frame's
block-sizes in InnerTableShrinkWrapSize() and CaptionShrinkWrapSize(),
respectively. Rather than throwing them away, popping them up to
ComputeAutoSize().

This is a preparation patch for Part 2, and it hasn't changed the
behavior yet.

Differential Revision: https://phabricator.services.mozilla.com/D106155
2021-02-25 20:06:10 +00:00
Ting-Yu Lin
1e1db8c9d9 Bug 1674302 Part 3 - Fix flex base size resolution and main/cross size override for table flex items. r=dholbert
This is the main patch of this bug.

When a flex container provides size overrides for a table flex item,
there are two use cases.

(1) When resolving flex base size, we want to use `flex-basis` to
replace the preferred main size on the *inner table frame* directly.
This is how `height` works on a table element. That is, it sets the
height of the inner table frame, not the table wrapper. This patch
invents `mApplyOverridesVerbatim` flag to tell table wrapper frame don't
do any modification.

(2) When overriding main-size/cross-size for a table flex item, the size
is for *table wrapper frame*. To apply the size to inner table frame,
the table wrapper frame needs adjust the size by subtracting the area
occupied by caption, border, and padding (depending on the box-sizing).

This patch fixes the flex base resolution, and implements the logic for
(2).

We use nsLayoutUtils::GetStyleFrame() to dig into inner table's sizing
properties when resolving flex base size, so we can stop inheriting flex
properties to table wrapper frame in ua.css.

We also need to check style frame's StylePosition() in IsCrossSizeAuto()
so that non-'auto' sizes can prevent tables from being stretched in the
cross axis, just as happens with other flex items. Otherwise with this
patch, the table flex item with fixed height in
dom/flex/test/chrome/test_flex_item_rect.html will be wrongly stretched.

Differential Revision: https://phabricator.services.mozilla.com/D103437
2021-02-18 05:45:25 +00:00
Ting-Yu Lin
2f4dfc348c Bug 1691875 Part 3 - Always compute inner table's border and padding before initializing its ReflowInput. r=layout-reviewers,jfkthame,mats
This is a preparation patch for bug 1674302. We'll need border padding
to reduce the size for inner table size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D104643
2021-02-15 18:30:03 +00:00
Ting-Yu Lin
fbda8a1788 Bug 1691875 Part 2 - Pass the area occupied by caption into CreateReflowInputForInnerTable(). r=mats,jfkthame
If the table wrapper frame has a caption, several sizes that are used to
initialized inner table's ReflowInput needs to be reduced:

1. the available block-size,
2. containing block size,
3. StyleSizeOverrides (will be considered in bug 1674302).

This patch gives CreateReflowInputForInnerTable() an argument to pass
the space occupied by the caption in order to reduce the above sizes.

Note the old code doesn't reduce the constrained available block-size
when recreating ReflowInput for a table grid item, but this patch does.

Also, this patch goes ahead to recreate ReflowInput when the area
occupied by caption is non-empty, which may or may not affect the
containing block size for grid item. But for now, I keep it simple
because bug 16743202 is going to add logic that needs to recreate
ReflowInput when there is any size overrides. I tend not to
over-optimize the performance.

Differential Revision: https://phabricator.services.mozilla.com/D104642
2021-02-15 18:30:03 +00:00
Ting-Yu Lin
1c4cc18a9f Bug 1691875 Part 1 - Split and rename nsTableWrapperFrame::ChildShrinkWrapISize() into two methods for caption and inner table. r=layout-reviewers,jfkthame
This patch is similar to Bug 1690901 Part 2, but for ChildShrinkWrapISize().
https://hg.mozilla.org/mozilla-central/rev/33171dca5ccd

Also, aCBSize should be passed by const-reference, not by value.

Differential Revision: https://phabricator.services.mozilla.com/D104641
2021-02-15 18:30:02 +00:00
Ting-Yu Lin
bfc8d66755 Bug 1527734 - Use ReflowInput::mContainingBlockSize instead of GridItemCBSizeProperty(). r=mats
Grid container stores the containing block size on a table wrapper grid
item in GridItemCBSizeProperty(), but the size is also passed as a
parameter when creating table wrapper's ReflowInput, and is stored in
ReflowInput::mContainingBlockSize. We can use mContainingBlockSize
directly instead of GridItemCBSizeProperty().

The test 002.html is inspired from the testcases in bug 1527734.
003.html and 004.html are inspired from the testcase in bug 1521088.
004.html is 003.html with 'width:500px' added to <table>, which we still
fail with this patch.

Differential Revision: https://phabricator.services.mozilla.com/D104144
2021-02-09 00:59:39 +00:00
Ting-Yu Lin
5f5bebcbde Bug 1689504 Part 3 - Remove the specialized code to set a collapsed table's border & padding in SizeComputationInput. r=emilio
When creating a ReflowInput for inner table frame in
CreateReflowInputForInnerTable(), we pass the customize border & padding
if the table frame is border-collapsed.

Similarly, when creating a SizeComputationInput for inner table frame,
we should be able to pass border & padding rather than having a
specialized logic in SizeComputationInput::InitOffsets(). This patch
makes this a reality.

Differential Revision: https://phabricator.services.mozilla.com/D104350
2021-02-08 10:26:41 +00:00
Ting-Yu Lin
244ddf8eff Bug 1689504 Part 2 - Move the computation of ComputeSizeFlag from ComputeAutoSize() to ChildShrinkWrapISize(). r=emilio
If the table wrapper frame has a caption, we don't need to compute the
flags twice, because the flag can be determined solely by table wrapper
frame's properties.

Differential Revision: https://phabricator.services.mozilla.com/D104349
2021-02-08 10:24:32 +00:00
Ting-Yu Lin
6165da56dc Bug 1689504 Part 1 - Remove the output margin parameter on nsTableWrapperFrame::ChildShrinkWrapISize(). r=emilio
Bug 1688690 has ensured inner table's computed margins are all zero.
Here, the only caller is asking the margin of the inner table, which is
always 0. Hence this patch.

Differential Revision: https://phabricator.services.mozilla.com/D104348
2021-02-08 10:24:21 +00:00
Emilio Cobos Álvarez
bebec20c7a Bug 1690706 - Move caption-side outside of mako. r=TYLin
Make it an enum class, etc.

Differential Revision: https://phabricator.services.mozilla.com/D103978
2021-02-07 12:33:45 +00:00
Ting-Yu Lin
400614dec3 Bug 1690901 Part 3 - Rename OuterDoReflowChild() to ReflowChild() for nsTableWrapperFrame. r=layout-reviewers,mats
Differential Revision: https://phabricator.services.mozilla.com/D104107
2021-02-05 04:46:44 +00:00
Ting-Yu Lin
3f737fcc31 Bug 1690901 Part 2 - Split and rename nsTableWrapperFrame::OuterBeginReflowChild() into two methods for caption and inner table. r=layout-reviewers,mats
Split OuterBeginReflowChild() so that we don't need to branch logic for
caption and inner table.

Rename the methods because OuterBeginReflowChild() only creates the
ReflowInput, and has nothing to do with actual reflow. We could give
both methods the same name like `CreateChildReflowInput` and rely on
function overloading to call the correct method depending on the frame
type, but I prefer clearer method names.

Differential Revision: https://phabricator.services.mozilla.com/D104106
2021-02-05 04:46:42 +00:00
Ting-Yu Lin
680aa0d526 Bug 1690901 Part 1 - Make GetCaptionSide() and HasSideCaption() const methods. r=layout-reviewers,mats
Differential Revision: https://phabricator.services.mozilla.com/D104105
2021-02-05 04:43:38 +00:00
Ting-Yu Lin
ec91abb3dc Bug 1690715 - Expand nsTableWrapperFrame::InitChildReflowInput() at its only caller. r=dholbert
The purpose of InitChildReflowInput() is to provide customized border,
padding, and containing block size for the *inner table frame*, not for
the caption frame. So the caption frame's ReflowInput doesn't need to be
initialized in a separate step.

Differential Revision: https://phabricator.services.mozilla.com/D103436
2021-02-04 05:17:11 +00:00
Ting-Yu Lin
349e6f61c6 Bug 1688690 Part 3 - Simplify nsTableWrapperFrame's methods where the nsTableFrame's margin is used. r=emilio
Rename SetDesiredSize() to ComputeFinalBSize() because it now computes
only the final block-size.

Differential Revision: https://phabricator.services.mozilla.com/D103066
2021-01-27 01:52:04 +00:00
Ting-Yu Lin
60ba2b527c Bug 1688690 Part 2 - Ensure nsTableFrame's computed margins are all zero. r=emilio
This patch makes the following changes:

1. Don't call ReflowInput::CalculateBlockSideMargins() for nsTableFrame
so that setting nsTableFrame's computed margins to zero in
SizeComputationInput::InitOffsets() remains true. Also, add an assertion
in nsTableFrame::Reflow() to ensure that.

2. Remove useless nsTableFrameWrapper::GetChildMargin() because the
method is used to get nsTableFrame's margins, which are now all zero.
Also, the old code that subtracts the block-axis margin from available
block-size doesn't really make sense.

3. Pass all-zero innerMargins to nsTableWrapperFrame::SetDesiredSize(),
and use table wrapper's content-box inline-size as the final desired
border-box inline-size rather than reconstructing it from caption and
inner table's inline-size & margin like the old code.

This inline-size already takes inner table's intrinsic size and
caption's inline-size into consideration in
nsTableWrapperFrame::ComputeAutoSize(), and is the final inline-size we
want to use.

In the next part, we are going to simplify all nsTableWrapperFrame's
methods that take inner frame's margin.

Differential Revision: https://phabricator.services.mozilla.com/D103065
2021-01-27 01:53:36 +00:00
Ting-Yu Lin
90546a2af8 Bug 1688690 Part 1 - Extract content-box inline-size in nsTableWrapperFrame::Reflow(). r=emilio
`aOuterRI.ComputedSize(wm).ISize(wm)` can be extracted as a variable
because it is used repeatedly.

Differential Revision: https://phabricator.services.mozilla.com/D103064
2021-01-26 19:52:09 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00