It used to be accounted for via the padding: inherit that was removed in
the regressing bug, but that was a bit action at a distance and was not
tested at all it seems...
Simplify the code, since this used to deal with buttons as well but
button anonymous boxes were removed a while ago.
Differential Revision: https://phabricator.services.mozilla.com/D305028
This patch enforces the invariant for `AbsoluteContainingBlock::Reflow()` that
most of the `Reflow()` functions already have.
Differential Revision: https://phabricator.services.mozilla.com/D302429
Introduce a dedicated type for representing <flex> values and use it instead
of relying on `#[css(dimension)]`.
This removes the last use of `#[css(dimension)]` and avoids adding special
dimension handling to the `ToTyped` derive. Supporting that annotation in
`ToTyped` would add unnecessary complexity for what is now a single use case.
Having an explicit <flex> value type makes it straightforward to add Typed OM
reification support for <flex> values in a follow-up patch.
Differential Revision: https://phabricator.services.mozilla.com/D300350
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.
Differential Revision: https://phabricator.services.mozilla.com/D298203
Grid containers are not block containers, so there is never a Class C
break opportunity between a grid container and its children. Remove
mCanBreakAtStart and simplify the logic that depended on it.
Reftest changes:
- grid-fragmentation-006 and grid-fragmentation-020: With mCanBreakAtStart
removed, the first grid row is always treated as being at the top of its
fragment (isRowTopOfPage = true). The reference files are updated to
reflect that the grid now stays in the first column rather than being
pushed to the next column.
- grid-fragmentation-023 and grid-fragmentation-028: align-content:normal
is added to bottom-fragment reference elements to correctly position grid
items at the start of those fragments. The original references used
align-content:space-evenly inherited from the .grid class, which placed
items at an incorrect offset.
Differential Revision: https://phabricator.services.mozilla.com/D286199
When a transformed absolute containing block fragments across multi-column,
abspos children could paint in the wrong column. This happened because the
abspos display item was built when its placeholder was encountered during
display list traversal, and the placeholder could end up in a different column
than where the abspos should paint.
Extend `DisplayPushedAbsoluteFrames` (now renamed to
`DisplayAbsoluteFramesNotBuiltByPlaceholder`) to also directly build abspos
frames whose placeholder lived in a different continuation subtree. Skip
building those abspos frames when they are later traversed via their
placeholders.
Differential Revision: https://phabricator.services.mozilla.com/D294312
When a transformed absolute containing block fragments across multi-column,
abspos children could paint in the wrong column. This happened because the
abspos display item was built when its placeholder was encountered during
display list traversal, and the placeholder could end up in a different column
than where the abspos should paint.
Extend `DisplayPushedAbsoluteFrames` (now renamed to
`DisplayAbsoluteFramesNotBuiltByPlaceholder`) to also directly build abspos
frames whose placeholder lived in a different continuation subtree. Skip
building those abspos frames when they are later traversed via their
placeholders.
Differential Revision: https://phabricator.services.mozilla.com/D294312
The changeset has been generated automatically through:
./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix
followed by manual adjustment when needed or when the auto-fixer bailed out.
This paves the way for Bug 2023527
Differential Revision: https://phabricator.services.mozilla.com/D287941
The changeset has been generated automatically through:
./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix
followed by manual adjustment when needed or when the auto-fixer bailed out.
This paves the way for Bug 2023527
Differential Revision: https://phabricator.services.mozilla.com/D287941
We already rely on one frame having at most one
absolute list, so there's no point in this distinction.
In the future, with position-visibility, we might want
to make fixed and abspos containing block effectively the same.
But one step at a time.
Differential Revision: https://phabricator.services.mozilla.com/D282681
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
See discussion in
https://phabricator.services.mozilla.com/D272401#inline-1485354
We seem to rely on the timing of overflow containers display items for e.g.
Pagination.
DisplayList will be sorted by z-index, but it's a stable sort that relies on
items being added in document order.
`out-of-flow-in-multicolumn-paint-order-003.html` fails due to us not
fragmenting grid items needs fragmentation.
Differential Revision: https://phabricator.services.mozilla.com/D281028
Combining with the patches in bug 1994346, this fixes a crash when running
`testing/web-platform/tests/css/css-break/grid/grid-item-008.html` on CI with
`layout.abspos.fragmentainer-aware-positioning.enabled = true`.
Differential Revision: https://phabricator.services.mozilla.com/D277496
Mark abspos next-in-flows with the `NS_FRAME_IS_PUSHED_OUT_OF_FLOW` bit, and
adjust the display item generation code accordingly.
In Bug 1994346, pushed abspos first-in-flow will get the bit as well.
Differential Revision: https://phabricator.services.mozilla.com/D277138
Adjusted ordering:
1. In-flow reflow
2. Overflow adjustment using grid-area + grid item margin rects from step 1
3. Abspos reflow, using overflow area from step 2 as scrollable containing
block if the abspos element in question has a default anchor.
Differential Revision: https://phabricator.services.mozilla.com/D277051
As per https://drafts.csswg.org/css-position/#original-cb they should
happen later. In general, multiple of these adjustments should be rarer
and browsers aren't particularly consistent. It's also unclear to me how
it affects the scrollable containing block stuff, I filed bug 2004596 to
sort that out.
Give a reasonable CB (the grid container's padding rect) down from grid
layout now that we might not use the actual grid CB.
Remove a check for fallbacks that isn't needed since part 1 of
bug 1991929.
Differential Revision: https://phabricator.services.mozilla.com/D275368
As per https://drafts.csswg.org/css-position/#original-cb they should
happen later. In general, multiple of these adjustments should be rarer
and browsers aren't particularly consistent. It's also unclear to me how
it affects the scrollable containing block stuff, I filed bug 2004596 to
sort that out.
Give a reasonable CB (the grid container's padding rect) down from grid
layout now that we might not use the actual grid CB.
Remove a check for fallbacks that isn't needed since part 1 of
bug 1991929.
Differential Revision: https://phabricator.services.mozilla.com/D275368
This patch consists of several parts:
- Introduce `PushedAbsolute` frame list (i.e. `mPushedAbsoluteFrames`) in
AbsoluteContainingBlock. This list is a temporary list used during reflow,
to store abspos frames that need to be reflowed by the delegating frame's
next-in-flow.
- For an absolute containing block frame, ensure its continuations also have
absolute containing block.
- Ensure that the position of abspos continuation is correct by adjusting
border, available block-size, etc. in
`AbsoluteContainingBlock::ReflowAbsoluteFrame()`.
- Cache `layout.abspos.fragmentainer-aware-positioning.enabled` pref at the time
when `nsPresContext` is initialized such that the pref value is stable across
the lifetime of `nsPresContext`. This is to ensure the frame tree structure
hygiene.
Differential Revision: https://phabricator.services.mozilla.com/D272400
This patch consists of several parts:
- Introduce `PushedAbsolute` frame list (i.e. `mPushedAbsoluteFrames`) in
AbsoluteContainingBlock. This list is a temporary list used during reflow,
to store abspos frames that need to be reflowed by the delegating frame's
next-in-flow.
- For an absolute containing block frame, ensure its continuations also have
absolute containing block.
- Ensure that the position of abspos continuation is correct by adjusting
border, available block-size, etc. in
`AbsoluteContainingBlock::ReflowAbsoluteFrame()`.
- The change in `nsPresContext` is to force reconstruct frame tree when flipping
`layout.abspos.fragmentainer-aware-positioning.enabled` pref, to ensure frame
tree structure hygiene.
Differential Revision: https://phabricator.services.mozilla.com/D272400
Converting a logical axis from one writing mode to another is a common operation
in layout. This helper improves readability.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D272824
We have `IsColSubgrid()` and `IsRowSubgrid()`. Masonry layout should have
similar convenience helpers.
Move `IsMasonry(LogicalAxis)` from `nsIFrame` into `nsGridContainerFrame` for
two reasons:
1. There are no external callers, and having it in grid container frame removes
the need to assert that the caller is a grid container.
2. `IsColSubgrid()` and `IsRowSubgrid()` depend on it.
Differential Revision: https://phabricator.services.mozilla.com/D272987