Converting the NS_STYLE_BORDER definitions in to enumerated classes as
per bug 1277133.
The original constants broke the convention used by the rest of the
definitions as the CSS property being described is `border-collapse`,
so corrections were made with the migration to the enumerated class.
Differential Revision: https://phabricator.services.mozilla.com/D29951
--HG--
extra : moz-landing-system : lando
Additionally, this sorts out the order of member variables for minimizing the
instance size.
And also this changes `enum RenderFlags` to `enum class RenderingStateFlags`.
Differential Revision: https://phabricator.services.mozilla.com/D29312
--HG--
extra : moz-landing-system : lando
Disabled for now of course. This should be pretty uncontroversial I'd think.
Differential Revision: https://phabricator.services.mozilla.com/D28060
--HG--
extra : moz-landing-system : lando
We always include the combinator for pseudo-elements now (not including it was
just an optimization) in order to not match when nested pseudo-elements are
involved.
We could add a more generic check in `matches_simple_selector` like:
```
if element.is_pseudo_element() {
match *selector {
Component::PseudoElement(..) |
Component::NonTSPseudoClass(..) => {},
_ => return false,
}
}
```
But even that wouldn't be enough to make selectors like `:hover::marker` not
match on the `::before::marker` pseudo-element, plus that code is really hot.
So for now do the check on the `next_element_for_combinator` function. It's a
bit hacky but it's the best I could came up with...
While at it, simplify some checks to use is_pseudo_element() instead of
implemented_pseudo_element() directly.
Only the Rust patch as-is would make markers for ::before and ::after on list
items not show up, so we also need to switch ::marker to use ProbeMarkerStyle()
rather than ProbePseudoElementStyle(), since the marker should exist even if it
matches no rules.
Differential Revision: https://phabricator.services.mozilla.com/D27529
--HG--
extra : moz-landing-system : lando
I'm going to unconditionally generate the PseudoElement combinator, and this
causes issues since we'll put the raw `::pseudo` selectors in the host bucket,
which is obviously wrong.
Differential Revision: https://phabricator.services.mozilla.com/D27528
--HG--
extra : moz-landing-system : lando
The previous commit removed the dependence on the discriminant value, so we
don't need to keep discriminants different from text-align anymore.
Differential Revision: https://phabricator.services.mozilla.com/D29361
--HG--
extra : moz-landing-system : lando
This doesn't clean up all that much, yet, but it's a step in the right
direction.
Differential Revision: https://phabricator.services.mozilla.com/D29168
--HG--
extra : moz-landing-system : lando
This won't reintroduce any of the regressions that were triggered by our
previous attempts to turn off -moz prefixed gradients, and lets us massively
simplify the gradient code, if it sticks.
Differential Revision: https://phabricator.services.mozilla.com/D29346
--HG--
extra : moz-landing-system : lando
Turns out removing the pseudo-class and such ends up not being quite as trivial
as I initially thought, or possible at all, since the fact that the <symbol> is
a <symbol> is observable via selectors, added a test for that.
Differential Revision: https://phabricator.services.mozilla.com/D29131
--HG--
extra : moz-landing-system : lando
We want to drop the cascade data memory as soon as possible, so bug 1544546
introduced an UpdateStylistIfNeeded call from ShellDetachedFromDocument.
Unfortunately, this call can reenter into the global user-agent cascade data if
some of the CSS values kept alive by the cascade data keep alive an SVG
document, see the stack on this bug for an example. Make sure to drop the
user-agent cascade datas when not holding the cache lock to avoid this
situation.
Before bug 1535788, we just destroyed the stylist, so we kept holding a
reference from the cache, and that reference will be dropped sometime later when
other document updated their user-agent stylesheets (if they happened not to
match the cache of course).
Seems to me this doesn't ended up happening in our automation, but it could
happen in the wild, in theory at least.
It's nice that Rust made this a safe deadlock caught by our tests rather than a
very subtle and infrequent memory corruption.
The relevant SVG documents are probably the <input type=number> rules:
https://searchfox.org/mozilla-central/rev/d80f0a570736dce76a2eb184fb65517462089e8a/layout/style/res/forms.css#1050
Differential Revision: https://phabricator.services.mozilla.com/D28299
--HG--
extra : moz-landing-system : lando
Just one set of stylesheets is enough. While at it, unify SheetType and Origin.
Differential Revision: https://phabricator.services.mozilla.com/D27564
--HG--
extra : moz-landing-system : lando
::slotted() is already weird in the sense that it supports a pseudo-element
afterwards (so ::slotted(*)::before is valid for example).
::part() is weirder because you are supposed to allow stuff like
::part(foo):hover, ::part(foo):hover::before, etc.
In order to avoid making the already-complex parse_compound_selector more
complex, shuffle stuff so that we pass the progress of our current compound
selector around, and is the parsing code for each selector which decides whether
it's ok to parse at the given point.
Differential Revision: https://phabricator.services.mozilla.com/D27158
--HG--
extra : moz-landing-system : lando
Servo already atomizes the counter names, it makes no sense to copy the string
rather than bumping the refcount.
Differential Revision: https://phabricator.services.mozilla.com/D27061
--HG--
extra : moz-landing-system : lando
Some of these were unused, some of them were only used in combination with
others, so I've unified them.
In particular, Forgetful and ClearAnimationOnlyDirtyDescendants were used only
together for a very specific task (the final animation traversal), so I merged
them into something that has that name.
ClearDirtyBits was unused, so I removed along with some code that would no
longer be called.
Differential Revision: https://phabricator.services.mozilla.com/D25454
--HG--
extra : moz-landing-system : lando
No need to build the match body if there are no generics. This should hopefully
save some work too.
Depends on D26289
Differential Revision: https://phabricator.services.mozilla.com/D26290
--HG--
extra : moz-landing-system : lando
I'm going to add a ToResolvedValue, and I don't want to add more copy-pasta.
This shouldn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D26289
--HG--
extra : moz-landing-system : lando