These functions are useful to directly pass already parsed SVG
geometry property to CSS side.
Differential Revision: https://phabricator.services.mozilla.com/D30776
--HG--
extra : moz-landing-system : lando
Unpack StyleMotion and move its members into nsStyleDisplay, use
cbindgen to generate StyleOffsetPath.
Differential Revision: https://phabricator.services.mozilla.com/D31164
--HG--
extra : moz-landing-system : lando
Note that the "loose | normal | strict" values are not yet parsed/implemented.
Differential Revision: https://phabricator.services.mozilla.com/D29817
--HG--
extra : moz-landing-system : lando
Nightly Rust complains thusly:
```
error: the item `AnimationValueMap` is imported redundantly
--> servo/ports/geckolib/glue.rs:629:9
|
104 | use style::properties::animated_properties::{AnimationValue, AnimationValueMap};
| ----------------- the item `AnimationValueMap` is already imported here
...
629 | use style::properties::animated_properties::AnimationValueMap;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D unused-imports` implied by `-D warnings`
```
Remove the local imports to make it happy.
Differential Revision: https://phabricator.services.mozilla.com/D31816
--HG--
extra : moz-landing-system : lando
This method is used when updating the SMIL override style and from Web
Animations' Animation.commitStyles method. By using update we accurately return
false when no change is made to a declaration block.
For SMIL this simply acts as an optimization, meaning we can avoid updating the
SMIL override style ub some cases.
For Animation.commitStyles, however, this allows us to avoid generating
a mutation record. Normally making a redundant change to an attribute *does*
generate a mutation record but the style attribute is different. All browsers
avoid generating a mutation record for a redundant change to inline style.
This is specified in the behavior for setProperty[1] which does not update the
style attribute if updated is false.
[1] https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
Differential Revision: https://phabricator.services.mozilla.com/D30871
--HG--
extra : moz-landing-system : lando
This avoids the expensive conversion, and cleans up a bunch.
Further cleanup is possible, just not done yet to avoid growing the patch even
more.
Differential Revision: https://phabricator.services.mozilla.com/D30748
--HG--
extra : moz-landing-system : lando
We could use ArcSlice if wanted I guess, your call. Though will change is not
supposed to be used very frequently.
Differential Revision: https://phabricator.services.mozilla.com/D30548
--HG--
extra : moz-landing-system : lando
This is just a refactor in the right direction. Eventual goal is:
* All inherited properties use ArcSlice<>.
* All reset properties use OwnedSlice<> (or ThinVec<>).
No conversion happens at all, so we can remove all that glue, and also
compute_iter and co.
Of course there's work to do, but this is a step towards that.
Differential Revision: https://phabricator.services.mozilla.com/D30127
--HG--
extra : moz-landing-system : lando
This avoids the expensive conversion, and cleans up a bunch.
Further cleanup is possible, just not done yet to avoid growing the patch even
more.
Differential Revision: https://phabricator.services.mozilla.com/D30748
This is just a refactor in the right direction. Eventual goal is:
* All inherited properties use ArcSlice<>.
* All reset properties use OwnedSlice<> (or ThinVec<>).
No conversion happens at all, so we can remove all that glue, and also
compute_iter and co.
Of course there's work to do, but this is a step towards that.
Differential Revision: https://phabricator.services.mozilla.com/D30127
These functions are useful to directly pass already parsed SVG
geometry property to CSS side.
Differential Revision: https://phabricator.services.mozilla.com/D30776
--HG--
extra : moz-landing-system : lando
We destroy them manually, so it's the right thing to do.
This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:
* Remove the hack that replaced all nsStrings for nsStringReprs.
* Remove ns{,C}StringRepr (followup)
* Add members with destructors to the style structs (you see where I'm going :)).
Differential Revision: https://phabricator.services.mozilla.com/D30450
--HG--
extra : moz-landing-system : lando
We destroy them manually, so it's the right thing to do.
This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:
* Remove the hack that replaced all nsStrings for nsStringReprs.
* Remove ns{,C}StringRepr (followup)
* Add members with destructors to the style structs (you see where I'm going :)).
Differential Revision: https://phabricator.services.mozilla.com/D30450
--HG--
extra : moz-landing-system : lando
As I said over bug 1549593, the eventual goal is to use ArcSlice in all
inherited properties. But this seemed like a good first candidate that doesn't
require me to move around a lot more code, since we were already using cbindgen
for the path commands.
Differential Revision: https://phabricator.services.mozilla.com/D30134
--HG--
extra : moz-landing-system : lando
This enables destructors for tagged unions in cbindgen, implemented in:
* https://github.com/eqrion/cbindgen/pull/333
Which allow us to properly generate a destructor for the cbindgen-generated
StyleBasicShape (which now contains an OwnedSlice).
For now, we still use the glue code to go from Box<BasicShape> to
UniquePtr<BasicShape>. But that will change in the future when we generate even
more stuff and remove all the glue.
I could add support for copy-constructor generation to cbindgen for tagged
enums, but I'm not sure if it'll end up being needed, and copy-constructing
unions in C++ is always very tricky.
Differential Revision: https://phabricator.services.mozilla.com/D29769
--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
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
We don't have lossy currentcolor in the style system anymore, except for a
single property -moz-font-smoothing-background-color.
I could've converted it into a proper StyleColor and thread down all the
necessary information to the font metrics code.
But it doesn't really seem worth it given it's not exposed to the web, so I just
did the simplest thing, which is making currentcolor compute to transparent to
that specific property.
This patch also removes the stores_complex_colors_lossily code and related,
since now we always can cache computed colors.
Differential Revision: https://phabricator.services.mozilla.com/D26187
--HG--
extra : moz-landing-system : lando
We don't have lossy currentcolor in the style system anymore, except for a
single property -moz-font-smoothing-background-color.
I could've converted it into a proper StyleColor and thread down all the
necessary information to the font metrics code.
But it doesn't really seem worth it given it's not exposed to the web, so I just
did the simplest thing, which is making currentcolor compute to transparent to
that specific property.
This patch also removes the stores_complex_colors_lossily code and related,
since now we always can cache computed colors.
Differential Revision: https://phabricator.services.mozilla.com/D26187
--HG--
extra : moz-landing-system : lando
That is, change all uses of StyleComplexColor to just StyleColor.
Differential Revision: https://phabricator.services.mozilla.com/D25977
--HG--
rename : layout/style/StyleComplexColor.cpp => layout/style/StyleColor.cpp
rename : layout/style/StyleComplexColor.h => layout/style/StyleColorInlines.h
extra : moz-landing-system : lando
This is the last step to be able to call matchMedia on display: none iframes.
This is green, except for some startup preference query tests that I'm going to
address in a blocking bug (making LangGroupFontPrefs global, basically).
The setup is similar to the ShadowRoot one, except we don't eagerly keep the
StyleSet around up-to-date, we only fill it if it ever had a pres context.
Differential Revision: https://phabricator.services.mozilla.com/D23903
--HG--
extra : moz-landing-system : lando
To be more similar between Rust and C++. This introduces GenericFontFamily and
exposes that plus FontFamilyNameSyntax to C++, using that where appropriate
instead of plain uint8_t as we were doing.
As a follow-up, as discussed on IRC with Jonathan, we can remove the -moz-fixed
family, and turn it just into an alias of Monospace.
The only non-trivial change is the MatchType changes, but they're ok I think.
The code already assumed at most one CSS generic, and the struct still takes 8
bits. I've verified that the relevant tests are passing (though try is closed).
Differential Revision: https://phabricator.services.mozilla.com/D24272
--HG--
extra : moz-landing-system : lando
To be more similar between Rust and C++. This introduces GenericFontFamily and
exposes that plus FontFamilyNameSyntax to C++, using that where appropriate
instead of plain uint8_t as we were doing.
As a follow-up, as discussed on IRC with Jonathan, we can remove the -moz-fixed
family, and turn it just into an alias of Monospace.
The only non-trivial change is the MatchType changes, but they're ok I think.
The code already assumed at most one CSS generic, and the struct still takes 8
bits. I've verified that the relevant tests are passing (though try is closed).
Differential Revision: https://phabricator.services.mozilla.com/D24272
--HG--
extra : moz-landing-system : lando
This depends on https://github.com/eqrion/cbindgen/pull/308. Other than that,
this should be ready to go.
There's still a bit more magic than what I'd like to eventually. I should be
able to make cbindgen not rename types if it doesn't know about them, or
something.
But this removes most of the manual binding function implementations (all but
the ones that are declared via macros, which cbindgen doesn't see across).
I need to give up on the _Drop functions taking an Owned<T> because of
instantiation order fiasco. In order to define DefaultDelete I need Owned to be
complete, but I cannot do it after including the generated file since some
declarations already instantiate the specialization. Oh well.
Differential Revision: https://phabricator.services.mozilla.com/D24798
--HG--
rename : servo/components/style/cbindgen.toml => servo/ports/geckolib/cbindgen.toml
extra : moz-landing-system : lando
This avoids having to support storing refcounted URLValue objects in shared memory,
which would be tricky.
Depends on D17183
Differential Revision: https://phabricator.services.mozilla.com/D17184
--HG--
extra : moz-landing-system : lando
UA style sheets only ever specify a single generic font family in font-family
properties, so we pre-create a unique, static SharedFontList for each generic
and change the representation of FontFamilyList to be able to refer to them
by their generic ID. This avoids having to share refcounted SharedFontList
objects across processes.
Depends on D17182
Differential Revision: https://phabricator.services.mozilla.com/D17183
--HG--
extra : moz-landing-system : lando
Each user agent style sheet has a unique URLExtraData object containing
its URL, but since they are refcounted objects, we can't share them
easily across processes. Rather than adding support for copying them
into a shared memory buffer like we will do with the Rust objects, here
we just set up a static array of URLExtraData objects per UA style
sheet. The array will be filled in in a later patch.
Rust UrlExtraData objects, once they are transformed into their
sharable form and copied into the shared memory buffer, will reference
them by an index.
Depends on D17181
Differential Revision: https://phabricator.services.mozilla.com/D17182
--HG--
extra : moz-landing-system : lando
And make them actually sound. We're defining functions on Rust-land that get
structs as arguments, but declaring them in C++ as getting pointers.
This is another step in order to be able to autogenerate ServoBindings.h and
remove bindings.rs altogether.
We remove FooOwned in favor of Owned<Foo>, which is generated via cbindgen.
It'd be good to actually mark Owned and such as MOZ_MUST_USE_TYPE, so I sent
https://github.com/eqrion/cbindgen/pull/307 for that.
Differential Revision: https://phabricator.services.mozilla.com/D24681
--HG--
extra : moz-landing-system : lando
And make them actually sound. We're defining functions on Rust-land that get
structs as arguments, but declaring them in C++ as getting pointers.
This is another step in order to be able to autogenerate ServoBindings.h and
remove bindings.rs altogether.
We remove FooOwned in favor of Owned<Foo>, which is generated via cbindgen.
It'd be good to actually mark Owned and such as MOZ_MUST_USE_TYPE, so I sent
https://github.com/eqrion/cbindgen/pull/307 for that.
Differential Revision: https://phabricator.services.mozilla.com/D24681
--HG--
extra : moz-landing-system : lando
This reduces a lot the boilerplate that's needed in order to add simple binding
functions.
This starts using &Foo and Option<&Foo> instead, and as a result we need to
remove the servo_function_signatures test, which is a bit unfortunate.
I think it's worth though, this causes problems on some platforms (see bug
1534844), and messing up the functions signature is not something that I've ever
seen (other than bug 1308234, which already had all the FooBorrowed mess which
I'm removing).
Also, cbindgen understands references and Option<&Foo>, so it will be the way to
go in the future.
After this patch we can also remove HasSimpleFFI, but I've kept it for now since
I still use it in a few places, and this patch is quite big on its own.
Differential Revision: https://phabricator.services.mozilla.com/D24092
--HG--
extra : moz-landing-system : lando
On the sender side of transactions, we have to convert the individual transforms
to the proper types in layers::Animations, and this includes SetAnimatable and
the definition in LayersMessages.
On the compositor side (i.e. received side of transactions). Basically, we
convert the list of layers::Animation into a list of `PropertyAnimationGroup`,
which is an intermediate value. And then use this list to do interpolation for
each property in `SampleAnimationForEachNode`, which will return a list of
`RefPtr<RawServoAnimationValue>`.
Depends on D23062
Differential Revision: https://phabricator.services.mozilla.com/D22565
--HG--
extra : moz-landing-system : lando
And rename the constants to not be prefixed by TOUCH_ACTION_, since that's part
of the type name anyway.
Differential Revision: https://phabricator.services.mozilla.com/D23413
--HG--
extra : moz-landing-system : lando
So we can let KeyframeEffect::ContainsAnimatedScale check individual
transforms, which is used by ActiveLayerTracker.
Depends on D19631
Differential Revision: https://phabricator.services.mozilla.com/D19525
--HG--
extra : moz-landing-system : lando
This is more consistent with what the Rust bits of the style system do, and
removes a pointer from ComputedStyle which is always nice.
This also aligns the Rust bits with the C++ bits re. not treating xul pseudos as
anonymous boxes. See the comment in nsTreeStyleCache.cpp regarding those.
Can't wait for XUL trees to die.
Depends on D19001
Differential Revision: https://phabricator.services.mozilla.com/D19002
--HG--
extra : moz-landing-system : lando