Consider adding optional border & padding parameters to SizeComputationInput's constructor
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
Details
Attachments
(4 files)
Consider adding optional border & padding parameters to SizeComputationInput
's constructor so that caller can pass in customized border & padding into SizeComputationInput::Init()
. ReflowInput::Init()
already have the ability.
One use case is when constructing a ReflowInput
for a border-collapsed nsTableFrame
, we need to pass customized border [1]. But if we only want a basic SizeComputationInput
for a border-collapsed nsTableFrame
, the border is calculated as a special case in SizeComutationInput::InitOffsets
[3] because currently there's no way to provided a customized border into SizeComputationInput
.
[1] https://searchfox.org/mozilla-central/rev/4f07d49f1c7a823da07e3a231ac87c6435c8fd58/layout/tables/nsTableWrapperFrame.cpp#237-240,257
[2] https://searchfox.org/mozilla-central/rev/4f07d49f1c7a823da07e3a231ac87c6435c8fd58/layout/tables/nsTableWrapperFrame.cpp#342-343
[3] https://searchfox.org/mozilla-central/rev/4f07d49f1c7a823da07e3a231ac87c6435c8fd58/layout/generic/ReflowInput.cpp#2500-2511
Assignee | ||
Comment 1•4 years ago
|
||
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.
Assignee | ||
Comment 2•4 years ago
|
||
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.
Depends on D104348
Assignee | ||
Comment 3•4 years ago
|
||
When creating a ReflowInput for inner table frame, we pass the customize
border & padding if the table frame is border-collapsed (in
CreateReflowInputForInnerTable()).
Similarly, when creating a SizeComputationInput for inner table frame,
we should be able to pass border & padding rather have some specialized
code in SizeComputationInput::InitOffsets().
Depends on D104349
Assignee | ||
Comment 4•4 years ago
|
||
The old code used to compute margins for table frame, and nuke it
afterwards. We can save some time by moving the code setting zero
margins into ComputeMargin().
Depends on D104350
Updated•4 years ago
|
Comment 6•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a735d09ecabf
https://hg.mozilla.org/mozilla-central/rev/124c504f282b
https://hg.mozilla.org/mozilla-central/rev/5d3dbe766512
https://hg.mozilla.org/mozilla-central/rev/7a4c9469e940
Description
•