Extend existing flex container APIs to support flex item fragmentation
Categories
(Core :: Layout: Flexbox, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
(Whiteboard: [layout:backlog:77])
Attachments
(8 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 | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
To support flex item fragmentation, some existing and APIs need to be extended.
- We need to pass the remaining available block-size to ReflowFlexItem(), and let it output the child's reflow status.
- Currently, we run
DoFlexLayout
in every flex container's fragments to determine content-box's size and final size. We need to change it to runDoFlexLayout
in the first fragment, and cache the relevant data for later fragments to use. That means we need to change the way we compute available block-size and flex container's final size. - One tricky aspect is to consider "box-decoration-break: clone", because the property can affect the computation of available block-size and the final size of the flex container.
Conceptually, if we don't support flex item fragmentation, all the flex items act just like an unbreakable child for flex container. With this in mind, I hope to address the above points without breaking existing tests, and lay the foundation for bug 1622935.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D69469
Assignee | ||
Comment 3•4 years ago
|
||
In a later part, we want to use NS_UNCONSTRAINEDSIZE for
aAvailableBSizeForContent.
Depends on D69470
Assignee | ||
Comment 4•4 years ago
|
||
We want mContentBoxMainSize and mContentBoxCrossSize in
SharedFlexLineData to be the final content-box without regards to
pagination, but it is not correct yet. A later part will pass
NS_UNCONSTRAINEDSIZE as availableBSizeForContent so that DoFlexLayout
can calculate the correct size.
Depends on D69471
Assignee | ||
Comment 5•4 years ago
|
||
The two variable will be used in ComputeFinalSize in a later part.
I follow the C++ Core Guidelines to return multiple value via std::tuple.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f21-to-return-multiple-out-values-prefer-returning-a-struct-or-tuple
Depends on D69472
Assignee | ||
Comment 6•4 years ago
|
||
By passing unconstrained availableBSizeForContent to DoFlexLayout, we
can get the desired flex container's content-box size as if there's no
pagination. We then use this content-box size and
maxBlockEndEdgeOfChildren to rewrite the logic to determine flex
container's final size.
I still maintain the compatibility with block frame that if the flex
container is running out of block-size, it can still become incomplete
and requesting an zero block-size continuation. One comment in block
frame feel this is wrong, but fixing it is not in the scope of this bug.
https://searchfox.org/mozilla-central/rev/4ccefc3181f9d237ef4ca8bd17b4e7c101ddf7b5/layout/generic/nsBlockFrame.cpp#7715-7718
Depends on D69473
Assignee | ||
Comment 7•4 years ago
|
||
These reftests are copied from flexbox-unbreakable-child-1-.html and
flexbox-unbreakable-child-1--wrap.html with "box-decoration-break:
clone" added to the flex container.
Note that flexbox-unbreakable-child-3-ref.html is redesigned. It is not
copied from flexbox-unbreakable-child-1-ref.html with
"box-decoration-break: clone" added because the bottom border doesn't
show up in sub-test 3 & 4. (bug 1564726 perhaps?)
Depends on D69474
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
-
Fixed "warning: use 'using' instead of 'typedef'" for OrderState.
-
Removed
FlexItem* item
to fix the "warning: Value stored to 'item'
is never read".
Depends on D69475
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/36907dee3e51 Part 1 - Allow ReflowFlexItem to take available size as an input, and output reflow status. r=dholbert https://hg.mozilla.org/integration/autoland/rev/a8e29df7db26 Part 2 - Add a helper to compute available size for flex items, and pass the information to ReflowChildren. r=dholbert https://hg.mozilla.org/integration/autoland/rev/c15c24dcc029 Part 3 - Add aColumnWrapThreshold to DoFlexLayout. r=dholbert https://hg.mozilla.org/integration/autoland/rev/bd29ea94d3bd Part 4 - Run DoFlexLayout only in first-in-flow, and store SharedFlexData in it. r=dholbert https://hg.mozilla.org/integration/autoland/rev/994770def1fc Part 5 - Make ReflowChildren() output children's max block-end edge and completeness. r=dholbert https://hg.mozilla.org/integration/autoland/rev/c473fe50e3fa Part 6 - Redesign the logic that computes flex container's final size with "box-decoration-break: clone" considered. r=dholbert https://hg.mozilla.org/integration/autoland/rev/c1e6d0ce349e Part 7 - Add reftests for flex containers with "box-decoration-break: clone" and unbreakable children. r=dholbert https://hg.mozilla.org/integration/autoland/rev/eb275e9ef6d4 Part 8 - Make nsFlexContainerFrame static-analysis warning free. r=dholbert
Comment 10•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/36907dee3e51
https://hg.mozilla.org/mozilla-central/rev/a8e29df7db26
https://hg.mozilla.org/mozilla-central/rev/c15c24dcc029
https://hg.mozilla.org/mozilla-central/rev/bd29ea94d3bd
https://hg.mozilla.org/mozilla-central/rev/994770def1fc
https://hg.mozilla.org/mozilla-central/rev/c473fe50e3fa
https://hg.mozilla.org/mozilla-central/rev/c1e6d0ce349e
https://hg.mozilla.org/mozilla-central/rev/eb275e9ef6d4
Description
•