Some refactor around DoFlexLayout
Categories
(Core :: Layout: Flexbox, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
Details
Attachments
(7 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
It's been a while since I think about flexbox algorithm & fragmentation. This time when I look at DoFlexLayout
and its data flow, I found some opportunities to make it clearer. See the upcoming patches.
Assignee | ||
Comment 1•3 years ago
|
||
Move the assertion for unconstrained isize to the beginning of Reflow() because
we check it in all cases -- in GetMainSizeFromReflowInput when a flex container
is row-oriented, or in the old code computing gap size and ComputeCrossSize()
when a flex container is column-oriented.
Assignee | ||
Comment 2•3 years ago
|
||
DoFlexLayout() and ComputeCrossSize() are only called in first-in-flow, so
aConsumedBSize are always 0.
Depends on D137361
Assignee | ||
Comment 3•3 years ago
|
||
The StrutInfo
array is used only within DoFlexLayout, so we can restart the
flex layout within DoFlexLayout to make Reflow() simpler.
Depends on D137362
Assignee | ||
Comment 4•3 years ago
|
||
I found in/out parameters confusing when reasoning the data flow. Aggregating
DoFlexLayout's output data in a struct also reduces DoFlexLayout's number of
arguments.
Depends on D137363
Assignee | ||
Comment 5•3 years ago
|
||
We've got the tentative cross size before calling DoFlexLayout() in Reflow(). In
DoFlexLayout and a few other methods and just use that value.
Depends on D137364
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Currently, we pass all the five fields in FlexLayoutResult separately into
ReflowChildren(), but we really should just pass FlexLayoutResult instead.
Depends on D137365
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D138100
Comment 9•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/88181dec11e8
https://hg.mozilla.org/mozilla-central/rev/112d24a3a280
https://hg.mozilla.org/mozilla-central/rev/25f556801924
https://hg.mozilla.org/mozilla-central/rev/dd2291e298d0
https://hg.mozilla.org/mozilla-central/rev/68cc1c64bb66
https://hg.mozilla.org/mozilla-central/rev/8eebe46df776
https://hg.mozilla.org/mozilla-central/rev/d295fb16a0cb
Description
•