Closed
Bug 813358
Opened 12 years ago
Closed 12 years ago
Move nsBoxFrame frame-sorting logic into nsLayoutUtils
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(5 files, 1 obsolete file)
9.06 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
2.06 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
5.66 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
11.51 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
1.03 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
nsBoxFrame has code to merge-sort a frame list, and I'd love to use it in bug 811521 for sorting a flex container's children.
Filing this bug on moving that frame-list-sorting code into nsLayoutUtils and making it more generic.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•12 years ago
|
||
This patch just removes the (unneeded) nsBoxLayoutState argument from the sorting methods in question (in preparation for ripping them out of nsBoxFrame).
Attachment #683365 -
Flags: review?(dbaron)
Assignee | ||
Comment 2•12 years ago
|
||
This patch simplifies the logic for checking if a frame list is already sorted. In particular, this patch just makes us directly compare each pair of adjacent frames, instead of using "maxOrdinal".
(This functionality will get separated out into its own templatized function in the next patch, but that patch is simpler if I've paved the way for that in this patch.)
Attachment #683390 -
Flags: review?(dbaron)
Assignee | ||
Comment 3•12 years ago
|
||
(forgot a commit message; added one now)
Attachment #683390 -
Attachment is obsolete: true
Attachment #683390 -
Flags: review?(dbaron)
Attachment #683391 -
Flags: review?(dbaron)
Assignee | ||
Comment 4•12 years ago
|
||
This patch splits CheckBoxOrder into two helper-methods -- IsFrameListSorted() and SortFrameList() -- which take a comparison function as a template-argument.
Attachment #683397 -
Flags: review?(dbaron)
Assignee | ||
Updated•12 years ago
|
Attachment #683397 -
Attachment description: part 3: Make the comparison function a template parameter → part 3: Split CheckBoxOrder into "IsFrameListSorted" and "SortFrameList", which take comparison function as a template parameter
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #683402 -
Flags: review?(dbaron)
Assignee | ||
Comment 6•12 years ago
|
||
(part 4 is essentially just a giant cut-and-paste, with a few "nsLayoutUtils::" prefix insertions & removals)
Updated•12 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Assignee | ||
Updated•12 years ago
|
Attachment #683365 -
Attachment description: part 1: remove unneeded state args from sorting method → part 1: remove unneeded state args from sorting methods
Comment on attachment 683365 [details] [diff] [review]
part 1: remove unneeded state args from sorting methods
r=dbaron
Attachment #683365 -
Flags: review?(dbaron) → review+
Comment on attachment 683391 [details] [diff] [review]
part 2 v2: Simplify "is frame list already sorted" logic
It might be better to have the mFrames.IsEmpty() check before the SupportsOrdinalsInChildren check, just since it might be better to have the early return that doesn't involve a virtual function call before the one that does.
I think I slightly preferred the old one-iterator-plus-maxOrdinal approach rather than the two-iterators approach, but I'm ok either way.
r=dbaron
Attachment #683391 -
Flags: review?(dbaron) → review+
Comment on attachment 683397 [details] [diff] [review]
part 3: Split CheckBoxOrder into "IsFrameListSorted" and "SortFrameList", which take comparison function as a template parameter
Er, now I see where you were going with the previous patches; I guess you can ignore a bunch of my comments on them.
Attachment #683397 -
Flags: review?(dbaron) → review+
Attachment #683402 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 10•12 years ago
|
||
(In reply to David Baron [:dbaron] from comment #9)
> Er, now I see where you were going with the previous patches; I guess you
> can ignore a bunch of my comments on them.
Yup -- sorry for not making that clearer. (I'll disregard both points from comment 8, since that code is the way it is for the purpose of splitting out a generic "IsFrameListSorted" function.)
Assignee | ||
Comment 11•12 years ago
|
||
Thanks for the reviews!
One more tiny patch here that I forgot to attach -- just adding a sanity-check assertion that after we sort, we satisfy IsFrameListSorted().
Attachment #687281 -
Flags: review?(dbaron)
Attachment #687281 -
Flags: review?(dbaron) → review+
Comment 12•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/af6a637e9a95
https://hg.mozilla.org/mozilla-central/rev/c01b1fbdacdf
https://hg.mozilla.org/mozilla-central/rev/5e89b39fd7d0
https://hg.mozilla.org/mozilla-central/rev/58cb9bf14a4c
https://hg.mozilla.org/mozilla-central/rev/ceddb3b529de
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•