`percentage-height-quirk-excludes-flex-grid-003.html` is adapted from
`percentage-height-quirk-excludes-flex-grid-001.html`. The first subtest (column
flex container) exercises this patch. Specifically, it ensures that the
percentage height of the `.pct` element does not resolve. The second (row flex
container) and third subtest (grid) do not change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D290007
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
Most of the deleted code was to handle the fact that `FromUnresolved`
returned `auto` which got mapped afterwards. Now we just return zero.
Differential Revision: https://phabricator.services.mozilla.com/D276906
Reuse the `anchor-center` check code, that checks for the validity of default
anchor, and reuse the `position-area` resolution logic, where `auto` values get
mapped to 0 at resolution time.
Differential Revision: https://phabricator.services.mozilla.com/D276905
This reverts commit 6e861d0db3.
Revert "Bug 2006402: Use physical axes for flagging anchor-center use. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio"
This reverts commit 56907edbce.
Revert "Bug 2006402: Remove anchor-center flags in reflowinput. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"
This reverts commit 3d67a1059f.
Revert "Bug 2006402: Ensure that we override auto insets/margins only when there's position-area/anchor-center + valid default anchor. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"
This reverts commit 8e1950452f.
Most of the deleted code was to handle the fact that `FromUnresolved`
returned `auto` which got mapped afterwards. Now we just return zero.
Differential Revision: https://phabricator.services.mozilla.com/D276906
Reuse the `anchor-center` check code, that checks for the validity of default
anchor, and reuse the `position-area` resolution logic, where `auto` values get
mapped to 0 at resolution time.
Differential Revision: https://phabricator.services.mozilla.com/D276905
Remove auto margin resolution in both axes for an abspos frame in
`ReflowInput::InitAbsoluteConstraints()`. Auto margins are now resolved in
`AbsoluteContainingBlock::ResolveAutoMarginsAfterLayout()` after the frame’s
size is known.
Note: the old code in `InitAbsoluteConstraints()` makes the `autoBSize`
non-negative. This patch ports that behavior to make the `stretchFitSize`
non-negative as well, which fixes additional wpts.
Differential Revision: https://phabricator.services.mozilla.com/D275371
Delete legacy XXX comments. It is true that we always compute the inline-size in
`nsIFrame::ComputeSize()`. However, we compute the offsets in the containing
block's writing mode. In orthogonal flow, the inline-size in containing block's
writing mode is the block-size of `mFrame`, which might still be unconstrained.
Note: changing `iSizeIsAuto` to `computedSize.ISize(cbwm)` could introduce test
failures in
`testing/web-platform/tests/css/css-position/position-absolute-table-001.html`,
because the table wrapper always has `auto` width/height, but
`nsTableWrapperFrame::ComputeAutoSize()` can resolve a definite width/height,
which acts as min-width/min-height. So the offsets are only correct when we
resolve them after reflowing the table.
Differential Revision: https://phabricator.services.mozilla.com/D275369
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
This is needed for certain cases with table layout that happen to bypass our
codepaths that would otherwise resolve 'stretch' closer to the point-of-use.
So, this patch makes us resolve 'stretch' a bit more eagerly here.
I'm including a testcase (expanded from the testcase in the bug report)
that has 'stretch' applied to various table parts, to give us code-coverage
for these scenarioos.
The correctness checks in the testcase are kinda trivial (and would generally
pass whether or not the 'stertch' keyword is supported), since table layout
already forces table-parts to stretch, generally. So, the point of the test is
mostly to give us some basic code coverage to ensure that we behave reasonably
when this keyword (and its aliases like -webkit-fill-available) are used in
this context.
Differential Revision: https://phabricator.services.mozilla.com/D272732
`AxisPolarityFlipped()` returns the negation of
`WritingMode::ParallelAxisStartsOnSameSide()`. It is sufficient to keep one
implementation in `WritingMode` and port the shortcut in
`ParallelAxisStartsOnSameSide()`.
Differential Revision: https://phabricator.services.mozilla.com/D272826
We need to do this in order to avoid hitting nsIFrame::ComputeISizeValue's call
to 'AsLengthPercentage()' with 'stretch' (which is not a LengthPercentage);
that triggers an abort right now.
The new code in nsIFrame::ComputeISizeValue is the proximal band-aid here, but
that isn't sufficient for correctness, because it relies on knowing the
computed margin, border, and padding; and we might not yet have the correct
values stashed on the frame, as mentioned in a code-comment in this patch. We
do have the resolved margin/border/padding available up the stack in the
callsite in ReflowInput.cpp, though (the callsite in this bug's backtrace) --
so this patch eagerly resolves 'stretch' at that point, so that
nsIFrame::ComputeISizeValue doesn't need to bother handling it.
This patch also updates nsContainerFrame::ComputeSize to match the
corresponding chunk of nsIFrame::ComputeSize (just adding some code to handle
'stretch' there). This is needed to get the correct answer on a few of the
cases in the included WPT. (We had a code-comment noting that we should do
this, but we didn't previously have any tests where it would make a
difference. Now we do - hooray!)
Differential Revision: https://phabricator.services.mozilla.com/D272730
... So that we can store default anchor related data for a reflow to use for
determining if we need to compensate for scroll.
Differential Revision: https://phabricator.services.mozilla.com/D266466
... So that we can store default anchor related data for a reflow to use for
determining if we need to compensate for scroll.
Differential Revision: https://phabricator.services.mozilla.com/D266466
This reverts commit 63d8614128.
Revert "Bug 1987963: Ensure that we can roll back to previous normal position when we give up on finding fallbacks. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"
This reverts commit 0685b925e3.
Revert "Bug 1987963: Find and reflow affected positioned frames when a frame becomes/stops being a scroll container. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"
This reverts commit 9b3130e442.
Revert "Bug 1987963: Apply default scroll offset on scroll. r=layout-reviewers,tnikkel,jwatt"
This reverts commit 878edfaa95.
Revert "Bug 1987963: Compute and cache compensating for scroll state of anchor positioned elements. r=jwatt"
This reverts commit e83f5939e3.
Revert "Bug 1968745: Keep track of default anchor and its nearest scrollers. r=layout-anchor-positioning-reviewers,layout-reviewers,jwatt,emilio"
This reverts commit f47abb0c30.
Revert "Bug 1968745: Pass short-lived cache into anchor resolution. r=jwatt"
This reverts commit 045b5b1cb3.
Revert "Bug 1987961: Stop taking scroll offset into account during anchor positioning offset resolution. r=jwatt"
This reverts commit 11ea3d17d5.
... So that we can store default anchor related data for a reflow to use for
determining if we need to compensate for scroll.
Differential Revision: https://phabricator.services.mozilla.com/D266466
`AdjustReflowInputAsContainingBlock` and
`GetContainingBlockAdjustedForScrollbars()` does the same thing, except the
former adjusts the `ReflowInput` parameter.
I assume the adjustment of `ReflowInput` is not really needed if we pass the
testcase `layout/reftests/bugs/844178.html` added in bug 844178.
Differential Revision: https://phabricator.services.mozilla.com/D268305
When calculating hypothetical position with the viewport as absolute containing
block, we can use the containing block size passing into ReflowInput instead of
getting the computed size from viewport's ReflowInput. This makes the viewport
ReflowInput adjustment unnecessary (the code just before creating the abspos
child's Reflowinput), so we can remove it.
Differential Revision: https://phabricator.services.mozilla.com/D268304
Previously, when the block container was in reflow, we get the size from
absolute containing block's reflow input. That works in most cases (because the
two often coincide) but is conceptually wrong when they differ.
This patch computes the border-box size from the information returned from
`GetHypotheticalBoxContainer()` instead.
Differential Revision: https://phabricator.services.mozilla.com/D268302