Closed Bug 1388892 Opened 4 years ago Closed 4 years ago

Hide nsIntRect implementation details from TableArea

Categories

(Core :: Layout, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: milan, Assigned: milan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

TableArea was created in bug 1159990.  In the context of bug 1386277, we want to hide the implementation details of nsIntRect from TableArea.
Assignee: nobody → milan
Comment on attachment 8895847 [details]
Bug 1388892:  TableArea doesn't really need to own the rectangle, except for the union call.  Especially since we're exposing the addresses of the members.

https://reviewboard.mozilla.org/r/166828/#review172420

::: layout/tables/TableArea.h:42
(Diff revision 1)
> -    { mRect.UnionRect(aArea1.mRect, aArea2.mRect); }
> +    {
> +      nsIntRect rect(aArea1.mStartCol, aArea1.mStartRow,
> +                     aArea1.mColCount, aArea1.mRowCount);
> +      rect.UnionRect(rect, nsIntRect(aArea2.mStartCol, aArea2.mStartRow,
> +                                     aArea2.mColCount, aArea2.mRowCount));
> +      mStartCol = rect.X();

I'll probably add BaseRect::GetRect(T*, T*, T*, T*) method that can set all four of these values in a single call.
Comment on attachment 8895847 [details]
Bug 1388892:  TableArea doesn't really need to own the rectangle, except for the union call.  Especially since we're exposing the addresses of the members.

https://reviewboard.mozilla.org/r/166828/#review172528
Attachment #8895847 - Flags: review?(xidorn+moz) → review+
Moved some of the r+'d patches from bug 1389152 to this one as it's using the new method.
Comment on attachment 8895847 [details]
Bug 1388892:  TableArea doesn't really need to own the rectangle, except for the union call.  Especially since we're exposing the addresses of the members.

https://reviewboard.mozilla.org/r/166828/#review180140
Comment on attachment 8895847 [details]
Bug 1388892:  TableArea doesn't really need to own the rectangle, except for the union call.  Especially since we're exposing the addresses of the members.

https://reviewboard.mozilla.org/r/166828/#review180142
Pushed by msreckovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7fcd883bac90
TableArea doesn't really need to own the rectangle, except for the union call.  Especially since we're exposing the addresses of the members.  r=xidorn
https://hg.mozilla.org/mozilla-central/rev/7fcd883bac90
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.