Closed
Bug 885424
Opened 11 years ago
Closed 11 years ago
Refactor flexbox layout logic to make pagination more straightforward
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(5 files)
2.25 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
2.12 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
3.45 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
1.62 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
2.92 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
Filing this bug for a few minor logic-shuffling-patches for flexbox reflow, to make bug 811024 more straightforward.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #765722 -
Flags: review?(dbaron)
Assignee | ||
Comment 2•11 years ago
|
||
Right now we set 'aStatus' to NS_FRAME_COMPLETE towards the end of reflow. This patch moves it to the beginning, so that (in bug 811024) we can update it to INCOMPLETE if & when we detect the need for a split. This also moves the NS_FRAME_SET_TRUNCATION line to the very end, for consistency with other frame classes. (In nsBlockFrame, nsFieldSetFrame, nsTableFrame, and every other frame class I checked, we call NS_FRAME_SET_TRUNCATION as the absolute final thing before returning.)
Attachment #765728 -
Flags: review?(dbaron)
Assignee | ||
Comment 3•11 years ago
|
||
Currently, we do cross-axis sizing and main-axis alignment of flex items as part of the same loop, because they're completely independent, which means we can do them at the same time rather than looping twice. However, the flexbox layout algorithm in the spec lists these as separate steps -- and importantly, the Sample Flex Fragmentation Algorithm adds some things to do in between them. So, this patch splits out main-axis alignment into its own loop, and adds some labels that correspond to sections of the spec, for clarity.
Attachment #765730 -
Flags: review?(dbaron)
Assignee | ||
Comment 4•11 years ago
|
||
This patch: * Renames the local variable 'flexContainerMainSize' to 'contentBoxMainSize' (since it's specifically the size of the flex container's *content-box*) * Marks that variable and its friend 'frameMainSize' as 'const'. (These variables will be used at various points throughout reflow (& in some of the code that'll be added in bug 811024), and it's nice to make it clear that we won't be modifying them.) (Note: 'frameMainSize' is the main-size of the flex container's border-box; maybe that should be renamed to borderBoxMainSize, but I haven't done that yet because that variable name is less ambiguous, since frame sizes are always border-box sizes.)
Attachment #765732 -
Flags: review?(dbaron)
Assignee | ||
Comment 5•11 years ago
|
||
This patch refactors ComputeFlexContainerMainSize to have an easy early-return case for horizontal flex containers (since they're guaranteed to have a resolved width), and it dedicates the more complicated logic to vertical flex containers. (which might not have a constrained height) This is effectively how it already was, per the "Computed width should always be constrained" assertion that this patch removes -- but we just had a bit of abstraction-theater, with us repeatedly querying the axis tracker to tell us whether the height or width was the main component, etc, when really we know it's a vertical flex container. This patch makes things simpler in bug 811024, because it'll let us subtract the heights of flex items' prev-in-flows specifically in the vertical-flex-container case, while avoiding that for horizontal flex containers, without any need for abstraction-theater. (This asymmetry is essentially due to the fact that we only paginate vertically.)
Attachment #765735 -
Flags: review?(dbaron)
Attachment #765722 -
Flags: review?(dbaron) → review+
Attachment #765728 -
Flags: review?(dbaron) → review+
Attachment #765730 -
Flags: review?(dbaron) → review+
Attachment #765732 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 6•11 years ago
|
||
Landed parts 0 through 3: part 0: https://hg.mozilla.org/integration/mozilla-inbound/rev/ba51eb5cccf2 part 1: https://hg.mozilla.org/integration/mozilla-inbound/rev/d34ed2e650aa part 2: https://hg.mozilla.org/integration/mozilla-inbound/rev/9da12a105835 part 3: https://hg.mozilla.org/integration/mozilla-inbound/rev/9dac032e1ffc
Flags: in-testsuite-
Whiteboard: [leave open]
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ba51eb5cccf2 https://hg.mozilla.org/mozilla-central/rev/d34ed2e650aa https://hg.mozilla.org/mozilla-central/rev/9da12a105835 https://hg.mozilla.org/mozilla-central/rev/9dac032e1ffc
Attachment #765735 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 8•11 years ago
|
||
part 4: https://hg.mozilla.org/integration/mozilla-inbound/rev/285c7cb20fc2
Whiteboard: [leave open]
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/285c7cb20fc2
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•