Closed Bug 1176414 Opened 4 years ago Closed 4 years ago

Clean up column index variables in nsTableRowFrame::ReflowChildren

Categories

(Core :: Layout: Tables, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: dholbert, Assigned: jfkthame)

References

Details

Attachments

(1 file)

nsTableRowFrame::ReflowChildren has some abstract column indexing variables to handle RTL/LTR symmetrically, which are being cleaned up in bug 1174700. (we're removing the special cases for RTL).

This leaves an opportunity for some simplification - at least:
 * colIncrement can be removed. (It's now just an alias for "1")
 * firstPrevColIndex can be removed. (It's now just an alias for -1)

(There may be more cleanup to do here; this is just what I noticed so far)
Other cleanup in this function which I'm deferring from review comments on bug 1174700:

* startIndex can probably be removed. (It was previously something different in RTL vs LTR, but now it'll just be an alias for startIndex.

* This variable "x"...
   nscoord x = 0; // running total of children x offset
...wants to be named "iPos" or something (and s/x/inline-axis/ in comment)

* This loop var "colX"...
        for (int32_t colX = startIndex; actualColSpan > 0;
             colX += colIncrement, actualColSpan--) {
... needs a rename as well.  "x" implies horizontal axis here. I think this really wants to be named "colIndex", since it's a column index (starting at startIndex aka cellColIndex).
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Comment on attachment 8625343 [details] [diff] [review]
Clean up/rename various column index variables in nsTableRowFrame and nsTableFrame

Looks good, thanks!
Attachment #8625343 - Flags: review?(dholbert) → review+
https://hg.mozilla.org/mozilla-central/rev/dfe19db28043
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.