This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.
This change also introduces said UA styles.
Differential Revision: https://phabricator.services.mozilla.com/D304450
This reverts commit 739a225b8a.
Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"
This reverts commit 4b7b2a4083.
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.
This change also introduces said UA styles.
Differential Revision: https://phabricator.services.mozilla.com/D304450
This reverts commit 6b8775f47f.
Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"
This reverts commit e3529d76f3.
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.
This change also introduces said UA styles.
Differential Revision: https://phabricator.services.mozilla.com/D304450
This reverts commit b434b10988.
Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"
This reverts commit e92bda8433.
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.
This change also introduces said UA styles.
Differential Revision: https://phabricator.services.mozilla.com/D304450
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.
This change also introduces said UA styles.
Differential Revision: https://phabricator.services.mozilla.com/D304450
As we don't make the attributes part of the key. If we get sharing
across elements with these we can't really prove that they use the same
attributes / end up with the same style.
We could make the element style itself part of the cache key but that
seems also a bit sketchy.
Differential Revision: https://phabricator.services.mozilla.com/D301278
This will make being more granular with cloning easier, and we don't
need it after the previous patch.
This leaves DeclarationBlock only for the style attribute for now, we
need it for the AttrStyles stuff. But I plan to move that to
MiscContainer instead or so.
Differential Revision: https://phabricator.services.mozilla.com/D300052
They never inherit anything (except background, but that is a no-op
because viewport inherits from nullptr, which is the initial style).
It seems in the past we relied on recomputing some of this for direction
propagation or so, according to the comments, but that's definitely no
longer true.
Also the comment about needing overflow: auto is wrong, because we've
since always created scrollbars for the root (and avoided reframes).
Similarly, the assertion about viewport is kinda unnecessary. It was
introduced in:
https://hg.mozilla.org/mozilla-central/rev/8fd06045940a05d56d833a0488262fe2279d3702
But since then we always skip fixup for all anon boxes anyways, and
specify display: block explicitly.
Differential Revision: https://phabricator.services.mozilla.com/D293710
We're already matching all @starting-style rules during regular
matching, and we're just ignoring them and adding a flag.
Instead, keep them and filter them during the cascade. This is more
similar to what we'd need to do for an @appearance-base container rule,
and simplifies other things as well.
For that, introduce a RuleCascadeFlags (which for now is just a single
bit), and keep that in the CascadePriority (maybe we should call that
something else, RuleCascadeInfo or something?).
Differential Revision: https://phabricator.services.mozilla.com/D287776
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
This introduces infrastructure to invalidate stuff based on CascadeData
mutations.
For now we only use it for `@position-try`, in the future it might be
worth expanding it to `@keyframes` and even moving our existing selector
invalidation infrastructure there, so that we can more accurately
invalidate.
Differential Revision: https://phabricator.services.mozilla.com/D277424
We already do this for [<dashed-ident> || <try-tactic>] values, but currently
try to pass position-area values through to functions that need it in an effort
to avoid creating a new ComputedValues for this case. Unfortunately we're not
passing it through to all the places that need it, and doing so would be very
messy.
Removal of the current code that passes position-area values will come in a
later patch.
Differential Revision: https://phabricator.services.mozilla.com/D274931
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706