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)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
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•5 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•5 years ago
|
||
The implementation was deleted in Bug 812687
https://hg.mozilla.org/mozilla-central/rev/173a4f49dfe3
Depends on D65778
Assignee | ||
Comment 3•5 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•5 years ago
|
||
They are helpers for DoFlexLayout, which don't need to be public.
Depends on D65780
Assignee | ||
Comment 5•5 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•5 years ago
|
||
Also, remove unused ReflowOutput from DoFlexLayout's argument.
Depends on D65783
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D65784
Comment 8•5 years ago
|
||
Thanks for doing this!
Updated•5 years ago
|
Comment 10•5 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
•