This is a preparatory refactor for a follow-up commit that introduces a new
flag (for absolutely positioned children). Using a bit-flag enum makes call
sites self-documenting and lets us add more orthogonal options without
expanding the parameter list.
No behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D299915
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
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
layout/forms/HTMLSelectEventListener.cpp:739:23 [-Wdeprecated-this-capture] implicit capture of 'this' with a capture default of '=' is deprecated
layout/generic/nsFlexContainerFrame.cpp:3796:18 [-Wdeprecated-this-capture] implicit capture of 'this' with a capture default of '=' is deprecated
layout/generic/nsFlexContainerFrame.cpp:3802:18 [-Wdeprecated-this-capture] implicit capture of 'this' with a capture default of '=' is deprecated
layout/style/FontFaceImpl.cpp:466:5 [-Wdeprecated-this-capture] implicit capture of 'this' with a capture default of '=' is deprecated
Differential Revision: https://phabricator.services.mozilla.com/D281489
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
Also rename the writing mode param of SynthesizeBOffsetFromInnerBox
from aWM to aCBWM to make it clearer that it should be the writing
mode of the containing block, not the inner frame.
This fixes the incorrectly-synthesized flex-item baseline in
grid-baseline-001-ref.html, which was causing the test to show
a spurious failure.
Differential Revision: https://phabricator.services.mozilla.com/D279229
Having all that duplicated code is kinda useless, since append needs to
deal with insert anyways due to things like `::after` and
`display: contents`. This fixes the issue by virtue of this check:
https://searchfox.org/firefox-main/rev/aee7c0f24f488cd7f5a835803b48dd0c0cb2fd5f/layout/base/nsCSSFrameConstructor.cpp#7009
Which is really what's going on. IsValidSibling is wrong and can go.
Instead let WipeContainingBlock* deal with it, since we run that after
constructing the items.
This unlocks further simplifications but seems like a step in the right
direction and I don't want to get too side tracked into rewriting the
frame constructor.
The fieldset frame change mirrors table captions. Legends are dealt with
properly by the existing check in ConstructFramesFromItemList and / or
WipeContainingBlock. That allows to remove some special cases in
nsFlexContainerFrame and InspectorUtils.
Differential Revision: https://phabricator.services.mozilla.com/D277777
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
No need to reposition views during layout and so on, now that we don't
use views for either popups nor subdocuments.
No need for nsView to have parent / sibling / children either.
Differential Revision: https://phabricator.services.mozilla.com/D271205
For bug 1994673 we need to cascade AlignSelf as JustifySelf and vice
versa. This is a lot easier if the types are shared.
For justify-items we can't right now because of the `legacy`
shenanigans, which really sucks. I'll try to find a solution for that.
Maybe we should just clobber the legacy value.
Differential Revision: https://phabricator.services.mozilla.com/D268866
With this patch moves `AbsoluteContainingBlock` into `mozilla` namespace, we
could remove `mozilla::` qualifiers in the header.
Differential Revision: https://phabricator.services.mozilla.com/D266558
No behavior change, but this saves some per-child work and conceptually
is the right thing to do. HidesContent() is non-trivial.
Add an assertion to make sure we don't enter BuildDisplayListForChild
at all if content is hidden.
I audited all the callers, and the ones I didn't touch can't have
content-visibility (things like the viewport / pages / etc).
Differential Revision: https://phabricator.services.mozilla.com/D265956
This removes the implementation of nsHTMLButtonControlFrame, instead
reusing nsBlockFrame + align-content (or the relevant display type for
flex / grid / columns / etc).
This matches what Blink does and, for the most part, it is trivial.
It requires moving some special cases around, and override inline flow
display, tho so that buttons don't suddenly start fragmenting in the
inline axis.
It adds a tiny fix for a writing-mode mismatch in
nsBlockFrame::AlignContent(), covered by
layout/reftests/writing-mode/1138356-1-button-contents-alignment.html
containing-block-change-button tests are tweaked to avoid overflowing
the 600px viewport from WPT reftests causing scrollbar fuzziness.
contain-layout-baseline-005.html removes the <select> element just like
https://chromium-review.googlesource.com/c/chromium/src/+/5479489
removed the <button>s, since they align the same now, added a test for
that.
Differential Revision: https://phabricator.services.mozilla.com/D257149
This patch adds logs at the beginning of `Reflow()` and
`ComputeIntrinsicISize()` for both flex and grid container frames. These logs
are useful when debugging nested flex/grid container scenarios in Pernosco, such
as Bug 1966450.
To enable the flex and grid logging:
```
MOZ_LOG="GridContainer:5,FlexContainer:5" ./mach run path/to/test
```
Differential Revision: https://phabricator.services.mozilla.com/D254755
... In addition to previous parameters, we need access to the positioned
frame, as well as the containing block's size (If we're in reflow).
Differential Revision: https://phabricator.services.mozilla.com/D249625
This reverts commit ec57e25d89.
Revert "Bug 1923961: Adjust WPT expectations. r=firefox-style-system-reviewers,emilio"
This reverts commit f2612695a7.
Revert "Bug 1923961: Resolve anchor() in calc(). r=firefox-style-system-reviewers,emilio"
This reverts commit b206c5264b.
Revert "Bug 1923961: Initial implementation of anchor lookup for anchor(). r=firefox-style-system-reviewers,emilio"
This reverts commit 56c17701c5.
Revert "Bug 1923961: Make `nsLayoutUtils::GetRectRelativeToFrame` take in const ptrs. r=firefox-style-system-reviewers,emilio"
This reverts commit 34fb773837.
Revert "Bug 1923961: Pass the new AnchorPosResolutionParams to servo side. r=firefox-style-system-reviewers,emilio"
This reverts commit 73477e3296.
Revert "Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio"
This reverts commit 8461579472.
Revert "Bug 1923961: Expose `AnchorSide` to C++. r=firefox-style-system-reviewers,boris"
This reverts commit 7ecbb38056.
... In addition to previous parameters, we need access to the positioned
frame, as well as the containing block's size (If we're in reflow).
Differential Revision: https://phabricator.services.mozilla.com/D249625
This reverts commit f94a0ccf5a.
Revert "Bug 1923961: Adjust WPT expectations. r=firefox-style-system-reviewers,emilio"
This reverts commit e3e24626a3.
Revert "Bug 1923961: Resolve anchor() in calc(). r=firefox-style-system-reviewers,emilio"
This reverts commit a21f60c569.
Revert "Bug 1923961: Initial implementation of anchor lookup for anchor(). r=firefox-style-system-reviewers,emilio"
This reverts commit daaa53a9ce.
Revert "Bug 1923961: Make `nsLayoutUtils::GetRectRelativeToFrame` take in const ptrs. r=firefox-style-system-reviewers,emilio"
This reverts commit c1db75e7fc.
Revert "Bug 1923961: Pass the new AnchorPosResolutionParams to servo side. r=firefox-style-system-reviewers,emilio"
This reverts commit e0f8f99c69.
Revert "Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio"
This reverts commit adc70f8493.
Revert "Bug 1923961: Expose `AnchorSide` to C++. r=firefox-style-system-reviewers,boris"
This reverts commit b917ffcec6.
... In addition to previous parameters, we need access to the positioned
frame, as well as the containing block's size (If we're in reflow).
Differential Revision: https://phabricator.services.mozilla.com/D249625