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
We resolve calc expressions and use appropriate units by computing
ToComputedValue trait, computing each component's value, then converting
it back to that component's type, before making a new VariableValue from
the computed value's CSS string to store in the computed properties map.
Differential Revision: https://phabricator.services.mozilla.com/D190254
<forgiving-selector-list> uses <any-value>, which uses
<declaration-value>, which forbids some bad tokens, so our behavior is
correct.
Add a test for this.
Differential Revision: https://phabricator.services.mozilla.com/D190497
In order to convert a computed value whose syntax descriptor contains a
multiplier to a string, we need to keep track of what multiplier each
list has.
Differential Revision: https://phabricator.services.mozilla.com/D190251
After bug 1840478, non-inherited custom properties using their initial
values are represented as absent from `ComputedCustomProperties` in
order to save memory. Wherever the values of such properties are
requested, it is necessary to fallback to any registered initial value.
However, this makes difficult to properly enumerate custom properties
for exposure via the `CSSStyleDeclaration.item()` API and indeed our
current implementation only exposes the properties actually present in
`ComputedCustomProperties`.
Additionally, such a representation conflicts with pre-existent
representation of guaranteed-invalid values as absent values, causing
some issues e.g. bad handling of invalid at computed-value time [1] [2].
This patch changes `ComputedCustomProperties` so that registered initial
values are always stored in the `non_inherited` map, immediately fixing
the issue with `CSSStyleDeclaration.item()` and preparing follow-up
work on guaranteed-invalid values.
To avoid excessive increase of memory usage, the `non_inherited` map
becomes ref-counted. The associated Stylist contains an up-to-date
ComputedCustomProperties with registered custom properties that have
initial values, and the `non_inherited` map can generally just be
shallow-cloned from it.
A new test `get-computed-style-enumeration.html` is added to make sure
custom properties are correctly exposed when enumerating
`CSSStyleDeclaration` as a list. A similar but more restricted version
already exists: `cssstyledeclaration-registered-custom-properties.html`.
Two test cases are also added to `determine-registration.html` in order
to cover some issue previously detected during the review of
`get_custom_property_initial_values`.
[1] https://drafts.csswg.org/css-variables-2/#invalid-at-computed-value-time
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1855946
Differential Revision: https://phabricator.services.mozilla.com/D189999
Just give up applying them.
It's better than crashing and if you're over 65k declarations applying
to the same element I think we're on our right to ignore you :)
Differential Revision: https://phabricator.services.mozilla.com/D190120
Per spec, if no reference box is specified, the border-box will be used as
reference box.
Therefore, if the author doesn't specify the reference-box, or specifies
border-box, we shouldn't serialize it.
Differential Revision: https://phabricator.services.mozilla.com/D189973
Per the spec issue: https://github.com/w3c/csswg-drafts/issues/8695,
we should convert the position components into `<length-percentage>` for
the specified values of `at <position>`, for basic shapes.
Also, update shape-outside/values/support/parsing-utils.js a little bit
to make sure we convert the absolute length into px if it is in `calc()`, for
the specified values. And remove calc() if possible for computed values.
Differential Revision: https://phabricator.services.mozilla.com/D188780
We can use Arc::make_mut for writes so that the inherited properties are
lazily cloned when needed, and simplify a bit the code while at it.
If make_mut is somehow too expensive we can optimize it further.
Differential Revision: https://phabricator.services.mozilla.com/D189833
We need to jump to an element in the correct scope just like ::slotted()
does.
Factor that code to its own function both so that it's easier to reason
about and so that the code for that function remains small. At the end
of the day other combinators like descendant or sibling get executed a
ton of times (while pseudo-elements only jump once).
Differential Revision: https://phabricator.services.mozilla.com/D189478
In bug 1840478, two follow-up TODO questions were left in
substitute_references_in_value_and_apply regarding handling of CSS
keywords such as 'unset'. For non-inherited custom properties, we don't
need to put any value in the map of computed properties when that value
is the initial one, so just remove it. For inherited custom properties,
we could probably do the same when that value is the inherited one and
postpone actually deep cloning the inherited map at the end of the
build method. Comment is updated to refer to bug 1855887 instead.
Differential Revision: https://phabricator.services.mozilla.com/D189740
Just the CSS property; not hooked up to any rendering behavior yet.
Currently this is implemented as a simple longhand `text-wrap` property,
but we'll want to rename it to `text-wrap-style` when we update white-space
to be a shorthand and introduce white-space-collapse, text-wrap-mode, etc.
The 'pretty' value is omitted as we have no immediate plans to implement it.
Initially, 'auto' and 'stable' will behave identically, although 'auto' could
change in future once we have higher-quality algorithms available.
Differential Revision: https://phabricator.services.mozilla.com/D187543
The effective zoom from the scroll container gets inherited onto the
scrollbars, triggering caching assertions.
Luckily, we don't depend on font metrics to render scrollbars, so we can
just ignore it like we ignore font-family and lang differences.
Differential Revision: https://phabricator.services.mozilla.com/D189673
The CSS Properties and Values API allows to register CSS properties that
can be either inherited or non-inherited, and which can also have
initial values specified [1].
In [2], the representation of computed value for custom properties was
changed to a pair of CustomPropertiesMaps: one map which is ref-counted
(for properties unregistered or registered as inherited) and one which
is not (for properties registered as non-inherited). The latter map
is currently always None (i.e. all custom properties are handled as
inherited) and several parts of the code assume this condition holds.
This patch instead ensures that values for custom properties on a node
are properly placed in the inherit or non_inherit map according to the
inherits flag. Initial values for registered properties are taken
into account and missing implementations of functions assuming
non_inherited==None is completed.
In order to minimize the size of the maps, absent values for
non-inherited properties are interpreted as initial values during var
substitution or retrieval of computed values (for non-inherited
properties). This is used for `unset` and `initial` keywords while
a copy of the parent's value is used for `inherit`.
Last but not least, `CustomPropertiesBuilder` tries to perform lazy
copy of the inherited style, postponing actual deep clone when
necessary or falling back to a shallow copy when possible [3].
This is generalized a bit when the document contains custom properties
registered as non-inherited and current optimizations are preserved as
is for pages containing only non-registered custom properties. This
could be further improved later [4].
[1] https://drafts.css-houdini.org/css-properties-values-api-1/
[2] https://hg.mozilla.org/mozilla-central/rev/8a7d9524a1b9
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1840478
[4] https://bugzilla.mozilla.org/show_bug.cgi?id=1855887
Differential Revision: https://phabricator.services.mozilla.com/D188812
Just the CSS property; not hooked up to any rendering behavior yet.
Currently this is implemented as a simple longhand `text-wrap` property,
but we'll want to rename it to `text-wrap-style` when we update white-space
to be a shorthand and introduce white-space-collapse, text-wrap-mode, etc.
The 'pretty' value is omitted as we have no immediate plans to implement it.
Initially, 'auto' and 'stable' will behave identically, although 'auto' could
change in future once we have higher-quality algorithms available.
Differential Revision: https://phabricator.services.mozilla.com/D187543
Implement it as a 16-bit fixed-point value to avoid growing the
ComputedStyle object.
Modify the computed value of absolute lengths directly, as that's how it
works in other implementations (this sucks, see impending spec issues).
This doesn't implement the getComputedStyle / CSSOM APIs unzooming and
so on just yet, at least.
Differential Revision: https://phabricator.services.mozilla.com/D188862
Just the CSS property; not hooked up to any rendering behavior yet.
Currently this is implemented as a simple longhand `text-wrap` property,
but we'll want to rename it to `text-wrap-style` when we update white-space
to be a shorthand and introduce white-space-collapse, text-wrap-mode, etc.
The 'pretty' value is omitted as we have no immediate plans to implement it.
Initially, 'auto' and 'stable' will behave identically, although 'auto' could
change in future once we have higher-quality algorithms available.
Differential Revision: https://phabricator.services.mozilla.com/D187543
Performance results pending, but this shouldn't hurt utf-8 atomization
at all, and it should also make utf-16 atomization potentially cheaper.
So sending for review under the assumption that perf numbers will look
good.
Differential Revision: https://phabricator.services.mozilla.com/D189021
The CSS Properties and Values API allows to register CSS properties that
can be either inherited or non-inherited, and which can also have
initial values specified.
Stylo currently implements efficient inheritance of classical CSS
variables (inherited, guaranteed-invalid initial value) by using
a ref-counted CustomPropertiesMap in the cascade. Such a map
contains computed values differing from the parent (or default)
style. For non-inherited properties, the computed value is
instead generally the initial value and only inherits the
computed value from the parent if explicitly specified on the node.
This patch converts the computed value for custom properties into a
pair of maps CustomPropertiesMap, one map which is ref-counted
(containing inherited custom properties) and one which is not
(containing non-inherited properties). The code is refactored to
continue to deal with the `inherited` map of the pair and behavior
is unchanged. A follow-up patch will modify the code to deal the
`non-inherited` map too.
Additionally, two different structs are used to represent the pair
of maps. A mutable version MutableCustomProperties used when
building the computed style and an immutable version
ComputedCustomProperties used during subsequent substitutions of
var/env in other properties. As an improvement to the current code,
the ref-counted map is actually represented as a UniqueArc for
the MutableCustomProperties instead of an Arc.
[1] https://drafts.css-houdini.org/css-properties-values-api-1/
Differential Revision: https://phabricator.services.mozilla.com/D188727
`at <position>` is optional value and we should omit it if author doesn't
specify it, for all basic-shape functions, and ray().
Note that there is a related interpolation issue [1] if one of the end values
doesn't specify `at <position>`. We didn't address this issue in this patch.
[1] https://github.com/w3c/csswg-drafts/issues/9068
Also, this updates the devtool code to give it the default value, "50% 50%",
for circle() and ellipse() if `at <position>` is not specified.
Differential Revision: https://phabricator.services.mozilla.com/D181918
If there are 2 or more "big" CPUs then use the number of big CPUs as
the number of threads. If there are fewer than 2 then use the number
of big plus the number of "medium".
Currently this only affects android, as hal::GetHeterogeneousCpuInfo
is not implemented on other platforms.
Differential Revision: https://phabricator.services.mozilla.com/D188480
1. We should omit `mask-image` if it is the initial value and there are
any other properties which are not initial values.
2. We should omit `mask-origin` if it is the initial value.
3. Tweak the order of `<masking-mode>`, which should be the last one per spec.
Differential Revision: https://phabricator.services.mozilla.com/D188545
* Lazily calculate changed states and classes when processing pending state & attribute invalidations
* Avoid constructing empty `SmallVec` invalidations when we know there is no invalidation
Differential Revision: https://phabricator.services.mozilla.com/D188733
Implemented support for fallback values in CSS attr():
`attr(<attr-name>, <attr-fallback>)`
Full syntax supported as of this rev:
`[namespace? `|`]? ident [`,` fallback]?`
Spec: https://drafts.csswg.org/css-values-5/#attr-notation
Also added a new WPT reftest for attr fallback without a type,
and some new attr serialization WPTs (namespace and fallback).
Differential Revision: https://phabricator.services.mozilla.com/D176801
This is not _quite_ the thing that the spec asks for, but it's more
correct than what we're doing.
What we were doing before this patch was a poor man's version of this
that didn't deal with shadow DOM.
Differential Revision: https://phabricator.services.mozilla.com/D188324
This is not _quite_ the thing that the spec asks for, but it's more
correct than what we're doing.
What we were doing before this patch was a poor man's version of this
that didn't deal with shadow DOM.
Differential Revision: https://phabricator.services.mozilla.com/D188324
Some appearance values are really just a background.
Being able to draw them using `background-image` instead of appearance
allows us to preserve borders, etc.
Differential Revision: https://phabricator.services.mozilla.com/D187851
Now that we have a proper defined order for these properties, this
uncovered an issue where we were relying on the relative order of the
SMIL override (font-size in this case) and presentational hints
(-x-text-scale), so that the first one got zoomed and then unzoomed to
arrive with the right font-size.
Instead first un-zoom, then apply stuff normally.
MANUAL PUSH: Trivial-ish fix CLOSED TREE.
Instead of cascade groups, track the position in the declaration list of
the small-ish number of prioritary properties, and apply them
out-of-band.
This reduces the amount of cascade groups we need, and makes the amount
of times we need to iterate over the declarations constant.
The DeclarationIndex set-up (having to track the relevant declarations
as needed) is a bit annoying, but is needed to deal with `revert` and
`revert-layer` without exponential time complexity.
Differential Revision: https://phabricator.services.mozilla.com/D188274
Invalidating a relative selector requires traversal in the opposite direction of
the usual invalidation, i.e. In the directions of ancestor and/or earlier sibling.
However, when there are complex selectors within the relative selector, e.g.
`:has(:is(..) ..)`, we first need to perform invalidation in the usual direction to
reach the relative selector's search space, then perform the relative selector
invalidation.
There are two major changes to this effect:
1. `InvalidationProcessor` has an additional lifetime that separates matching context from
invalidations. This enables storing encountered dependencies (Since we may be in a deep recursion
during the invalidation) to be relative selector invalidated, without requiring that the
matching context live that long.
2. There now exists a separate category for relative selector invalidation depenedencies,
which triggers relative selector invalidation. Dependencies now can be either normal or
relative, since any complex selector inside a relative selector would have normal
dependencies, but with its outer dependency being a relative dependency.
Differential Revision: https://phabricator.services.mozilla.com/D185675
Invalidating a relative selector requires traversal in the opposite direction of
the usual invalidation, i.e. In the directions of ancestor and/or earlier sibling.
However, when there are complex selectors within the relative selector, e.g.
`:has(:is(..) ..)`, we first need to perform invalidation in the usual direction to
reach the relative selector's search space, then perform the relative selector
invalidation.
There are two major changes to this effect:
1. `InvalidationProcessor` has an additional lifetime that separates matching context from
invalidations. This enables storing encountered dependencies (Since we may be in a deep recursion
during the invalidation) to be relative selector invalidated, without requiring that the
matching context live that long.
2. There now exists a separate category for relative selector invalidation depenedencies,
which triggers relative selector invalidation. Dependencies now can be either normal or
relative, since any complex selector inside a relative selector would have normal
dependencies, but with its outer dependency being a relative dependency.
Differential Revision: https://phabricator.services.mozilla.com/D185675
To increase the integration between color and calc it is nescessary to
vendor the current cssparser-color library into Gecko where all the calc
functionality lives.
Differential Revision: https://phabricator.services.mozilla.com/D188216
The root cause here is that percentages when mixed with lengths don't
compare / simplify, because the basis might be negative (bug 1709018),
so PartialOrd returns None for them.
When parsing a plain percentage / resolving to a percentage however, we
do want them to resolve. The regressing bug broke that because min > max
etc would effectively return false.
Differential Revision: https://phabricator.services.mozilla.com/D187974
When the progress is 100%, the result from the original formula of calculating
`left_weight` may not be 0 exactly (i.e. approximate zero, e.g. -2.22e-16), and
so this imprecision makes the recomposed Matrix3D have some approximate zeros.
Those approximate zeros (e.g. `_m13` is 2e-16, and `_m23` is 8e-17 in WPT)
make us failed to treat this Matrix3D as a 2D matrix when we serializing it
(because we use `!= 0.0f` to check if the matrix components are not equal to
zero in `Matrix4x4::Is2D()`, and other places).
Differential Revision: https://phabricator.services.mozilla.com/D187814
This undoes bug 1835681, adjusting for changes that happened since then,
because the crates don't build with the real bitflags 2, and there are
some challenges to make them work with the real bitflags 2.
Differential Revision: https://phabricator.services.mozilla.com/D187748
Computed value-time validation for fallback values is added in a later
patch.
Bug 1852360 is opened for computed value-time validation for properties
that contain references.
Differential Revision: https://phabricator.services.mozilla.com/D186997
Basically, if two normalized direction vectors are the same, we do
interpolation on the angle only. However, after normalization, there may
be some differences because of the floating-point precision, even though
these two vectors have the same direction. Therefore we have to add an
tolerance when comparing them.
Differential Revision: https://phabricator.services.mozilla.com/D187153
The implementation is uglier than it needs to be. We basically need to
override the GTK styles for the window decorations with the desired
radius.
This is because of two reasons:
* Adwaita on gtk3 doesn't provide a bottom corner radius.
* Even if it did we couldn't reasonably query it, see comment 4.
So in order for stuff to look sensible we need to make sure that we and
GTK agree on what radius to use. Using the titlebar radius makes sense
here.
Differential Revision: https://phabricator.services.mozilla.com/D187343
This avoids uselessly rewinding the parser for single-keyword display
values, and generally makes the code easier to follow.
Differential Revision: https://phabricator.services.mozilla.com/D187431
Basically, quaternion vectors make sense only when the rotation is within
(-360deg, 360deg). If its angle is larger than or equal to 360deg, its
direction may be different, so we have to tweak the conversion.
Also, tweak the code of interpolation for rotate3D to match the spec and
put more comments there.
Differential Revision: https://phabricator.services.mozilla.com/D186998
We keep these functions because we used them for compositor animations before
merging stylo. Now we always use the equivalent rust version for all the
transform interpolation, on both the main thread and the compositor thread.
Differential Revision: https://phabricator.services.mozilla.com/D187072
This fixes the incorrect result when negating a clamp() where the min value is greater than max.
Added some extra tests to clamp-length-computed.html; the last example fails in Gecko without
the patch here.
Differential Revision: https://phabricator.services.mozilla.com/D187113
This is not standard, and we don't use it internally (some chrome
stylesheets use it tho).
In the past this pseudo-class was more useful because it matched the
state for which <img> elements used an inline, but that's no longer
true, see bug 1196668 and co.
Depends on D186938
Differential Revision: https://phabricator.services.mozilla.com/D186939
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.
Differential Revision: https://phabricator.services.mozilla.com/D186938
The old code was basically doing string copies that are totally
redundant, in a not-very performant way too.
This was from the time where stylo had to live with the old style
engine, and there's no need to keep the copy around anymore.
Differential Revision: https://phabricator.services.mozilla.com/D186974
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.
Differential Revision: https://phabricator.services.mozilla.com/D186938
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.
Differential Revision: https://phabricator.services.mozilla.com/D186938
- Remove the use of pow when not needed.
- Use rust built in to_radians/to_degrees.
- Use more accurate white point values.
- Make the code clearer in places.
Differential Revision: https://phabricator.services.mozilla.com/D187029
The default color interpolation method is detected during parse time.
The equality with the specified method is stored on the gradient and
then during serialization the method is omitted if it was the default.
Differential Revision: https://phabricator.services.mozilla.com/D185492
Also, add a prefernce for content-box and stroke-box. So we have to
define a new type, TransformBox, and let content-box and stroke-box
behind the preference.
Differential Revision: https://phabricator.services.mozilla.com/D185363
This makes it cheaper to copy the nsAttrValue, which improves innerHTML times on Speedometer
because it reduces the time spent creating and destroying valueForAfterSetAttr.
It will also make it possible to reuse eAtomArray values across elements.
This patch adds a copying operation in AllocClassMatchingInfo which is needed
now that the MiscContainer's mValue.mAtomArray is immutable. This is a bit
unfortunate: In the past, this was doing one atom array allocation, and now
it's doing two; one during parsing and one during the copy. However, I would
expect that most calls to getElementsByClassName only supply a single class
name and not a set of space-separated class names, but I haven't measured it.
If this copy turns out to make things slower, we can probably avoid it by
adding a way to parse a string into an AtomArray directly without going
through nsAttrValue.
Before: https://share.firefox.dev/3DAhLzm
After: https://share.firefox.dev/456TMTM
Differential Revision: https://phabricator.services.mozilla.com/D183810
CSS rules were storing absolute rather than relative line numbers (this
was done to match the old style system).
So when we hit the cached inline stylesheet code-path, for which we
share the CSS rules of the stylesheet, for the cache hit the line
numbers were completely off.
This particular page was probably regressed by bug 1834081, but the
issue could happen before with Shadow DOM.
Always store relative numbers and convert to absolute when asked by the
inspector, rather than the other way around.
This is simpler and makes the cache work.
Differential Revision: https://phabricator.services.mozilla.com/D185916
Later spec change specifies that the serialized value always has one input and
one output entries for each linear stop entry, so specified and computed values
no longer have any difference.
Get rid of prefs for WPT too, since they're default-enabled on on channels.
Differential Revision: https://phabricator.services.mozilla.com/D186021
In layout, we build a default `path("m 0 0")` for now. We will implement
it later.
Besides, we don't support compositor animations for `url()`, so we don't
have to serialize it for IPC.
Note:
`<url>` includes `url()` and `src()`. For now we only support `url()`.
We should revisit `src()` in Bug 1845390.
Differential Revision: https://phabricator.services.mozilla.com/D184429