Closed Bug 1857585 Opened 2 years ago Closed 2 years ago

Clean up for table row and table cell code

Categories

(Core :: Layout: Tables, task)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(7 files)

The bug collects the cleanup patches written while I'm reading table fragmentation code. None of the patches changes behavior.

wm has been declared near the beginning of nsTableCellFrame::Reflow().

Depends on D190371

It is confusing for ResetBSize() to take a parameter to set the fixed
block-size. The caller can call SetFixedBSize() if needed.

Depends on D190372

We don't ever remove NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE bit, so let's set the
bit directly in SetUnpaginatedBSize().

This patch doesn't change behavior.

Depends on D190373

nsTableRowFrame's children are all nsTableCellFrame, and GetFirstCell() has an
assertion for that. Hence, we can delete the unreachable code dealing with
non-cell frames.

Depends on D190374

While I'm here, revise GetFirstRow(), GetLastRow(), and GetNextRow(), and add
assertions to them to ensure the correctness of table frame tree structure.

Depends on D190375

  • It used to return useless nsresult. Change it to return the block-size
    instead of modifying the argument to return value.
  • Shorten its name to CalcCellActualBSize. to match CalcBSize.

Depends on D190376

Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/26cd8108386b Part 1 - Remove unused PresContext parameter. r=dholbert https://hg.mozilla.org/integration/autoland/rev/bb38442c5c66 Part 2 - Remove a redundant writing-mode variable. r=dholbert https://hg.mozilla.org/integration/autoland/rev/33292b37979d Part 3 - Remove nscoord parameter for ResetBSize(). r=dholbert https://hg.mozilla.org/integration/autoland/rev/9b16e698bb50 Part 4 - Simplify unpaginated block-size helpers. r=dholbert https://hg.mozilla.org/integration/autoland/rev/e3bac061baef Part 5 - Use GetFirstCell() to avoid extra do_QueryFrame. r=dholbert https://hg.mozilla.org/integration/autoland/rev/f419ded2ab03 Part 6 - Use GetFirstRow() to avoid extra do_QueryFrame. r=dholbert https://hg.mozilla.org/integration/autoland/rev/8d59db268cc8 Part 7 - Revise the helper computing table cell's block-size. r=dholbert
Blocks: 1859446
Blocks: 1861562
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: