Closed
Bug 1037177
Opened 10 years ago
Closed 10 years ago
Minor flexbox refactoring, in support of bug 1015474
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(5 files, 3 obsolete files)
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Bug 1015474 is making "min-[width|height]: auto" and "flex-basis:auto" a bit more complicated to resolve.
I'm filing this bug on doing some minor refactoring (without affecting behavior), in support of that bug, so that the patches over there can be cleaner/simpler.
Assignee | ||
Comment 1•10 years ago
|
||
This first patch is for conciseness & better optimization.
This makes us pass an (existing) reflow state into the FlexItem() constructor, which...
(1) removes the need for a few other args in the constructor (which are taken from the reflow state)
(2) makes for faster access to style structs in FlexItem(), since per bug 864129 comment 3, frame->StyleFoo() is slower than reflowState->mStyleFoo. (We currently use the former several times in the constructor; this patch makes us do the latter.)
Attachment #8454041 -
Flags: review?(mats)
Assignee | ||
Comment 2•10 years ago
|
||
(same patch, now with more lines of context)
Attachment #8454041 -
Attachment is obsolete: true
Attachment #8454041 -
Flags: review?(mats)
Attachment #8454092 -
Flags: review?(mats)
Assignee | ||
Comment 3•10 years ago
|
||
This patch just renames a function.
Currently (as of bug 984711), "ResolveFlexItemMaxContentSizing" measures the auto-height, and applies it to either flex-basis:auto or min-height:auto. This resolving process will be becoming more complex in bug 1015474 (and will be handling "min-width:auto" as well), so this more generic name ("ResolveAutoFlexBasisAndMinSize") is more appropriate.
Assignee | ||
Updated•10 years ago
|
Attachment #8454094 -
Flags: review?(mats)
Assignee | ||
Comment 4•10 years ago
|
||
(one more patch coming in a bit)
Assignee | ||
Comment 5•10 years ago
|
||
This patch splits out the "measuring reflow" part of ResolveAutoFlexBasisAndMinSize() (the renamed function from part 2) into its own function.
Right now, this looks a little silly because the measuring reflow is the bulk of what ResolveAutoFlexBasisAndMinSize() does right now. But bug 1015474 will add more to that function, making this refactoring more valuable.
Attachment #8454119 -
Flags: review?(mats)
Assignee | ||
Updated•10 years ago
|
Attachment #8454119 -
Attachment description: part 3: → part 3: Split out auto-height measuring into its own dedicated function.
Assignee | ||
Comment 6•10 years ago
|
||
(previous version of part 3 accidentally changed logic in a way I didn't intend -- I'd swapped out !isMainSizeAuto for !isMainMinSizeAuto. Fixed that here, so that the logic stays the same.)
Attachment #8454119 -
Attachment is obsolete: true
Attachment #8454119 -
Flags: review?(mats)
Attachment #8454127 -
Flags: review?(mats)
Updated•10 years ago
|
Attachment #8454092 -
Flags: review?(mats) → review+
Updated•10 years ago
|
Attachment #8454094 -
Flags: review?(mats) → review+
Comment 7•10 years ago
|
||
Comment on attachment 8454127 [details] [diff] [review]
part 3 v2: Split out auto-height measuring into its own dedicated function.
r=mats
Attachment #8454127 -
Flags: review?(mats) → review+
Assignee | ||
Comment 8•10 years ago
|
||
One last (basically trivial) patch here: just bumping the "ResolveAutoFlexBasisAndMinSize()" call from happening just-after GenerateFlexItemForChild() to now happening right-at-the-end of GenerateFlexItemForChild().
(The reason for this change is: in bug 1015474, I'm going to make ResolveAutoFlexBasisAndMinSize() make use of GenerateFlexItemForChild()'s local-var "childRS".)
Attachment #8456694 -
Flags: review?(mats)
Assignee | ||
Updated•10 years ago
|
Attachment #8456694 -
Attachment description: part 4: → part 4: Call ResolveAutoFlexBasisAndMinSize at the end of GenerateFlexItemForChild, instead of just after it.
Comment 9•10 years ago
|
||
Comment on attachment 8456694 [details] [diff] [review]
part 4: Call ResolveAutoFlexBasisAndMinSize at the end of GenerateFlexItemForChild, instead of just after it.
It seems like GenerateFlexItemForChild now does a lot more than the name
indicates (even more so after bug 1015474 I suspect), so it might be
motivated to rename it and/or at least updating its doc comment.
Feel free to punt that to bug 1015474 though.
Attachment #8456694 -
Flags: review?(mats) → review+
Assignee | ||
Comment 10•10 years ago
|
||
Good idea. This patch updates the documentation. Not bothering w/ review, since this is comment-only, but feedback is welcome.
Comment 11•10 years ago
|
||
Comment on attachment 8456860 [details] [diff] [review]
part 5: update GenerateFlexItemForChild documentation
Thanks, a minor nit:
/* Returns ...
should be
/**
* Returns ...
to follow the standard doc comment format.
Assignee | ||
Comment 12•10 years ago
|
||
Thanks! Fixed locally.
Assignee | ||
Comment 13•10 years ago
|
||
(When posting patches on bug 1015474, I realized that MeasureFlexItemContentHeight & ResolveAutoFlexBasisAndMinSize could use some documentation, too, so I added some in this updated version of part 5.)
Assignee | ||
Updated•10 years ago
|
Attachment #8456860 -
Attachment is obsolete: true
Assignee | ||
Comment 14•10 years ago
|
||
Landed patches (parts 1 through 5):
https://hg.mozilla.org/integration/mozilla-inbound/rev/80c6223ed885
https://hg.mozilla.org/integration/mozilla-inbound/rev/ab0b0aea5baa
https://hg.mozilla.org/integration/mozilla-inbound/rev/596eaed1c024
https://hg.mozilla.org/integration/mozilla-inbound/rev/4e69bd26e55a
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdb506c21fc0
https://hg.mozilla.org/mozilla-central/rev/80c6223ed885
https://hg.mozilla.org/mozilla-central/rev/ab0b0aea5baa
https://hg.mozilla.org/mozilla-central/rev/596eaed1c024
https://hg.mozilla.org/mozilla-central/rev/4e69bd26e55a
https://hg.mozilla.org/mozilla-central/rev/bdb506c21fc0
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Assignee | ||
Updated•10 years ago
|
Flags: in-testsuite-
Assignee | ||
Updated•10 years ago
|
Blocks: minsizeauto-fallout
Assignee | ||
Updated•10 years ago
|
No longer blocks: minsizeauto-fallout
Depends on: minsizeauto-fallout
Assignee | ||
Updated•10 years ago
|
No longer depends on: minsizeauto-fallout
You need to log in
before you can comment on or make changes to this bug.
Description
•