We fail some because we right now we have a track pseudo for meter/progress.
I plan to fix this, but a lot of these frame classes are basically copy-pasta,
so I wanted to get rid of them first.
Differential Revision: https://phabricator.services.mozilla.com/D192097
Add a simple getter for the color interpolation method with is stored on
each of the structs in the union. This just makes it easier to get.
Differential Revision: https://phabricator.services.mozilla.com/D192105
Previously, if an element was blocking a :has next-sibling match gets deleted,
even if the sibling next to the deleted element would now match, we'd discard
that possibility.
Differential Revision: https://phabricator.services.mozilla.com/D192089
There are cases where we can run a selector match to realize that some DOM mutations
will not make a difference in the relative selector match state, which avoids
O(n^2) behaviour under some circumstances.
Differential Revision: https://phabricator.services.mozilla.com/D191307
This is slightly more efficient as invalidations are added after duplicates have been removed.
We will be running some matching that we definitely do not want to run on duplicates.
Differential Revision: https://phabricator.services.mozilla.com/D191305
UnparsedValue:substitute_variables now gets the writing mode and quirks
mode from the computed context, rather than as arguments.
Custom properties still need to be passed in, because
AnimationValue::from_declaration optionally includes extra custom
properties when calling UnparsedValue:substitute_variables.
Depends on D191615
Differential Revision: https://phabricator.services.mozilla.com/D191616
This should cause no change in behavior, but only because because
Cascade::apply_prioritary_properties is not yet called after font-*
declarations have been processed and before registered custom properties
are computed (see bug 1856522).
Depends on D191614
Differential Revision: https://phabricator.services.mozilla.com/D191160
Now that the custom properties context includes the computed context,
some other fields have been made redundant and can be removed (see
D191161).
Depends on D191613
Differential Revision: https://phabricator.services.mozilla.com/D191159
The stylist is kept in order to avoid needing to unwrap it each time a
stylist is used.
Because a computed context is always required to make a custom
properties builder, cascade_custom_properties_with_context is renamed to
cascade_custom_properties (and the previous cascade_custom_properties,
which did not require a computed context, is removed).
Differential Revision: https://phabricator.services.mozilla.com/D191613
We have ArcSelectorList for selector-lists that are cheap to copy.
For bug 1859915 and related, what we're going to end up doing is probably
expanding into the SelectorList of the parent rule unconditionally, at least
for the "single bare &" case.
It'd be nice to unify SelectorList implementations as preparation for that, and
make them cheaper to clone in general.
My proposal is making SelectorList a tagged pointer to either a single
selector, or to a ThinArc, effectively preserving the SmallVec<> optimization
we have now. This patch implements that proposal.
Depends on D191361
Differential Revision: https://phabricator.services.mozilla.com/D191362
I'm going to use it to have a single-item SelectorList and a Selector be
represented the same way in memory, see incoming patch.
Differential Revision: https://phabricator.services.mozilla.com/D191361
This changes -moz-bool-pref from @supports to @media, bringing various
improvements:
* @media (-moz-bool-pref) properly reacts to dynamic changes.
* We no longer need to parse chrome:// stylesheets in the main thread
(-moz-bool-pref was the only thing that forced us to do that).
This makes privileged and non-privileged stylesheets more similar.
Differential Revision: https://phabricator.services.mozilla.com/D191196
When colors are converted to sRGB to render onto the display, make sure
that they are within sRGB gamut limits.
Gamut mapping is implemented according to:
https://drafts.csswg.org/css-color-4/#gamut-mapping
The color-mix-non-srgb-001 test is checking the expected result in
sRGB, which happens to be out of gamut limits, but because the test
is for color-mix and not gamut mapping, I changed the expected
results to the color space of the mix.
Differential Revision: https://phabricator.services.mozilla.com/D191083
This matches the behavior of other browsers (in fact, I filed [1] about
it long time ago).
This avoids a bunch of overhead in some speedometer subtests. Makes me a
bit sad because I still think our approach is slightly more correct per
spec, but not worth the performance cost.
[1]: https://github.com/w3c/csswg-drafts/issues/2263
Differential Revision: https://phabricator.services.mozilla.com/D190705
Currently Firefox properly performs validation of an @property rule, as
defined in [1]. However when such a rule is invalid, it only does not
register the custom property instead of dropping the whole rule. Other
implementations also follow that aproach and existing web platform tests
disagree with the specification [2].
This patch aligns Firefox's behavior with the specification, by moving
@property validation during parsing and dropping invalid rules. Tests
are updated as follows:
1. /css/css-properties-values-api/at-property-cssom.html
Existing tests that don't have the three descriptors (syntax,
inherit, initial-value) are invalid and now the test verifies
no corresponding rules are exposed via CSSOM. `--no-initial-value`
is renamed `--no-initial-color-value` and its legacy tests are
kept for a new @property `--no-initial-universal-value` which uses
the universal syntax (so initial value is optional). Some dummy
descriptors are added for --tab\ttab so that it remains valid.
Similarly, we ensure --valid-whitespace's syntax (space-separated)
and initial-value (comma-separated) agree.
2. /css/css-properties-values-api/at-property.html
Existing `test_descriptor()` tests are trying an @property with
a single specified descriptor and so are always invalid. To work
around that, we tweak `test_descriptor()` so that it can build a
valid descriptor instead. The `syntax` and `inherits` fallback
to universal and true respectively while the `initial-value`
descriptor is built from the `syntax`. An extra parameters is
introduced in case the caller wants to provide these values
directly. Finally, when the expected value is null the function
instead verifies that the rule is really dropped.
2.1. Some existing syntax tests are registering rules with unquoted
syntax value 'red', 'rgb(255, 0, 0)', 'color', 'foo | bar' and
expect to obtain a rule with an empty syntax string, suggesting some
kind of invalidity handling (cf similar tests). We interpret the
first two as "specifying a color value", quotes are added and the
first one actually becomes a valid custom-ident. The last two already
have a similar quoted version, so we just interpret them as
"missing quotes".
2.2. Given the previous 'red' custom-ident, we add tests for invalid
custom-ident as defined in [3].
2.3. Some existing `syntax` tests are checking that we must have
"pipe between components" and no "leading bar" and are again expecting
a rule with an empty syntax string. We fix the apparent mistake of
missing quotes and provide initial values that could potentially be
interpreted as correct by implementations accepting these invalid
syntaxes.
2.4. One `initial-value` test is checking "var(--x)" but that is
not computationally independent so tweak the test to check that
makes the @property rule invalid. Also add a similar '3em' test
mentioned in the spec.
2.5. Some `inherits` tests verify that invalid rules are interpreted
as false. It seems they should instead be treated as if it does not
exist and so should make the @property rule invalid.
[1] https://drafts.css-houdini.org/css-properties-values-api-1/#at-property-rule
[2] https://github.com/w3c/css-houdini-drafts/issues/1098
[3] https://drafts.csswg.org/css-values-4/#custom-idents
Differential Revision: https://phabricator.services.mozilla.com/D190444
D190382 replaces ValueComponent with a specified types specialization of
a generic type. D190383 specializes the new GenericValueComponent for
computed types.
The goal here is to no longer use Self as the ToComputedValue computed
value of ValueComponent.
Differential Revision: https://phabricator.services.mozilla.com/D190382
Use the same system colors there rather than bespoke ones. That allows
us to simplify the CSS, remove macOS-specific system colors, and also
fix this bug.
Differential Revision: https://phabricator.services.mozilla.com/D190460
Now that we have a DocumentState type we can be a bit less explicit
(before this used EventStates, so the extra Document in the names was
useful).
Differential Revision: https://phabricator.services.mozilla.com/D190602