This patch computes the author-specified properties during the CSS cascade, and
removes the complex rule-tree-based implementation that tries to do the cascade
again.
This changes behavior in two ways, one of them which is not observable to
content, I believe:
* revert now re-enables the native styling. This was brought up in
https://github.com/w3c/csswg-drafts/issues/4777 and I think it is a bug-fix.
This is observable to content, and I'm adding a test for it.
* We don't look at inherited styles from our ancestors when `inherit` is
specified in a non-author stylesheet. This was introduced for bug 452969 but
we don't seem to inherit background anymore for file controls or such. It
seems back then file controls used to have a text-field.
I audited forms.css and ua.css and we don't explicitly inherit
padding / border / background-color into any nested form control.
We keep the distinction between border/background and padding, because the later
has some callers. I think we should try to align with Chromium in the long run
and remove the padding bit.
We need to give an appearance to the range-thumb and such so that we can assert
that we don't call HasAuthorSpecifiedRules on non-themed stuff. I used a new
internal value for that.
Differential Revision: https://phabricator.services.mozilla.com/D67722
--HG--
extra : moz-landing-system : lando
We have this optimization where, for non-generic structs, we generate just a
clone / move as the ToComputedValue / ToResolvedValue implementation.
This moves the optimization a bit further down, and refines it so that we still
generate all the relevant where clauses that make it sound, that is, that all
the ToComputedValue implementations of the fields return the same type.
Otherwise this wouldn't be sound and the type would need to become generic.
We add an escape hatch (no_field_bound) for fields that need to be cloned but
which don't implement the trait. This is right now only for the RefPtr<> in the
shared font-family list, and a piece of code in PaintWorklet which looks kinda
fishy, and probably should be fixed (but we don't ship it in Firefox and there's
a pre-existing FIXME for servo, so I punted on it for now).
The other thing this patch does is adding a bunch of ToComputedValue /
ToResolvedValue implementations that are trivial and were missing.
Differential Revision: https://phabricator.services.mozilla.com/D67913
--HG--
extra : moz-landing-system : lando
Per the spec it shouldn't match, and the front-end has been bitten by this
multiple times.
Differential Revision: https://phabricator.services.mozilla.com/D68213
--HG--
extra : moz-landing-system : lando
Rename fill_idx to fill_start, to indicate it is not a single value but a
range. Also change a numeric_limits<>::max() involving the fill_start to use
decltype() to ensure its type matches that of the auto-generated structure's
field, while we're touching that code.
The test to ensure only a single repeat value is allowed will be removed by a
later commit.
Differential Revision: https://phabricator.services.mozilla.com/D60929
--HG--
extra : moz-landing-system : lando
Rename fill_idx to fill_start, to indicate it is not a single value but a
range. Also change a numeric_limits<>::max() involving the fill_start to use
decltype() to ensure its type matches that of the auto-generated structure's
field, while we're touching that code.
The test to ensure only a single repeat value is allowed will be removed by a
later commit.
Differential Revision: https://phabricator.services.mozilla.com/D60929
--HG--
extra : moz-landing-system : lando
This never worked, but it's more visible with the new form controls which have
more padding.
Make the anonymous div and co a pseudo-element, so that they inherit from the
<input> properly in all cases. This works for non-number inputs because the
editor root is a direct child of the <input>, but it doesn't for number inputs
because there's a flex wrapper in between.
This way overflow-clip-box: inherit does what we want. Reset the padding in the
inline direction, as the padding for <input type=number> applies to the arrow
boxes as well, and thus we'd double-apply it.
Differential Revision: https://phabricator.services.mozilla.com/D65271
--HG--
extra : moz-landing-system : lando
It's not ambiguous, and <width> <style> <color> seems like a more common order.
This is just a minor perf tweak, as the CSS parser token cache will most often
kick in to avoid re-tokenizing values.
Also remove a redundant continue statement.
Differential Revision: https://phabricator.services.mozilla.com/D67224
--HG--
extra : moz-landing-system : lando
Expect forced-colors-mode-backplate tests to fail because they were passing for the wrong reason,
and the backplate is now properly applied, causing them to fail.
Remove tests for field and fieldtext from color-valid.html because they are tested again
in system-color-valid.html.
Differential Revision: https://phabricator.services.mozilla.com/D66879
--HG--
extra : moz-landing-system : lando
Expect forced-colors-mode-backplate tests to fail because they were passing for the wrong reason,
and the backplate is now properly applied, causing them to fail.
Remove tests for field and fieldtext from color-valid.html because they are tested again
in system-color-valid.html.
Differential Revision: https://phabricator.services.mozilla.com/D66879
--HG--
extra : moz-landing-system : lando
- Add enum AllowImportRules to CSS parsing.
- `replaceSync()` will skip over @import rules and continue parsing.
- `replace()` will skip over @import rules and continue parsing.
- `insertRule()` will throw a syntax error on @import rules.
- Modify WPT test cases to reflect these changes.
Differential Revision: https://phabricator.services.mozilla.com/D61882
--HG--
extra : moz-landing-system : lando
Other browsers allow this and the spec doesn't really disallow it, so fix it,
add a test and carry on.
Differential Revision: https://phabricator.services.mozilla.com/D65107
--HG--
extra : moz-landing-system : lando
This is probably an old-ish bug made more frequent by the font loading
optimizations.
PostRebuildAllStyleData is a bit of a misnomer, but was always calling
ClearCachedData() on the style set, even if we weren't guaranteed to restyle
every element.
This means both wasted work and correctness issues (as the "uses <rare-feature>"
bits are cleared during this call, on the assumption that we'll then visit all
elements and that'd recompute it properly).
For now, unify a bit the different code paths and only clear these bits if we're
guaranteed to restyle all elements.
I should rename this to something better in a follow-up, and ideally also
decouple the ClearCachedData() calls a bit...
Differential Revision: https://phabricator.services.mozilla.com/D65740
--HG--
extra : moz-landing-system : lando
This should be less confusing. This is not supported outside of chrome:// or
user-agent stylesheets so we can name this however we want.
Differential Revision: https://phabricator.services.mozilla.com/D65605
--HG--
extra : moz-landing-system : lando
I think this should work for the animation throttling stuff.
Opacity works on the element tree, so I think this is sound.
Differential Revision: https://phabricator.services.mozilla.com/D64441
--HG--
extra : moz-landing-system : lando
Removing unused arguments and so on.
The origin can always be inferred from the stylesheet so it wasn't being used.
Differential Revision: https://phabricator.services.mozilla.com/D64150
--HG--
extra : moz-landing-system : lando
Removing unused arguments and so on.
The origin can always be inferred from the stylesheet so it wasn't being used.
Differential Revision: https://phabricator.services.mozilla.com/D64150
--HG--
extra : moz-landing-system : lando
This used to be needed for Gecko interop, but now all this is in the Rust side
so we no longer need it.
Depends on D63861
Differential Revision: https://phabricator.services.mozilla.com/D63863
--HG--
extra : moz-landing-system : lando
The heuristic is that we show focus outlines for unknown or key focus, and not
for mouse / touch.
This is probably not the final heuristic we take, but this allows people to play
with it and file bugs.
Once this is mature enough we should remove :-moz-focusring in favor of
:focus-visible.
Differential Revision: https://phabricator.services.mozilla.com/D63861
--HG--
extra : moz-landing-system : lando
This used to be needed for Gecko interop, but now all this is in the Rust side
so we no longer need it.
Depends on D63861
Differential Revision: https://phabricator.services.mozilla.com/D63863
--HG--
extra : moz-landing-system : lando
The heuristic is that we show focus outlines for unknown or key focus, and not
for mouse / touch.
This is probably not the final heuristic we take, but this allows people to play
with it and file bugs.
Once this is mature enough we should remove :-moz-focusring in favor of
:focus-visible.
Differential Revision: https://phabricator.services.mozilla.com/D63861
--HG--
extra : moz-landing-system : lando
This also fixes some backwards logic in nsBlockFrame::ReflowDirtyLines, and adds
some static assertions to nsGenericHTMLElement that almost cause a very subtle
bug.
Depends on D63792
Differential Revision: https://phabricator.services.mozilla.com/D63793
--HG--
extra : moz-landing-system : lando
* Use debug_unreachable for really unreachable code (having a release
unreachable!() there gives us little to no benefit, as a borked union can
already confuse us into reading an arbitrary pointer as a CalcPercentage).
* Avoid a clone of the calc variant when clamping. We only need to mutate the
clamping mode. This was the only clamp_to_non_negative function that didn't
consume the value.
Differential Revision: https://phabricator.services.mozilla.com/D63584
--HG--
extra : moz-landing-system : lando