This doesn't clean up as much as a whole, but it's a step in the right
direction. In particular, it allows us to start using simple bindings for:
* Filters
* Shapes and images, almost. Need to:
* Get rid of the complex -moz- gradient parsing (let
layout.css.simple-moz-gradient.enabled get to release).
* Counters, almost. Need to:
* Share the Attr representation with Gecko, by not using Option<>.
* Just another variant should be enough (ContentItem::{Attr,Prefixedattr},
maybe).
Which in turn allows us to remove a whole lot of bindings in followups to this.
The setup changes a bit. This also removes the double pointer I complained about
while reviewing the shared UA sheet patches. The old setup is:
```
SpecifiedUrl
* CssUrl
* Arc<CssUrlData>
* String
* UrlExtraData
* UrlValueSource
* Arc<CssUrlData>
* load id
* resolved uri
* CORS mode.
* ...
```
The new one removes the double reference to the url data via URLValue, and looks
like:
```
SpecifiedUrl
* CssUrl
* Arc<CssUrlData>
* String
* UrlExtraData
* CorsMode
* LoadData
* load id
* resolved URI
```
The LoadData is the only mutable bit that C++ can change, and is not used from
Rust. Ideally, in the future, we could just use rust-url to resolve the URL
after parsing or something, and make it all immutable. Maybe.
I've verified that this approach still works with the UA sheet patches (via the
LoadDataSource::Lazy).
The reordering of mWillChange is to avoid nsStyleDisplay from going over the
size limit. We want to split it up anyway in bug 1552587, but mBinding gains a
tag member, which means that we were having a bit of extra padding.
One thing I want to explore is to see if we can abuse rustc's non-zero
optimizations to predict the layout from C++, but that's something to explore at
some other point in time and with a lot of care and help from Michael (who sits
next to me and works on rustc ;)).
Differential Revision: https://phabricator.services.mozilla.com/D31742
--HG--
extra : moz-landing-system : lando
This should be an idempotent patch. The way to come up with this patch has been:
* Run the first script attached to the bug and pipe it to xclip, then paste it
in color.rs
* Add the relevant #[derive] annotations and remove the color.mako.rs
definition.
* Reorder the values to match the ColorID definition, on which some widget
prefs and caching stuff relies on.
* Manually port some documentation from nsLookAndFeel.h
* Run `rg 'eColorID_' | cut -d : -f 1 | sort | uniq >files`
* Run the second script attached to the bug.
* Manually fix usage of `LAST_COLOR` (adding the `End` variant), and adding
casts to integer as needed.
* Add an static assert so that people remember to update the prefs, rather than
a comment on the definition :)
Differential Revision: https://phabricator.services.mozilla.com/D32610
--HG--
extra : moz-landing-system : lando
- Follow Gtk and get theme button text color directly from "button" CSS node instead of "button label"
- Provide new -moz-gtk-buttonactivetext color for active/pressed button text color
- Replace ButtonText color with -moz-gtk-buttonactivetext when it's appropriate
Differential Revision: https://phabricator.services.mozilla.com/D30566
--HG--
extra : moz-landing-system : lando
This includes style system and layout update. I add 3 extra reftests
because the original tests use ray() function as the offset-path, but we
don't support it. It'd be better to add tests using a different type of
offset-path.
The spec issue about the serialization:
https://github.com/w3c/fxtf-drafts/issues/340
Differential Revision: https://phabricator.services.mozilla.com/D32212
--HG--
extra : moz-landing-system : lando
D29542 fixed the bogus checks that was making nested pseudo-elements match
author rules. This adds tests and ends up being just a cleanup, though as it
turns out we it also fixes an issue with ::slotted() matched from
Element.matches.
Differential Revision: https://phabricator.services.mozilla.com/D27529
--HG--
extra : moz-landing-system : lando
This makes *|*::marker do the intended thing in UA sheets, so I think it's
better, and it's a bit less special-casey.
We may want to re-introduce the changes for pseudo-elements at some point,
depending on the WG decision, but this patch makes each_non_document_style_data
consistent with the rule collector.
The changes of each_non_document_style_data on their own should fix some bugs,
but it doesn't because:
* This is only hit for pseudos that allow user-action-state pseudo-classes.
* The containing shadow check worked for them anyway.
* We don't allow any pseudo after ::slotted() or that isn't tree-abiding per
the CSS specs (we should maybe enable one of the moz-range stuff to be
tree-abiding).
So ::placeholder is the only one that right now fits the bill to trigger the
bugs this would fix, but it doesn't since I couldn't make ::placeholder match
:hover / :active / :focus anyhow (inside or outside a shadow tree).
I've left the ProbeMarkerPseudoStyle changes for now since they are technically
a bit more consistent than what was there before, but we could revert those if
they cause trouble, we could rely on the UA rule matching, but we would need to
change that if we allow the ::foo::before and such to match.
Differential Revision: https://phabricator.services.mozilla.com/D29542
--HG--
extra : moz-landing-system : lando
It was introduced in bug 1352096 to reduce complexity with Stylo (apparently).
Right now it doesn't look like it reduces any complexity, and it's a bit
annoying with some of the patches that I'm writing at the moment.
So unless there's any objection I think it should go away.
Differential Revision: https://phabricator.services.mozilla.com/D31708
--HG--
extra : moz-landing-system : lando
This will save us some time from figuring out what's the best thing to do in
bug 1552587, so that other patches I have in flight (mainly bug 1552708) can
land, since we cannot add a single byte to nsStyleDisplay right now otherwise.
The code removed here is well isolated and not that complicated, so it seems to
me that should be easy to bring back should we have an emergency (and I commit
to doing that while preserving the nsStyleDisplay size limit if we need to :)).
Differential Revision: https://phabricator.services.mozilla.com/D32026
--HG--
extra : moz-landing-system : lando
Suppose that `prop` is a property that we haven't supported yet, while its `-moz-prop`
version is already supported.
If an author specifies in a declaration block this property in its standard form
as well as multiple verdor specific forms, as long as `-moz-prop` is specified, we
shouldn't report error for unknown property `prop`. Because that's just noise.
Differential Revision: https://phabricator.services.mozilla.com/D31998
--HG--
extra : moz-landing-system : lando
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
This patch adds SVG geometry properties to CSS, it doesn't deal with
how SVG handles them.
Differential Revision: https://phabricator.services.mozilla.com/D29937
--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
Filters blur(), invert(), etc. can omit argument.
Computed/specified style serialization is a little tricky w.r.t the shortest
serialization principle. Ideally we should serialize `invert(1)` to `invert()`,
but that will be a breaking change, so we always serialize them with an
argument.
Note, Blink/WetKit treat specified (but not computed) style serialization
differently when the specified one is originally without argument. Our
current behavior is the same as pre-Chromium Edge.
Differential Revision: https://phabricator.services.mozilla.com/D31720
--HG--
extra : moz-landing-system : lando