Break DoFlexLayout() into smaller pieces
Categories
(Core :: Layout: Flexbox, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
(Blocks 1 open bug)
Details
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Currently, DoFlexLayout()
roughly does three things in the following order.
- Runs the flex layout algorithm, generates flex lines and flex items, and computes all the information.
- Performs the final reflow for all children based on the data in step 1.
- Computes flex container's final size based on data in step 1 and 2.
I'd like to extract step 2 and step 3 into some helpers. When the flex container needs to split, the data computed in step 1 might need not be computed again in the flex container's continuations.
In doing so, this part of the flex container's Reflow()
will be more like
DoFlexLayout(...)
if (restart flex layout) {
DoFlexLayout(...)
}
ReflowChilden(...)
ComputeFinalSize(...)
Assignee | ||
Comment 1•4 years ago
|
||
For two reasons,
-
Change the naming to make it consistent with
ComputeCrossSize
. -
Make it a flex container methods because it likely needs to call
nsSplittableFrame::GetEffectiveComputedBSize() later when we consider
fragmentation. If not, it doesn't harm anyway.
Assignee | ||
Comment 2•4 years ago
|
||
The implementation was deleted in Bug 812687
https://hg.mozilla.org/mozilla-central/rev/173a4f49dfe3
Depends on D65778
Assignee | ||
Comment 3•4 years ago
|
||
This is a preparation patch for a later part. I want to extract the
computation of flex container's ReflowOutput into a helper method, and
call the helper in Reflow().
Depends on D65779
Assignee | ||
Comment 4•4 years ago
|
||
They are helpers for DoFlexLayout, which don't need to be public.
Depends on D65780
Assignee | ||
Comment 5•4 years ago
|
||
Also, move UpdateFlexLineAndItemInfo() from the end of DoFlexLayout() to
the end of Reflow() because I'm going to extract the computation of
final size of flex container into a helper method in a later patch, and
call it Reflow() just after DoFlexLayout().
Depends on D65782
Assignee | ||
Comment 6•4 years ago
|
||
Also, remove unused ReflowOutput from DoFlexLayout's argument.
Depends on D65783
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D65784
Comment 8•4 years ago
|
||
Thanks for doing this!
Updated•4 years ago
|
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/d74c415aa322 Part 1 - Rename ResolveFlexContainerMainSize to ComputeMainSize, and make it a flex container method. r=dholbert https://hg.mozilla.org/integration/autoland/rev/d4bda3643a1d Part 2 - Delete unused SortChildrenIfNeeded() declaration. r=dholbert https://hg.mozilla.org/integration/autoland/rev/ae1ed37843e9 Part 3 - Export some data computed in DoFlexLayout. r=dholbert https://hg.mozilla.org/integration/autoland/rev/ae329f32dda9 Part 4 - Move the helper methods that handle ComputedFlexContainerInfo into protected section. r=dholbert https://hg.mozilla.org/integration/autoland/rev/fdfb108df9e8 Part 5 - Make CreateOrClearFlexContainerInfo() return the container info pointer, and use the pointer in DoFlexLayout. r=dholbert https://hg.mozilla.org/integration/autoland/rev/7c8aecf26754 Part 6 - Extract the computation of flex container's final size into a helper method. r=dholbert https://hg.mozilla.org/integration/autoland/rev/25601cd5859a Part 7 - Extract the final reflow for flex container's children into a method. r=dholbert
Comment 10•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d74c415aa322
https://hg.mozilla.org/mozilla-central/rev/d4bda3643a1d
https://hg.mozilla.org/mozilla-central/rev/ae1ed37843e9
https://hg.mozilla.org/mozilla-central/rev/ae329f32dda9
https://hg.mozilla.org/mozilla-central/rev/fdfb108df9e8
https://hg.mozilla.org/mozilla-central/rev/7c8aecf26754
https://hg.mozilla.org/mozilla-central/rev/25601cd5859a
Description
•