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
Now the default of a color is the modern syntax and converting to legacy
syntax is very explicit.
AbsoluteColor::new can now take u8, f32 and Option<f32> as component
arguments and the flags will be set automagically.
Differential Revision: https://phabricator.services.mozilla.com/D184685