Closed Bug 1167696 Opened 9 years ago Closed 9 years ago

Simplify nsTableReflowState

Categories

(Core :: Layout: Tables, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(2 files)

Noticed a few simplifications that can be made to nsTableReflowState:
 1) the prescontext arg on its methods is unused & can be removed.
 2) It's got 2 constructors, but only one of them is ever used -- so we can drop the unused one, and merge the used one into "Init()"
Comment on attachment 8609558 [details] [diff] [review]
part 1: drop unused arg & constructor, and fold Init into remaining constructor

It's weird to use "nsTableFrame&" when we use pointers for frames
everywhere else.  I think we should change it to "nsTableFrame*"
for consistency while we're here.
Attachment #8609558 - Flags: review?(mats) → review+
Ah, good point. Taking it one step further, we actually don't even need that nsTableFrame& (or nsTableFrame*) parameter at all, in fact -- we've already got it on the passed-in nsHTMLReflowState.

(I traced it back (just through one level of caller), and that nsHTMLReflowState comes from nsTableFrame::Reflow, so it should have its .frame member == this (the table frame) at that point. And '*this' is the frame that we pass in to construct the nsTableReflowState.)
(Since we're losing the type-enforcement of the passed-in frame having type nsTableFrame, I added an assertion about the frame's ->Type().)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8609767 - Flags: review?(mats)
Attachment #8609558 - Attachment description: fix v1 → part 1: drop unused arg & constructor, and fold Init into remaining constructor
Attachment #8609767 - Flags: review?(mats) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: