Closed Bug 1691875 Opened 3 years ago Closed 3 years ago

Refactor the code that creates inner table's ReflowInput and compute its size

Categories

(Core :: Layout: Tables, task)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(3 files)

More refactor and preparation before the real work for bug 1674302.

Assignee: nobody → aethanyc

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.

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.

Depends on D104641

This is a preparation patch for bug 1674302. We'll need border padding
to reduce the size for inner table size overrides.

Depends on D104642

Blocks: 1674302
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/06357a2a1fd3
Part 1 - Split and rename nsTableWrapperFrame::ChildShrinkWrapISize() into two methods for caption and inner table. r=layout-reviewers,jfkthame
https://hg.mozilla.org/integration/autoland/rev/3fabd86d59e6
Part 2 - Pass the area occupied by caption into CreateReflowInputForInnerTable(). r=mats,jfkthame
https://hg.mozilla.org/integration/autoland/rev/ceaebebccb5e
Part 3 - Always compute inner table's border and padding before initializing its ReflowInput. r=layout-reviewers,jfkthame,mats
Regressions: CVE-2022-28286
No longer regressions: CVE-2022-28286
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: