Commit Graph

12857 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
351d40e7c3 Bug 1557430 - Add memory reporters for SVG mapped attribute declarations. r=njn,heycam
These are owned by the element and not referenced from the stylesheets.

They're referenced from the rule tree, but the rule nodes don't measure their
style source (since they're non-owning).

So unconditionally reporting them even though it's a refcounted object is ok.

While at it, remove some other fields from the old style system that are no
longer used.

Differential Revision: https://phabricator.services.mozilla.com/D34014

--HG--
extra : moz-landing-system : lando
2019-06-08 18:58:57 +00:00
Emilio Cobos Álvarez
67c30d05d2 Bug 1557212 - Use cbindgen for gradients. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D33901

--HG--
extra : moz-landing-system : lando
2019-06-07 14:13:17 +00:00
Daniel Varga
fe7dbedf22 Merge mozilla-inbound to mozilla-central. a=merge 2019-06-07 12:50:35 +03:00
Emilio Cobos Álvarez
e2fcdb0253 Bug 1557403 - Handle default angle in radians. r=me
We were not copying the angle in this case for some reason, and I overlooked
this.
2019-06-06 19:30:03 -04:00
Charlie Marlow
29aa4dbb9a Bug 1555863 added text-decoration-width support to style system including mochitests and web platform tests r=emilio
from-font support will be added later

Differential Revision: https://phabricator.services.mozilla.com/D33392

--HG--
extra : moz-landing-system : lando
2019-06-06 17:12:22 +00:00
Emilio Cobos Álvarez
3df59a0cfa Bug 1557110 - Cleanup gradient parsing by removing the simple-moz-gradient parsing pref. r=dholbert
It looks like bug 1547939 will stick, given how fast the other regressions came
in for bug 1337655.

We haven't seen any regression from this, and it seems unlikely that we'd want
this code back.

This blocks further improvements to the style system. Simplifying this code
allows me to remove all the conversion code for gradients.

Let me know if you think it's premature and I'm happy to wait, but I really want
to see this code gone :)

Differential Revision: https://phabricator.services.mozilla.com/D33820

--HG--
extra : moz-landing-system : lando
2019-06-06 04:08:52 +00:00
Daniel Holbert
d9ebfdd4d2 Bug 1556855 part 4: Remove support for the layout.css.prefixes.webkit pref. r=mats
From this point on, the webkit-prefixed CSS features that were previously
protected by this pref will now be unconditionally enabled.

Differential Revision: https://phabricator.services.mozilla.com/D33807

--HG--
extra : moz-landing-system : lando
2019-06-05 18:23:02 +00:00
Charlie Marlow
da73c04156 Bug 1555150: adding support for CSS text underline offset to the style system r=emilio
support  for from-font listed in the CSS spec will be implemented in a later bug

Differential Revision: https://phabricator.services.mozilla.com/D33233

--HG--
extra : moz-landing-system : lando
2019-06-04 22:04:14 +00:00
Coroiu Cristina
b2c75da135 Backed out changeset ba1f75c56457 (bug 1555150) for xpcshell failures at devtools/shared/tests/unit/test_css-properties-db.js 2019-06-04 07:52:50 +03:00
Charlie Marlow
a2861fd11e Bug 1555150: adding support for CSS text underline offset to the style system r=emilio
support  for from-font listed in the CSS spec will be implemented in a later bug

Differential Revision: https://phabricator.services.mozilla.com/D33233

--HG--
extra : moz-landing-system : lando
2019-06-03 19:43:08 +00:00
Emilio Cobos Álvarez
749db71829 Bug 1554150 - Hide some appearance values from content. r=mats
They're not used internally either, so remove all ability to address them.

I haven't removed the implementation yet, as some of them are quite complex, and
I don't have a mac / windows build. We should do that when this hits release
though.

Differential Revision: https://phabricator.services.mozilla.com/D32488

--HG--
extra : moz-landing-system : lando
2019-06-03 17:32:48 +00:00
Emilio Cobos Álvarez
e088b3760a Bug 1555867 - Report heap size of rule tree heap allocations as well. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D33353

--HG--
extra : moz-landing-system : lando
2019-06-03 16:37:53 +00:00
Emilio Cobos Álvarez
afb4bcad28 Bug 1555867 - Inline one child in the rule tree. r=heycam
It is indeed the most common case according to a bit of measurement.

A non-atypical example from GitHub for example:

> Rule tree stats:
>  0 - 340
>  1 - 1403
>  2 - 28
>  3 - 8
>  4 - 2
>  6 - 1
>  7 - 3
>  8 - 2
>  12 - 2
>  14 - 1
>  41 - 1
>  45 - 1
>  67 - 1
>  68 - 1

Differential Revision: https://phabricator.services.mozilla.com/D33351

--HG--
extra : moz-landing-system : lando
2019-06-03 16:37:45 +00:00
Emilio Cobos Álvarez
d34afb7b9d Bug 1555867 - Add some very basic rule tree stats that can be enabled with trace-level logging. r=heycam
This is useful to analyze the shape of the rule tree at a glance.

Differential Revision: https://phabricator.services.mozilla.com/D33350

--HG--
extra : moz-landing-system : lando
2019-06-03 16:37:34 +00:00
Evgeniy Reizner
8e33a62cdd Bug 1556388 - Do not use borrowed types in the selectors::Element trait. r=emilio
This cherry-picks https://github.com/servo/servo/pull/23463 with a few fixes for
the Gecko build.
2019-06-03 09:12:17 -04:00
Emilio Cobos Álvarez
b58cd8f644 Bug 1556388 - Fix Servo build. 2019-06-03 09:12:15 -04:00
Emilio Cobos Álvarez
63da4ebdab Bug 1556388 - Appease tidy. 2019-06-03 09:12:13 -04:00
Emilio Cobos Álvarez
66b65a1241 Bug 1556388 - Rustfmt recent changes. 2019-06-03 09:12:12 -04:00
Cosmin Sabou
bb748896e1 Backed out changeset 118a2ee53436 (bug 1555150) for xpcshell failures on /test_css-properties-db.js. CLOSED TREE 2019-06-01 02:27:33 +03:00
Charlie Marlow
aa48f14906 Bug 1555150: adding support for CSS text underline offset to the style system r=emilio
support  for from-font listed in the CSS spec will be implemented in a later bug

Differential Revision: https://phabricator.services.mozilla.com/D33233

--HG--
extra : moz-landing-system : lando
2019-05-31 21:09:11 +00:00
Emilio Cobos Álvarez
80e62fe4db Bug 1555944 - Make nsIContent::GetBindingParent return an element. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D33308
2019-05-31 23:31:59 +02:00
Emilio Cobos Álvarez
19258bfbb4 Bug 1554716 - Remove nsStyleColor moving the color property to nsStyleText. r=jfkthame
I think this is a good change regardless of other discussion in bug 1552587. If
we decide to move `mColor` to the top-level of the struct that can be done
separately.

Differential Revision: https://phabricator.services.mozilla.com/D32726

--HG--
extra : moz-landing-system : lando
2019-05-31 14:48:22 +00:00
Emilio Cobos Álvarez
0bdeae4db0 Bug 1493420 - followup: Bump max allowed stack size of RuleNode. irc-r=heycam 2019-05-30 02:27:59 +02:00
Emilio Cobos Álvarez
41399e03a6 Bug 1493420 - Use a RwLock'd HashMap instead of a lock-free linked list for rule node children. r=heycam
I need to profile this a bit more, but talos was pretty happy about this, and it
solves the known performance issues here such as the test-case from bug 1483963
for example. This also gets rid of a bunch of unsafe code which is nice.

This still keeps the same GC scheme, removing the key from the hashmap when
needed. I kept those as release assertions, but should probably be turned into
debug-only assertions.

Differential Revision: https://phabricator.services.mozilla.com/D6801

--HG--
extra : moz-landing-system : lando
2019-05-29 23:41:01 +00:00
Emilio Cobos Álvarez
058ea528a4 Bug 1552080 - Rejigger a bit rust features so that rusttests still link. r=froydnj
We cannot compile with just feature(gecko + debug_assertions), since that's how
debug rusttests get compiled and they don't have the refcount logging stuff.

We were getting away with it for the pre-existing usage of the style crate,
because it wasn't used during any test and presumably the linker didn't
complain. But servo_arc is definitely used in tests.

Differential Revision: https://phabricator.services.mozilla.com/D32691
2019-05-29 21:30:52 +02:00
Emilio Cobos Álvarez
bce5af1e30 Bug 1552080 - Add refcount logging to servo_arc. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D32173
2019-05-29 21:30:23 +02:00
Emilio Cobos Álvarez
fce57b44fd Bug 1552878 - Use cbindgen for filters. r=jwatt
Had to implement some OwnedSlice bits that the canvas code used.

Differential Revision: https://phabricator.services.mozilla.com/D31799
2019-05-29 21:22:07 +02:00
Emilio Cobos Álvarez
a384dedd93 Bug 1552708 - Use cbindgen for URIs. r=heycam
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
2019-05-29 21:22:04 +02:00
Boris Chiou
a194573277 Bug 1429303 - Animate offset-rotate. r=birtles
Differential Revision: https://phabricator.services.mozilla.com/D32237

--HG--
extra : moz-landing-system : lando
2019-05-28 18:31:48 +00:00
Emilio Cobos Álvarez
dc948a87d9 Bug 1554433 - Hide -moz-gtk-buttonactivetext from content. r=stransky
This prevents exposing the value to web content.

Differential Revision: https://phabricator.services.mozilla.com/D32611

--HG--
extra : moz-landing-system : lando
2019-05-27 20:25:31 +00:00
Bogdan Tara
30515e505f Backed out changeset 8855dd7a2aa8 (bug 1554433) for browser_parsable_css.js failures CLOSED TREE
--HG--
extra : histedit_source : b19cc175e04aa20eb80e13ded4b36704923849a3
2019-05-27 22:30:32 +03:00
Brindusan Cristian
40a5b04ab5 Backed out 3 changesets (bug 1552708, bug 1552878) for build bustages and compiler issues. CLOSED TREE
Backed out changeset 9d4f178bfcbd (bug 1552878)
Backed out changeset 80db9f845237 (bug 1552708)
Backed out changeset 1bdbfbb5b342 (bug 1552708)
2019-05-27 17:00:03 +03:00
Emilio Cobos Álvarez
a6bdf94e22 Bug 1552878 - Use cbindgen for filters. r=jwatt
Had to implement some OwnedSlice bits that the canvas code used.

Differential Revision: https://phabricator.services.mozilla.com/D31799

--HG--
extra : moz-landing-system : lando
2019-05-27 12:37:37 +00:00
Emilio Cobos Álvarez
c2d1e98f4c Bug 1552708 - Tweak rust tests to account for more compact URL representation. r=bustage
CLOSED TREE
2019-05-27 14:21:17 +02:00
Emilio Cobos Álvarez
f2190857bb Bug 1552708 - Use cbindgen for URIs. r=heycam
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
2019-05-27 11:45:12 +00:00
Emilio Cobos Álvarez
998419a429 Bug 1554433 - Hide -moz-gtk-buttonactivetext from content. r=stransky
This prevents exposing the value to web content.

Differential Revision: https://phabricator.services.mozilla.com/D32611

--HG--
extra : moz-landing-system : lando
2019-05-27 11:25:02 +00:00
Emilio Cobos Álvarez
810916db16 Bug 1554433 - Move system colors to values::specified::color. r=xidorn
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
2019-05-26 13:10:00 +00:00
Emilio Cobos Álvarez
7f9009b15b Bug 1554347 - Fix servo build. 2019-05-25 04:14:38 +02:00
Emilio Cobos Álvarez
104f06a08e Bug 1554347 - Revert a change that ended up not being needed and busts the servo build. 2019-05-25 04:14:36 +02:00
Emilio Cobos Álvarez
393e8c0703 Bug 1554347 - Appease tidy. 2019-05-25 04:14:33 +02:00
Emilio Cobos Álvarez
344f076c16 Bug 1554347 - Reformat recent style system changes. 2019-05-25 04:14:30 +02:00
Jan Andre Ikenmeyer
410911152d Bug 1554347 - Update MPL license to https. r=emilio 2019-05-25 04:14:28 +02:00
Emilio Cobos Álvarez
fc06d4485e Bug 1554347 - Sort derive list to keep tidy shut. 2019-05-25 04:14:25 +02:00
Bastien Orivel
2a7eee8242 Bug 1554347 - Update xml5ever and html5ever. r=npotb 2019-05-25 04:14:23 +02:00
Bastien Orivel
337837b0ce Bug 1554347 - Update darling to 0.9. r=emilio 2019-05-25 04:14:18 +02:00
Martin Stransky
ba6373e9aa Bug 1531338 - [Linux/Gtk] Get and use Gtk theme text color for active/pressed button, r=dao,emilio
- 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
2019-05-24 08:51:48 +00:00
violet
91d759f562 Bug 1553252 - Use cbindgen for text-overflow r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D32285

--HG--
extra : moz-landing-system : lando
2019-05-24 04:48:46 +00:00
Boris Chiou
3b51b642f3 Bug 1429301 - Implement offset-rotate. r=emilio
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
2019-05-24 03:42:03 +00:00
Emilio Cobos Álvarez
980074a5b2 Bug 1544242 - Cleanup selector-matching for nested pseudo-elements, match ::slotted correctly when there's no selector before it, and add tests. r=heycam,mats
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
2019-05-24 01:09:15 +00:00
Dzmitry Malyshau
d3f4d3cc1c Bug 1552549 - Update rand dependency to 0.6 r=kats,froydnj,nika,jkt,jcj
Update rand version in u2fhid and xpcom

Differential Revision: https://phabricator.services.mozilla.com/D31669

--HG--
rename : third_party/rust/scopeguard/.cargo-checksum.json => third_party/rust/scopeguard-0.3.2/.cargo-checksum.json
rename : third_party/rust/scopeguard/Cargo.toml => third_party/rust/scopeguard-0.3.2/Cargo.toml
rename : third_party/rust/scopeguard/README.rst => third_party/rust/scopeguard-0.3.2/README.rst
rename : third_party/rust/scopeguard/examples/readme.rs => third_party/rust/scopeguard-0.3.2/examples/readme.rs
rename : third_party/rust/scopeguard/src/lib.rs => third_party/rust/scopeguard-0.3.2/src/lib.rs
extra : moz-landing-system : lando
2019-05-23 19:54:25 +00:00
Oana Pop Rus
d020804eba Backed out changeset 3304277f5bde (bug 1553252) for build bustages on Windows on a CLOSED TREE 2019-05-23 17:52:21 +03:00
violet
4ab5380719 Bug 1553252 - Use cbindgen for text-overflow r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D32285

--HG--
extra : moz-landing-system : lando
2019-05-23 14:02:17 +00:00
Emilio Cobos Álvarez
f4714d88a1 Bug 1548342 - Fix nested-pseudo-elements matching author rules better. r=heycam
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
2019-05-22 13:28:01 +00:00
Emilio Cobos Álvarez
7874fd4a2d Bug 1552636 - Remove eStyleImageType_URL. r=TYLin
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
2019-05-22 11:34:23 +00:00
Emilio Cobos Álvarez
ca59532ce8 Bug 1553227 - Remove old CSS scroll snap implementation. r=hiro
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
2019-05-21 22:51:54 +00:00
Cosmin Sabou
bdf1d2a559 Backed out changeset a10cdf32fb5a (bug 1552549) for causing a spike in xpcshell failures. CLOSED TREE 2019-05-22 02:05:22 +03:00
Emilio Cobos Álvarez
8f8161be87 Bug 1553245 - Use cbindgen for border-image-width. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D32032

--HG--
extra : moz-landing-system : lando
2019-05-21 21:07:55 +00:00
Dzmitry Malyshau
1298c14a90 Bug 1552549 - Update rand dependency to 0.6 r=kats,froydnj,nika,jkt,jcj
Update rand version in u2fhid and xpcom

Differential Revision: https://phabricator.services.mozilla.com/D31669

--HG--
rename : third_party/rust/scopeguard/.cargo-checksum.json => third_party/rust/scopeguard-0.3.2/.cargo-checksum.json
rename : third_party/rust/scopeguard/Cargo.toml => third_party/rust/scopeguard-0.3.2/Cargo.toml
rename : third_party/rust/scopeguard/README.rst => third_party/rust/scopeguard-0.3.2/README.rst
rename : third_party/rust/scopeguard/examples/readme.rs => third_party/rust/scopeguard-0.3.2/examples/readme.rs
rename : third_party/rust/scopeguard/src/lib.rs => third_party/rust/scopeguard-0.3.2/src/lib.rs
extra : moz-landing-system : lando
2019-05-21 19:36:56 +00:00
violet
6dd273cc7e Bug 1550432 - Do not report error for unknown property if its known moz prefixed version is specified. r=emilio
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
2019-05-21 15:35:41 +00:00
violet
00adbe98b0 Bug 1383650 - Add geometry property support for Servo glue r=emilio
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
2019-05-16 13:21:21 +00:00
violet
30fa1da169 Bug 1383650 - Add SVG geometry property support in CSS r=emilio
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
2019-05-16 13:21:19 +00:00
violet
a052d53ee2 Bug 1383650 - Support AllowQuirks::Always option in helpers.mako.rs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29936

--HG--
extra : moz-landing-system : lando
2019-05-16 13:21:18 +00:00
Boris Chiou
6f268e4980 Bug 1429299 - Part 4: Make offset-distance animatable. r=hiro
Use ComputedValue to animate offset-distance.

Differential Revision: https://phabricator.services.mozilla.com/D30584

--HG--
extra : moz-landing-system : lando
2019-05-20 23:42:56 +00:00
Boris Chiou
ce15d305e2 Bug 1429299 - Part 2: Implement offset-distance. r=emilio
Define the offset-distance property in style system.

Differential Revision: https://phabricator.services.mozilla.com/D30582

--HG--
extra : moz-landing-system : lando
2019-05-20 23:42:52 +00:00
Boris Chiou
718aaf17f9 Bug 1429299 - Part 1: Unpack StyleMotion and use cbindgen for OffsetPath. r=emilio
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
2019-05-20 23:42:50 +00:00
Jonathan Kew
837368bc29 Bug 1011369 - Add parsing of the loose|normal|strict values of the CSS line-break property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D30785

--HG--
extra : moz-landing-system : lando
2019-05-20 20:46:28 +00:00
Jonathan Kew
eb2e0187f1 Bug 1531715 - Implement the CSS line-break property, with values "auto | anywhere". r=emilio
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
2019-05-20 20:46:07 +00:00
Nathan Froyd
33f7f47bf3 Bug 1552919 - remove unneeded AnimationValueMap uses; r=emilio
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
2019-05-20 18:29:41 +00:00
Emilio Cobos Álvarez
c1954c0d3a Bug 1492739 - Unprefix user-select. r=mats
The CSSWG decided that our behavior regarding inheritance is what we want,
see [1].

[1]: https://github.com/w3c/csswg-drafts/issues/3344

Differential Revision: https://phabricator.services.mozilla.com/D11585

--HG--
extra : moz-landing-system : lando
2019-05-17 02:43:59 +00:00
Brian Birtles
2f6180dd9e Bug 1253476 - Use update() to update declarations from Servo_DeclarationBlock_SetPropertyToAnimationValue; r=emilio
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
2019-05-20 05:22:39 +00:00
Brian Birtles
65f06d35fe Bug 1253476 - Implement Animation.commitStyles; r=boris,emilio,bzbarsky,smaug
Differential Revision: https://phabricator.services.mozilla.com/D30327

--HG--
extra : moz-landing-system : lando
2019-05-20 06:04:23 +00:00
violet
94b46be68b Bug 1520020 - Accept empty argument for some filters r=emilio
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
2019-05-20 07:01:29 +00:00
Emilio Cobos Álvarez
16524e64f1 Bug 1552625 - Remove some more individual-transform dead code. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D31705

--HG--
extra : moz-landing-system : lando
2019-05-18 04:48:16 +00:00
Emilio Cobos Álvarez
659be28594 Bug 1551991 - followup: Give up on passing CounterSpeakAs by value since the previous patch busted non-Windows platforms.
CLOSED TREE
2019-05-17 07:01:26 +02:00
Emilio Cobos Álvarez
ce94f581e0 Bug 1551991 - followup: Don't derive the destructor of CounterSpeakAs so that we can return it safely by value in Win32. r=me 2019-05-17 05:25:14 +02:00
Emilio Cobos Álvarez
98282c37a5 Bug 1551991 - Remove nsCSSValue bindings. r=jwatt
Depends on D31320

Differential Revision: https://phabricator.services.mozilla.com/D31321

--HG--
extra : moz-landing-system : lando
2019-05-16 23:06:17 +00:00
Emilio Cobos Álvarez
90292a352d Bug 1551991 - Remove usage of nsCSSValue for SpeakAs. r=jwatt
Depends on D31319

Differential Revision: https://phabricator.services.mozilla.com/D31320

--HG--
extra : moz-landing-system : lando
2019-05-16 23:06:06 +00:00
Emilio Cobos Álvarez
80c89fdda8 Bug 1551991 - Remove nsCSSValue usage of GetSymbols() GetAdditiveSymbols(). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D31319

--HG--
extra : moz-landing-system : lando
2019-05-16 23:05:54 +00:00
Emilio Cobos Álvarez
88428d31cd Bug 1551991 - Remove nsCSSValue usage for range checks in CounterStyleRule. r=jwatt
Depends on D31317

Differential Revision: https://phabricator.services.mozilla.com/D31318

--HG--
extra : moz-landing-system : lando
2019-05-16 23:05:38 +00:00
Emilio Cobos Álvarez
7e0fc30e7d Bug 1551991 - Remove nsCSSValue usage for negative / suffix / prefix. r=jwatt
Depends on D31316

Differential Revision: https://phabricator.services.mozilla.com/D31317

--HG--
extra : moz-landing-system : lando
2019-05-16 23:05:25 +00:00
Emilio Cobos Álvarez
854582f70f Bug 1551991 - Remove nsCSSValue usage from GetPad. r=jwatt
Depends on D31315

Differential Revision: https://phabricator.services.mozilla.com/D31316

--HG--
extra : moz-landing-system : lando
2019-05-16 23:05:10 +00:00
Emilio Cobos Álvarez
c8338578d2 Bug 1551991 - Cleanup a bit the counter style code. r=jwatt
Use more compact types, and remove some manual implementations that can be
derived.

Differential Revision: https://phabricator.services.mozilla.com/D31315

--HG--
extra : moz-landing-system : lando
2019-05-16 23:05:00 +00:00
Emilio Cobos Álvarez
835de4b08d Bug 1529002 - Use cbindgen to back CSS transforms. r=boris
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
2019-05-16 23:25:10 +00:00
Emilio Cobos Álvarez
0b89333979 Bug 1550554 - Use OwnedSlice for will-change. r=heycam
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
2019-05-16 23:23:28 +00:00
Emilio Cobos Álvarez
987519e4da Bug 1550554 - Add bindings for box shadows, and remove nsCSSShadowArray and friends. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30547

--HG--
extra : moz-landing-system : lando
2019-05-16 23:04:32 +00:00
Emilio Cobos Álvarez
a4ef6a3540 Bug 1550554 - Use ArcSlice for quotes. r=heycam
This saves the intermediate allocation.

Differential Revision: https://phabricator.services.mozilla.com/D30546

--HG--
extra : moz-landing-system : lando
2019-05-16 23:04:31 +00:00
Emilio Cobos Álvarez
5859e667fb Bug 1550554 - Share computed and specified value representation of -moz-context-properties. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30545

--HG--
extra : moz-landing-system : lando
2019-05-16 23:03:29 +00:00
Emilio Cobos Álvarez
4cc6d90c5f Bug 1550554 - Use an ArcSlice as the computed value representation of inherited list properties. r=heycam
This adds a bit of complexity, which I think will pay off in the end. Removals
incoming.

Differential Revision: https://phabricator.services.mozilla.com/D30544

--HG--
extra : moz-landing-system : lando
2019-05-16 23:03:27 +00:00
Emilio Cobos Álvarez
9ed0e9ec6e Bug 1550554 - Implement ArcSlice::default(). r=heycam
Share a singleton to avoid allocating for empty lists.

Differential Revision: https://phabricator.services.mozilla.com/D30543

--HG--
extra : moz-landing-system : lando
2019-05-16 23:22:04 +00:00
Emilio Cobos Álvarez
a109b9a835 Bug 1549593 - Use OwnedSlice in the specified and computed values of most vector properties. r=heycam
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
2019-05-16 23:21:37 +00:00
Ciure Andrei
00a73f5055 Backed out 17 changesets (bug 1550554, bug 1549593, bug 1551991, bug 1529002) for failing multiple Android tests and Windows 2012 bustages CLOSED TREE
Backed out changeset 3bb3fafa62e2 (bug 1551991)
Backed out changeset e12a979de502 (bug 1551991)
Backed out changeset d81e4aa6bf0c (bug 1551991)
Backed out changeset c354e61f2a34 (bug 1551991)
Backed out changeset 37fd602bebc2 (bug 1551991)
Backed out changeset 6c1f00cc30ca (bug 1551991)
Backed out changeset 8a7a0329bdc3 (bug 1551991)
Backed out changeset 86159475ddd3 (bug 1551991)
Backed out changeset 35f91a9ea82a (bug 1529002)
Backed out changeset 6798155e71dc (bug 1529002)
Backed out changeset b90c2cf5b8c5 (bug 1550554)
Backed out changeset 882ab9868c95 (bug 1550554)
Backed out changeset b28a48e2ed21 (bug 1550554)
Backed out changeset 2c31fe18eefd (bug 1550554)
Backed out changeset 57f2362aa538 (bug 1550554)
Backed out changeset 45f171b26e95 (bug 1550554)
Backed out changeset 2e4b263c9410 (bug 1549593)
2019-05-16 13:17:10 +03:00
Emilio Cobos Álvarez
ccf63230f7 Bug 1551991 - Remove nsCSSValue bindings. r=jwatt
Depends on D31320

Differential Revision: https://phabricator.services.mozilla.com/D31321

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:52 +00:00
Emilio Cobos Álvarez
5f06ce58b8 Bug 1551991 - Remove usage of nsCSSValue for SpeakAs. r=jwatt
Depends on D31319

Differential Revision: https://phabricator.services.mozilla.com/D31320

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:50 +00:00
Emilio Cobos Álvarez
0bb1b519c6 Bug 1551991 - Remove nsCSSValue usage of GetSymbols() GetAdditiveSymbols(). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D31319

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:42 +00:00
Emilio Cobos Álvarez
a3587f05d7 Bug 1551991 - Remove nsCSSValue usage for range checks in CounterStyleRule. r=jwatt
Depends on D31317

Differential Revision: https://phabricator.services.mozilla.com/D31318

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:34 +00:00
Emilio Cobos Álvarez
f9dfb61dac Bug 1551991 - Remove nsCSSValue usage for negative / suffix / prefix. r=jwatt
Depends on D31316

Differential Revision: https://phabricator.services.mozilla.com/D31317

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:22 +00:00
Emilio Cobos Álvarez
9968de9376 Bug 1551991 - Remove nsCSSValue usage from GetPad. r=jwatt
Depends on D31315

Differential Revision: https://phabricator.services.mozilla.com/D31316

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:15 +00:00
Emilio Cobos Álvarez
f7cde97a0b Bug 1551991 - Cleanup a bit the counter style code. r=jwatt
Use more compact types, and remove some manual implementations that can be
derived.

Differential Revision: https://phabricator.services.mozilla.com/D31315

--HG--
extra : moz-landing-system : lando
2019-05-16 14:30:57 +00:00
Emilio Cobos Álvarez
5804e8efae Bug 1529002 - Use cbindgen to back CSS transforms. r=boris
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
2019-05-16 16:24:38 +02:00
Emilio Cobos Álvarez
6634361c43 Bug 1550554 - Use OwnedSlice for will-change. r=heycam
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
2019-05-16 16:24:31 +02:00
Emilio Cobos Álvarez
0fe081bb39 Bug 1550554 - Add bindings for box shadows, and remove nsCSSShadowArray and friends. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30547
2019-05-16 16:24:28 +02:00
Emilio Cobos Álvarez
49f795fd83 Bug 1550554 - Use ArcSlice for quotes. r=heycam
This saves the intermediate allocation.

Differential Revision: https://phabricator.services.mozilla.com/D30546
2019-05-16 16:24:24 +02:00
Emilio Cobos Álvarez
8c06775ab0 Bug 1550554 - Share computed and specified value representation of -moz-context-properties. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30545
2019-05-16 16:24:20 +02:00
Emilio Cobos Álvarez
2ae3a428ec Bug 1550554 - Use an ArcSlice as the computed value representation of inherited list properties. r=heycam
This adds a bit of complexity, which I think will pay off in the end. Removals
incoming.

Differential Revision: https://phabricator.services.mozilla.com/D30544
2019-05-16 16:24:16 +02:00
Emilio Cobos Álvarez
00b4378adb Bug 1550554 - Implement ArcSlice::default(). r=heycam
Share a singleton to avoid allocating for empty lists.

Differential Revision: https://phabricator.services.mozilla.com/D30543
2019-05-16 16:24:13 +02:00
Emilio Cobos Álvarez
6d9623f982 Bug 1549593 - Use OwnedSlice in the specified and computed values of most vector properties. r=heycam
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
2019-05-16 16:24:09 +02:00
Coroiu Cristina
b4731ed54d Backed out 12 changesets (bug 1383650) for landing in the soft-freeze period
Backed out changeset 4316d55f87be (bug 1383650)
Backed out changeset 0118148f1534 (bug 1383650)
Backed out changeset 447c9248342b (bug 1383650)
Backed out changeset 6730776560c0 (bug 1383650)
Backed out changeset a7b8e6460fb8 (bug 1383650)
Backed out changeset e864696f6cf8 (bug 1383650)
Backed out changeset 2b003d678c58 (bug 1383650)
Backed out changeset 7bc3bff991c4 (bug 1383650)
Backed out changeset f1f7b4ad9547 (bug 1383650)
Backed out changeset 18b030b31660 (bug 1383650)
Backed out changeset 70e74dd6b45d (bug 1383650)
Backed out changeset 55a283e793df (bug 1383650)
2019-05-16 04:47:58 +03:00
violet
b17e156100 Bug 1383650 - Add geometry property support for Servo glue r=emilio
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
2019-05-16 00:51:04 +00:00
violet
2dad80d965 Bug 1383650 - Add SVG geometry property support in CSS r=emilio
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
2019-05-16 00:47:20 +00:00
violet
19283c2c6c Bug 1383650 - Support AllowQuirks::Always option in helpers.mako.rs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29936

--HG--
extra : moz-landing-system : lando
2019-05-16 00:44:51 +00:00
Emilio Cobos Álvarez
0869b9bd67 Bug 1550377 - Use ManuallyDrop for style structs. r=jwatt
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
2019-05-15 08:57:36 +00:00
Brindusan Cristian
b766f8ce38 Backed out changeset 2d0e8bded97a (bug 1550377) for build bustages on self.gecko. CLOSED TREE 2019-05-15 04:35:01 +03:00
Emilio Cobos Álvarez
6770308eb7 Bug 1550377 - Use ManuallyDrop for style structs. r=jwatt
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
2019-05-14 22:44:40 +00:00
Cameron McCormack
4b20fc81c7 Bug 1505908 - Add Gecko profiler labels for when the style threads are doing work. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D30869

--HG--
extra : moz-landing-system : lando
2019-05-14 05:00:45 +00:00
Emilio Cobos Álvarez
7b4c4a4912 No bug - rustfmt recent style system changes. 2019-05-09 20:18:08 +02:00
Emilio Cobos Álvarez
647b7c7078 No bug - Fix Servo build. 2019-05-09 20:18:05 +02:00
Emilio Cobos Álvarez
f65bcfba56 Bug 1549559 - Add bindings for ArcSlice and ThinArc, and use them to reduce copies of SVG path data. r=heycam
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
2019-05-09 12:43:19 +00:00
Emilio Cobos Álvarez
f59bb7ae91 Bug 1549559 - Introduce ArcSlice, a small wrapper over ThinArc but without an explicit header. r=heycam
We could make the header PhantomData or something, but then we wouldn't be able
to bind to C++, since C++ doesn't have ZSTs. So add a canary instead to add a
runtime check of stuff being sane.

Differential Revision: https://phabricator.services.mozilla.com/D30133

--HG--
extra : moz-landing-system : lando
2019-05-09 10:53:50 +00:00
Emilio Cobos Álvarez
1de789c618 Bug 1549593 - Move OwnedSlice to style_traits. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30126

--HG--
rename : servo/components/style/owned_slice.rs => servo/components/style_traits/owned_slice.rs
extra : moz-landing-system : lando
2019-05-09 10:49:50 +00:00
Emilio Cobos Álvarez
38065025d9 Bug 1548691 - Use the owned slice type for basic shape polygon coordinates. r=TYLin,heycam
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
2019-05-09 11:24:57 +00:00
Emilio Cobos Álvarez
7d9dca2244 Bug 1548691 - Add an owned slice type which cbindgen can understand. r=heycam
Passing these by value won't be ok of course, but that's fine.

I plan to combine this with https://github.com/eqrion/cbindgen/pull/333 to
actually be able to share representation for ~all the things, this is just the
first bit.

Box<T>, Atom and Arc<T> will be much easier since cbindgen can understand them
without issues.

It's boxed slices the only ones I should need something like this. I could avoid
it if I rely on Rust's internal representation, which we can per [1], but then I
need to teach cbindgen all about slices, which is generally hard, I think.

[1]: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/reference/src/layout/pointers.md

Differential Revision: https://phabricator.services.mozilla.com/D29768

--HG--
extra : moz-landing-system : lando
2019-05-09 10:49:22 +00:00
Jonathan Kew
c8c951fbbe Bug 1545177 - If descriptors of a FontFace are modified after creation, update the associated font entry so that face selection will respect the new values, and mark font sets as dirty. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D27980

--HG--
extra : moz-landing-system : lando
2019-05-09 09:43:42 +00:00
Emilio Cobos Álvarez
936ebd1f3a Bug 1550389 - Remove unnecessary mut usage. 2019-05-09 05:45:10 +02:00
Cameron McCormack
f5b7d1380b Bug 866102 - Implement -webkit-line-clamp. r=mats,emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D20115

--HG--
extra : moz-landing-system : lando
2019-05-09 02:32:30 +00:00
Emilio Cobos Álvarez
e3b9d16857 Bug 1549969 - Fix an assertion that doesn't account for alignment padding. r=bholley
I'm hitting this when trying to add bindings for box shadows, which are 32-bit
aligned.

Depends on D30352

Differential Revision: https://phabricator.services.mozilla.com/D30353

--HG--
extra : moz-landing-system : lando
2019-05-08 18:03:37 +00:00
Emilio Cobos Álvarez
fcca6294b1 Bug 1549969 - Don't panic when creating empty ThinArcs. r=bholley
The change from [T; 1] to [T; 0] shouldn't change behavior since they have the
right alignment and we never poke at that particular array, but feels more
correct to avoid creating types that point to uninitialized data or outside of
their allocation, now that we allow empty slices.

Differential Revision: https://phabricator.services.mozilla.com/D30352

--HG--
extra : moz-landing-system : lando
2019-05-08 17:54:25 +00:00
Emilio Cobos Álvarez
17b3f8d8e7 Bug 1538101 - Don't report errors for properties for which we've parsed another value in the same declaration block. r=jdm
I thought a bit about how to test it and it's not particularly great.
test_css_parse_error_smoketest.html is great to assert that something _gets_
reported, but not that it doesn't :)

Differential Revision: https://phabricator.services.mozilla.com/D30201
2019-05-08 18:14:18 +02:00
Dorel Luca
6d69b04fd4 Backed out changeset eee17e1b0435 (bug 1538101) for Browser-chrome and DT failures. CLOSED TREE 2019-05-08 18:21:30 +03:00
Emilio Cobos Álvarez
1b7101750d Bug 1538101 - Don't report errors for properties for which we've parsed another value in the same declaration block. r=jdm
I thought a bit about how to test it and it's not particularly great.
test_css_parse_error_smoketest.html is great to assert that something _gets_
reported, but not that it doesn't :)

Differential Revision: https://phabricator.services.mozilla.com/D30201

--HG--
extra : moz-landing-system : lando
2019-05-08 12:44:46 +00:00
Emilio Cobos Álvarez
c8d19bedcd Bug 1538101 - Centralize a bit invalid value error reporting. r=jdm
Also, buffer the errors, since we're going to want to look at the whole
declaration block to skip reporting them.

This shouldn't change behavior, just moves some work to the caller, and defers a
bit the work so that it happens only when error reporting is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D30200

--HG--
extra : moz-landing-system : lando
2019-05-08 12:44:36 +00:00
Emilio Cobos Álvarez
259aa236fd Bug 1549596 - Use PhantomData<T> in servo_arc. r=bholley
See https://github.com/rust-lang/rust/pull/60594#issuecomment-489966933

Differential Revision: https://phabricator.services.mozilla.com/D30169

--HG--
extra : moz-landing-system : lando
2019-05-08 08:01:01 +00:00
Emilio Cobos Álvarez
0789d1d403 Bug 1549596 - ThinArc should use NonNull. r=bholley
If only for parallelism with Arc<>.

Differential Revision: https://phabricator.services.mozilla.com/D30131

--HG--
extra : moz-landing-system : lando
2019-05-07 03:16:21 +00:00
Emilio Cobos Álvarez
e736bff42d No bug - Cherry-pick some Servo removals from malloc_size_of. r=npotb 2019-05-07 12:59:40 +02:00
Oana Pop Rus
251b4874dc Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-05-07 01:33:06 +03:00
Oana Pop Rus
65399363fb Merge inbound to mozilla-central. a=merge 2019-05-07 00:45:24 +03:00
Emilio Cobos Álvarez
ab4877cc37 Bug 1549589 - scroll-snap-coordinate shouldn't use NotInitial. r=hiro
The initial value for this is indeed `none` (and thus empty). The Rust code was
confused.

This property is disabled by default these days, and I think the
get_initial_value() function, which is what could get confused, is not called
for this property, so I think this shouldn't be observable.

Differential Revision: https://phabricator.services.mozilla.com/D30124

--HG--
extra : moz-landing-system : lando
2019-05-06 21:31:16 +00:00
Emilio Cobos Álvarez
656a46330b Bug 1549301 - Fix Servo build. 2019-05-06 10:37:55 +02:00
Emilio Cobos Álvarez
94cde8dcec Bug 1549301 - Rustfmt recent style system changes. 2019-05-06 10:37:53 +02:00
Emilio Cobos Álvarez
c78d89f5d6 Bug 1549301 - Import style system changes for Servo's Shadow DOM support. 2019-05-06 10:37:52 +02:00
Emilio Cobos Álvarez
959628ed83 Bug 1549301 - Fix some warnings. 2019-05-06 10:37:50 +02:00
Ian Moody
a465f73789 Bug 1549301 - Remove :-servo-case-sensitive-type-attr().
No longer needed now that the case-sensitive flag for attributes selectors is
supported.
Update user-agent CSS sheet to use the standard flag.

Fixes #23227

This cherry-picks https://github.com/servo/servo/pull/23228.
2019-05-06 10:37:45 +02:00
Jeremy Ir
79895773c2 Bug 1548341 - Convert NS_STYLE_BORDER to an enum class in nsStyleConsts.h. r=dholbert
Converting the NS_STYLE_BORDER definitions in to enumerated classes as
per bug 1277133.

The original constants broke the convention used by the rest of the
definitions as the CSS property being described is `border-collapse`,
so corrections were made with the migration to the enumerated class.

Differential Revision: https://phabricator.services.mozilla.com/D29951

--HG--
extra : moz-landing-system : lando
2019-05-05 23:39:27 +00:00
Mats Palmgren
af98466fc0 Bug 1549223 - [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29974

--HG--
extra : rebase_source : 4f76c70ab6335cd41e23bd692c0a4ea432b525e9
2019-05-06 02:43:50 +02:00
Masayuki Nakano
8a9d031686 Bug 253889 - part 3: Move all remaining members of nsIPresShell to mozilla::PresShell r=emilio
Additionally, this sorts out the order of member variables for minimizing the
instance size.

And also this changes `enum RenderFlags` to `enum class RenderingStateFlags`.

Differential Revision: https://phabricator.services.mozilla.com/D29312

--HG--
extra : moz-landing-system : lando
2019-05-01 02:28:25 +00:00
Noemi Erli
f1ef21cbc7 Backed out changeset 8c89fd37b79d (bug 1544242) for failures in browser_rules_shadowdom_slot_rules.js CLOSED TREE 2019-05-01 22:03:06 +03:00
Emilio Cobos Álvarez
27fc6a03c9 Bug 1545430 - Implement selector-matching for ::part(). r=heycam
Also fairly straight-forward. This may get more complicated when we do part
forwarding, if any.

I've opened https://github.com/w3c/csswg-drafts/issues/3841 in what I think
would be a cleaner model for forwarding.

Differential Revision: https://phabricator.services.mozilla.com/D28063

--HG--
extra : moz-landing-system : lando
2019-05-01 17:28:23 +00:00
Emilio Cobos Álvarez
f7fc67efda Bug 1545425 - Add parsing support for ::part(). r=heycam
Disabled for now of course. This should be pretty uncontroversial I'd think.

Differential Revision: https://phabricator.services.mozilla.com/D28060

--HG--
extra : moz-landing-system : lando
2019-05-01 17:25:13 +00:00
Emilio Cobos Álvarez
fb5b637f4f Bug 1544242 - Fix selector-matching for nested pseudo-elements. r=heycam,mats
We always include the combinator for pseudo-elements now (not including it was
just an optimization) in order to not match when nested pseudo-elements are
involved.

We could add a more generic check in `matches_simple_selector` like:

```
if element.is_pseudo_element() {
    match *selector {
        Component::PseudoElement(..) |
        Component::NonTSPseudoClass(..) => {},
        _ => return false,
    }
}
```

But even that wouldn't be enough to make selectors like `:hover::marker` not
match on the `::before::marker` pseudo-element, plus that code is really hot.

So for now do the check on the `next_element_for_combinator` function. It's a
bit hacky but it's the best I could came up with...

While at it, simplify some checks to use is_pseudo_element() instead of
implemented_pseudo_element() directly.

Only the Rust patch as-is would make markers for ::before and ::after on list
items not show up, so we also need to switch ::marker to use ProbeMarkerStyle()
rather than ProbePseudoElementStyle(), since the marker should exist even if it
matches no rules.

Differential Revision: https://phabricator.services.mozilla.com/D27529

--HG--
extra : moz-landing-system : lando
2019-05-01 17:19:08 +00:00
Emilio Cobos Álvarez
1dc4cd8f3c Bug 1544242 - Check iterator length in SelectorIter::is_featureless_host_selector. r=heycam
I'm going to unconditionally generate the PseudoElement combinator, and this
causes issues since we'll put the raw `::pseudo` selectors in the host bucket,
which is obviously wrong.

Differential Revision: https://phabricator.services.mozilla.com/D27528

--HG--
extra : moz-landing-system : lando
2019-04-29 05:58:56 +00:00
Emilio Cobos Álvarez
edde08a7cb Bug 1547985 - Use rust types for vertical-align. r=mats
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
2019-05-01 13:08:34 +00:00
Emilio Cobos Álvarez
0593b77cc0 Bug 1547674 - Use rust types for gradient stops. r=boris
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
2019-04-30 20:37:54 +00:00
Emilio Cobos Álvarez
ab81a99c80 Bug 1547939 - Add a pref for a simpler -moz- gradient parsing. r=dholbert
This won't reintroduce any of the regressions that were triggered by our
previous attempts to turn off -moz prefixed gradients, and lets us massively
simplify the gradient code, if it sticks.

Differential Revision: https://phabricator.services.mozilla.com/D29346

--HG--
extra : moz-landing-system : lando
2019-04-30 19:48:27 +00:00
Emilio Cobos Álvarez
a6845a59a2 Bug 1547619 - Fix :-moz-svg-use-shadow-tree-root pseudo-class. r=violet
Turns out removing the pseudo-class and such ends up not being quite as trivial
as I initially thought, or possible at all, since the fact that the <symbol> is
a <symbol> is observable via selectors, added a test for that.

Differential Revision: https://phabricator.services.mozilla.com/D29131

--HG--
extra : moz-landing-system : lando
2019-04-29 08:04:22 +00:00
Brian Birtles
46c5c2141a Bug 1536688 - Allow animating the 'all' property from Web Animations; r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D28763

--HG--
extra : moz-landing-system : lando
2019-04-26 00:47:40 +00:00
Emilio Cobos Álvarez
88a1b27597 Bug 1546046 - Remove support for XBL resources. r=TYLin
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380

--HG--
extra : moz-landing-system : lando
2019-04-23 16:43:15 +00:00
Emilio Cobos Álvarez
73c98adccf Bug 1544886 - Allow CSS wide-keywords in custom property fallback. r=SimonSapin
Differential Revision: https://phabricator.services.mozilla.com/D28349

--HG--
extra : moz-landing-system : lando
2019-04-23 13:13:11 +00:00
Bogdan Tara
ec489aa170 Backed out changeset e85cb54e5944 (bug 1546046) complementary backout after 1470880 was backed out CLOSED TREE 2019-04-23 06:55:29 +03:00
Emilio Cobos Álvarez
daef6a8b67 Bug 1546046 - Remove support for XBL resources. r=TYLin
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380

--HG--
extra : moz-landing-system : lando
2019-04-22 21:57:22 +00:00
Emilio Cobos Álvarez
f2b53c1479 Bug 1545979 - Drop unused user-agent cascade datas when not holding the cache lock. r=bholley
We want to drop the cascade data memory as soon as possible, so bug 1544546
introduced an UpdateStylistIfNeeded call from ShellDetachedFromDocument.

Unfortunately, this call can reenter into the global user-agent cascade data if
some of the CSS values kept alive by the cascade data keep alive an SVG
document, see the stack on this bug for an example. Make sure to drop the
user-agent cascade datas when not holding the cache lock to avoid this
situation.

Before bug 1535788, we just destroyed the stylist, so we kept holding a
reference from the cache, and that reference will be dropped sometime later when
other document updated their user-agent stylesheets (if they happened not to
match the cache of course).

Seems to me this doesn't ended up happening in our automation, but it could
happen in the wild, in theory at least.

It's nice that Rust made this a safe deadlock caught by our tests rather than a
very subtle and infrequent memory corruption.

The relevant SVG documents are probably the <input type=number> rules:

https://searchfox.org/mozilla-central/rev/d80f0a570736dce76a2eb184fb65517462089e8a/layout/style/res/forms.css#1050

Differential Revision: https://phabricator.services.mozilla.com/D28299

--HG--
extra : moz-landing-system : lando
2019-04-22 19:45:06 +00:00
Emilio Cobos Álvarez
824fde5850 Bug 1545440 - Don't allow to parse XUL tree pseudo-elements with a single colon. r=mats
Now that they're not exposed to the web we can remove this special case.

Differential Revision: https://phabricator.services.mozilla.com/D28071

--HG--
extra : moz-landing-system : lando
2019-04-19 04:41:17 +00:00
Emilio Cobos Álvarez
d3f8a1f5a6 Bug 1544535 - Bug 1542263 - Don't keep two list of stylesheets in ServoStyleSet. r=firefox-style-system-reviewers,jwatt
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
2019-04-19 04:20:31 +00:00
Razvan Maries
74e5a11e50 Backed out changeset 24d0d307385d (bug 1545440) for perma failures on browser_parsable_css.js. CLOSED TREE 2019-04-19 02:06:41 +03:00
Andreea Pavel
eb0b5758ea Merge mozilla-central to autoland. on a CLOSED TREE 2019-04-19 00:48:30 +03:00
Mats Palmgren
fcba4dfac7 Bug 1500708 - [cssom][css-grid] 'grid-auto-flow: row dense' should serialize to 'dense' since 'row' is implied. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D28058

--HG--
extra : rebase_source : dd8109fa0853bc73e8859198196aa52b5523786a
2019-04-18 01:16:03 +02:00
Emilio Cobos Álvarez
c80bd43778 Bug 1545440 - Don't allow to parse XUL tree pseudo-elements with a single colon. r=mats
Now that they're not exposed to the web we can remove this special case.

Differential Revision: https://phabricator.services.mozilla.com/D28071

--HG--
extra : moz-landing-system : lando
2019-04-18 15:20:34 +00:00
Emilio Cobos Álvarez
2671b8a08a No bug - Unify a bit Servo and Gecko code in properties.mako.rs.
Mostly removing #[cfg] statements, so npotb.
2019-04-17 12:32:55 +02:00
Emilio Cobos Álvarez
7d7f571903 Bug 1543808 - Refactor the selector parser to make implementing ::part() easier. r=xidorn
::slotted() is already weird in the sense that it supports a pseudo-element
afterwards (so ::slotted(*)::before is valid for example).

::part() is weirder because you are supposed to allow stuff like
::part(foo):hover, ::part(foo):hover::before, etc.

In order to avoid making the already-complex parse_compound_selector more
complex, shuffle stuff so that we pass the progress of our current compound
selector around, and is the parsing code for each selector which decides whether
it's ok to parse at the given point.

Differential Revision: https://phabricator.services.mozilla.com/D27158

--HG--
extra : moz-landing-system : lando
2019-04-16 13:16:56 +00:00
Emilio Cobos Álvarez
4093a2cb9e Bug 1543672 - The counters code should use atoms rather than strings. r=mats,boris
Servo already atomizes the counter names, it makes no sense to copy the string
rather than bumping the refcount.

Differential Revision: https://phabricator.services.mozilla.com/D27061

--HG--
extra : moz-landing-system : lando
2019-04-15 20:11:45 +00:00
Jonathan Kew
504abab69a Bug 1541959 - Allow full-width and/or full-size-kana values of text-transform to be combined with a case transformation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D27402

--HG--
extra : moz-landing-system : lando
2019-04-14 11:06:41 +00:00
Emilio Cobos Álvarez
278866eb8e Bug 1543837 - Fix servo build and appease tidy. 2019-04-12 00:25:50 +02:00
Emilio Cobos Álvarez
2fa8c1c1a2 Bug 1543837 - Reformat recent changes. 2019-04-12 00:25:37 +02:00
Emilio Cobos Álvarez
6225992f10 Bug 1539171 - Make the list-item increment not visible from the computed style. r=mats
This is per https://drafts.csswg.org/css-lists/#declaring-a-list-item.

I intentionally kept <li value> defined using attribute mapping, I think that's
saner than special-casing it in layout.

Differential Revision: https://phabricator.services.mozilla.com/D24935

--HG--
extra : moz-landing-system : lando
2019-04-11 15:21:17 +00:00
Hiroyuki Ikezoe
f7645a5770 Bug 1531228 - Enable the new scroll snap and disable the old scroll snap on nightly. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D22804

--HG--
extra : moz-landing-system : lando
2019-04-11 06:22:01 +00:00
Hiroyuki Ikezoe
eab764a7ae Bug 1312163 - Switch to the new scroll-snap-type syntax for the old scroll snap implementation and drop the scroll-snap-type-{x,y} longhands. r=emilio
Now scroll-snap-type is a longhand property.

Depends on D21621

Differential Revision: https://phabricator.services.mozilla.com/D21622

--HG--
extra : moz-landing-system : lando
2019-04-11 06:19:31 +00:00
Hiroyuki Ikezoe
19102cb3b9 Bug 1312163 - Rename ScrollSnapType to ScrollSnapStrictness. r=emilio
The scroll snap strictness is defined in the new spec [1], and the structure
is the exactly same as the old scroll snap type structure.

[1] https://drafts.csswg.org/css-scroll-snap-1/#snap-strictness

Differential Revision: https://phabricator.services.mozilla.com/D21621

--HG--
extra : moz-landing-system : lando
2019-04-11 06:19:13 +00:00
Emilio Cobos Álvarez
bb47a90d4f Bug 1543401 - Use rust lengths for row-gap / column-gap. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D26915

--HG--
extra : moz-landing-system : lando
2019-04-10 16:00:03 +00:00
Emilio Cobos Álvarez
5d34d16593 Bug 1542178 - Fix ToResolvedValue implementation for caret-color, and serialize some color properties with Servo. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26785
2019-04-10 17:16:35 +02:00
Emilio Cobos Álvarez
9bdc1f548f Bug 1542178 - Use ToResolvedValue for computed style serialization. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26784
2019-04-10 17:16:32 +02:00
Emilio Cobos Álvarez
643d31e287 Bug 1542178 - Derive ToResolvedValue. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26783
2019-04-10 17:16:30 +02:00
Emilio Cobos Álvarez
9a6b6a33d0 Bug 1542178 - Add derive code for a new ToResolvedValue trait, and a few trivial implementations. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26782
2019-04-10 17:16:28 +02:00
Bogdan Tara
48a5da4868 Backed out 5 changesets (bug 1542178) for for test_flexbox_flex_shorthand.html failures CLOSED TREE
Backed out changeset 7fbaca51f682 (bug 1542178)
Backed out changeset e5a602010961 (bug 1542178)
Backed out changeset 152985a87c01 (bug 1542178)
Backed out changeset 7da7a8bc596a (bug 1542178)
Backed out changeset 0a7766ece186 (bug 1542178)
2019-04-10 17:54:45 +03:00
Csoregi Natalia
b0782effcb Merge mozilla-central to autoland. CLOSED TREE 2019-04-10 16:21:21 +03:00
Emilio Cobos Álvarez
6d76b07bd5 Bug 1542178 - Fix ToResolvedValue implementation for caret-color, and serialize some color properties with Servo. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26785

--HG--
extra : moz-landing-system : lando
2019-04-10 12:10:49 +00:00
Emilio Cobos Álvarez
dc49b231ff Bug 1542178 - Use ToResolvedValue for computed style serialization. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26784

--HG--
extra : moz-landing-system : lando
2019-04-10 12:10:40 +00:00
Emilio Cobos Álvarez
7ace3b8574 Bug 1542178 - Derive ToResolvedValue. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26783

--HG--
extra : moz-landing-system : lando
2019-04-10 12:10:26 +00:00
Emilio Cobos Álvarez
67a4bcf46f Bug 1542178 - Add derive code for a new ToResolvedValue trait, and a few trivial implementations. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26782

--HG--
extra : moz-landing-system : lando
2019-04-10 12:10:11 +00:00
Narcis Beleuzu
32e64c394e Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-04-10 01:28:09 +03:00
Mats Palmgren
37b4344681 Bug 1543249 - Remove a note about <li value> style mapping that is no longer true. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D26814

--HG--
extra : amend_source : 1882fe674aed68b92efdf7b977969250d6ea9afe
2019-04-09 23:01:44 +02:00
Emilio Cobos Álvarez
b00da66ad1 Bug 1540220 - Cleanup unused style traversal flags. r=dholbert
Some of these were unused, some of them were only used in combination with
others, so I've unified them.

In particular, Forgetful and ClearAnimationOnlyDirtyDescendants were used only
together for a very specific task (the final animation traversal), so I merged
them into something that has that name.

ClearDirtyBits was unused, so I removed along with some code that would no
longer be called.

Differential Revision: https://phabricator.services.mozilla.com/D25454

--HG--
extra : moz-landing-system : lando
2019-04-09 18:03:41 +00:00
Emilio Cobos Álvarez
3421ca2722 No bug - Remove a redundant use statement. 2019-04-09 13:39:38 +02:00
Emilio Cobos Álvarez
8178d24334 Bug 1542179 - Handle the non-generic path earlier in the derive code. r=heycam
No need to build the match body if there are no generics. This should hopefully
save some work too.

Depends on D26289

Differential Revision: https://phabricator.services.mozilla.com/D26290

--HG--
extra : moz-landing-system : lando
2019-04-09 01:48:18 +00:00
Emilio Cobos Álvarez
0082254050 Bug 1542179 - Share more code between ToAnimatedValue and ToComputedValue derive. r=heycam
I'm going to add a ToResolvedValue, and I don't want to add more copy-pasta.

This shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D26289

--HG--
extra : moz-landing-system : lando
2019-04-09 09:37:26 +00:00
Noemi Erli
dd7e27f4a8 Merge inbound to mozilla-central. a=merge 2019-04-09 12:55:19 +03:00
Mats Palmgren
f7b17e74b4 Bug 1542594 - Apply counter-set after counter-increment, not before. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D26439

--HG--
extra : rebase_source : 5e95ba52fda0b4b30865d7e98b9f49178f620cd6
2019-04-07 13:45:57 +02:00
Emilio Cobos Álvarez
24a689246b Bug 1542762 - Use an explicit stack to measure rule tree memory usage. r=heycam
A patch of mine that makes us measure the rule tree more often triggers this.

Differential Revision: https://phabricator.services.mozilla.com/D26595

--HG--
extra : moz-landing-system : lando
2019-04-09 00:11:03 +00:00
Emilio Cobos Álvarez
605558adcc Bug 760345 - Make color and text-decoration-line not early properties. r=heycam
The text-decoration-line is a drive-by thing, but I can put it in a separate
patch if you want. It was needed for Servo (to compute
-servo-text-decorations-in-effect), but I moved Servo away from that model a
while ago.

Differential Revision: https://phabricator.services.mozilla.com/D26254

--HG--
extra : moz-landing-system : lando
2019-04-04 23:04:50 +00:00
Emilio Cobos Álvarez
7980a72d0a Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam
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
2019-04-06 17:47:58 +00:00
Brindusan Cristian
c298fe167e Backed out changeset 1ea4b3582033 (bug 760345) for build bustages at ia2AccessibleComponent.cpp. 2019-04-05 07:49:09 +03:00
Emilio Cobos Álvarez
993731e44b Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam
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
2019-04-04 22:06:03 +00:00
Emilio Cobos Álvarez
e63fdb7c97 Bug 1541913 - Use rust lengths for outline-offset. r=boris
Depends on D26155

Differential Revision: https://phabricator.services.mozilla.com/D26156

--HG--
extra : moz-landing-system : lando
2019-04-04 18:32:09 +00:00
Emilio Cobos Álvarez
c028706efc Bug 1541913 - Use Servo lengths for column-width. r=boris
Depends on D26154

Differential Revision: https://phabricator.services.mozilla.com/D26155

--HG--
extra : moz-landing-system : lando
2019-04-04 18:29:57 +00:00
Emilio Cobos Álvarez
399573e18b Bug 1541913 - Trivially remove some dead code. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D26154

--HG--
extra : moz-landing-system : lando
2019-04-04 17:39:15 +00:00
Emilio Cobos Álvarez
68aa7a9c80 Bug 1541546 - Use only the new name for StyleColor. r=heycam
That is, change all uses of StyleComplexColor to just StyleColor.

Differential Revision: https://phabricator.services.mozilla.com/D25977
2019-04-04 14:53:47 +02:00
Emilio Cobos Álvarez
3a1e1a41c4 Bug 1541546 - Use the rust color representation. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D25976
2019-04-04 14:53:44 +02:00
Emilio Cobos Álvarez
06e8936b5d Bug 1541546 - Expose colors via cbindgen. r=heycam
Also s/Foreground/CurrentColor.

Differential Revision: https://phabricator.services.mozilla.com/D25975
2019-04-04 14:53:41 +02:00
Cosmin Sabou
8731816b89 Backed out 3 changesets (bug 1541546) for causing build bustages. CLOSED TREE
Backed out changeset 895863144707 (bug 1541546)
Backed out changeset 4da6fb98e8f9 (bug 1541546)
Backed out changeset ba71816514eb (bug 1541546)

--HG--
rename : layout/style/StyleColor.cpp => layout/style/StyleComplexColor.cpp
rename : layout/style/StyleColorInlines.h => layout/style/StyleComplexColor.h
2019-04-04 15:04:25 +03:00
Emilio Cobos Álvarez
271376a85f Bug 1541546 - Use only the new name for StyleColor. r=heycam
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
2019-04-04 11:35:33 +00:00
Emilio Cobos Álvarez
bc41ea853c Bug 1541546 - Use the rust color representation. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D25976

--HG--
extra : moz-landing-system : lando
2019-04-04 11:35:16 +00:00
Emilio Cobos Álvarez
ea38007b46 Bug 1541546 - Expose colors via cbindgen. r=heycam
Also s/Foreground/CurrentColor.

Differential Revision: https://phabricator.services.mozilla.com/D25975

--HG--
extra : moz-landing-system : lando
2019-04-04 11:34:56 +00:00
Emilio Cobos Álvarez
0c34c4b04f Bug 1540385 - Fix revalidation in <svg:use> subtree. r=heycam
So as to avoid incorrectly sharing styles across elements.

Differential Revision: https://phabricator.services.mozilla.com/D25918

--HG--
extra : moz-landing-system : lando
2019-04-04 03:46:55 +00:00
Ciure Andrei
58c8915ecd Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-04-04 00:57:38 +03:00
Emilio Cobos Álvarez
302f589417 No bug - Remove some redundant use statements. 2019-04-03 12:08:44 +02:00
Emilio Cobos Álvarez
d8e2990d8a Bug 1535788 - Make the Document own the StyleSet. r=heycam
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
2019-04-03 07:02:00 +00:00
Emilio Cobos Álvarez
a7ccd628a6 No bug - Remove comment that is outdated since I fixed it in bug 1483808. 2019-04-02 14:51:11 +02:00
Emilio Cobos Álvarez
d5f76a387b Bug 1537594 - Make the fixed generic family a parse-time alias to monospace. r=jfkthame
As discussed on IRC, fixed is only used for prefs right now, and:

 * We already copy the fixed size to the monospace font.
 * We already serialize the fixed family as "monospace" in the style system.

So it already works somewhat inconsistently. Making it an alias makes it
work consistently.

Differential Revision: https://phabricator.services.mozilla.com/D24288

--HG--
extra : moz-landing-system : lando
2019-04-01 21:48:08 +00:00
Emilio Cobos Álvarez
19c116ce06 Bug 1537575 - Cleanup generic font-family handling. r=jfkthame
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
2019-04-01 21:47:59 +00:00
Emilio Cobos Álvarez
1396481b91 Bug 1537575 - Trivially cleanup and remove some dead font code. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D24271

--HG--
extra : moz-landing-system : lando
2019-04-01 21:47:43 +00:00
arthur.iakab
cd473e09f4 Backed out 3 changesets (bug 1537594, bug 1537575) for causing build bustages on mathml/nsMathMLChar.cpp CLOSED TREE
Backed out changeset 7375a830b5ef (bug 1537594)
Backed out changeset 0cd1411e2fb3 (bug 1537575)
Backed out changeset c7565f50239a (bug 1537575)
2019-04-01 23:41:04 +03:00
Emilio Cobos Álvarez
9cee1c4e85 Bug 1537594 - Make the fixed generic family a parse-time alias to monospace. r=jfkthame
As discussed on IRC, fixed is only used for prefs right now, and:

 * We already copy the fixed size to the monospace font.
 * We already serialize the fixed family as "monospace" in the style system.

So it already works somewhat inconsistently. Making it an alias makes it
work consistently.

Differential Revision: https://phabricator.services.mozilla.com/D24288

--HG--
extra : moz-landing-system : lando
2019-04-01 18:48:10 +00:00
Emilio Cobos Álvarez
2188b25101 Bug 1537575 - Cleanup generic font-family handling. r=jfkthame
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
2019-04-01 18:48:10 +00:00
Emilio Cobos Álvarez
b0f2640ec4 Bug 1537575 - Trivially cleanup and remove some dead font code. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D24271

--HG--
extra : moz-landing-system : lando
2019-03-31 23:39:17 +00:00
Emilio Cobos Álvarez
7d6f6c28d7 Bug 1536582 - Autogenerate Servo_ binding functions with cbindgen. r=boris
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
2019-03-30 20:18:33 +00:00
Cameron McCormack
12c03087aa Bug 1474793 - Part 12: Add FFI API to create a StyleSheet backed by shared data. r=emilio
Depends on D17198

Differential Revision: https://phabricator.services.mozilla.com/D17199

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:29 +00:00
Cameron McCormack
3a08c03925 Bug 1474793 - Part 11: Add FFI API to use SharedMemoryBuilder. r=emilio
Depends on D17197

Differential Revision: https://phabricator.services.mozilla.com/D17198

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:27 +00:00
Cameron McCormack
6b5853fa8e Bug 1474793 - Part 10.8: Add derived ToShmem implementations. r=emilio
Depends on D17196

Differential Revision: https://phabricator.services.mozilla.com/D17197

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:25 +00:00
Cameron McCormack
2883bbaaea Bug 1474793 - Part 10.7: Add ToShmem impl for FontFamilyList. r=emilio
Depends on D17195

Differential Revision: https://phabricator.services.mozilla.com/D17196

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:23 +00:00
Cameron McCormack
ca6083b00d Bug 1474793 - Part 10.6: Add ToShmem impl for UrlExtraData. r=emilio
Depends on D17194

Differential Revision: https://phabricator.services.mozilla.com/D17195

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:21 +00:00
Cameron McCormack
828bb401f3 Bug 1474793 - Part 10.5: Add ToShmem impl for URLValueSource. r=emilio
Depends on D17193

Differential Revision: https://phabricator.services.mozilla.com/D17194

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:19 +00:00
Cameron McCormack
36b203d8d1 Bug 1474793 - Part 10.4: Add ToShmem impl for shared_lock::Locked. r=emilio
Depends on D17192

Differential Revision: https://phabricator.services.mozilla.com/D17193

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:17 +00:00
Cameron McCormack
25e28640fe Bug 1474793 - Part 10.3: Add ToShmem impl for Atom. r=emilio
Depends on D17191

Differential Revision: https://phabricator.services.mozilla.com/D17192

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:15 +00:00
Cameron McCormack
d46b90bcd7 Bug 1474793 - Part 10.2: Add ToShmem impls for collections and strings. r=emilio
Depends on D17190

Differential Revision: https://phabricator.services.mozilla.com/D17191

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:13 +00:00
Cameron McCormack
cf65641653 Bug 1474793 - Part 10.1: Add simple ToShmem implementations. r=emilio
Depends on D17189

Differential Revision: https://phabricator.services.mozilla.com/D17190

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:11 +00:00
Cameron McCormack
8c9949aa66 Bug 1474793 - Part 9: Add support for deriving ToShmem. r=emilio
Depends on D17188

Differential Revision: https://phabricator.services.mozilla.com/D17189

--HG--
extra : moz-landing-system : lando
2019-03-30 00:16:08 +00:00
Cameron McCormack
c1d7542bbd Bug 1474793 - Part 8: Factor out some of style_derive. r=emilio
Depends on D17187

Differential Revision: https://phabricator.services.mozilla.com/D17188

--HG--
rename : servo/components/style_derive/Cargo.toml => servo/components/derive_common/Cargo.toml
rename : servo/components/style_derive/cg.rs => servo/components/derive_common/cg.rs
extra : moz-landing-system : lando
2019-03-30 00:16:01 +00:00
Cameron McCormack
b3a8e5cfb6 Bug 1474793 - Part 7: Add SharedMemoryBuilder type and ToShmem trait. r=emilio
Depends on D17186

Differential Revision: https://phabricator.services.mozilla.com/D17187

--HG--
extra : moz-landing-system : lando
2019-03-30 00:15:59 +00:00
Cameron McCormack
ea948106dd Bug 1474793 - Part 6: Add support for static references to servo_arc::Arc. r=emilio
Depends on D17185

Differential Revision: https://phabricator.services.mozilla.com/D17186

--HG--
extra : moz-landing-system : lando
2019-03-30 00:15:57 +00:00
Cameron McCormack
b43b0a8e3a Bug 1474793 - Part 5: Add support for read only SharedRwLocks, which don't need any locking. r=emilio
Depends on D17184

Differential Revision: https://phabricator.services.mozilla.com/D17185

--HG--
extra : moz-landing-system : lando
2019-03-30 00:15:55 +00:00
Cameron McCormack
4651cebae2 Bug 1474793 - Part 4: Allow C++ URLValue objects to be lazily created from Rust SpecifiedUrls. r=emilio
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
2019-03-30 00:15:53 +00:00
Cameron McCormack
7bc808faa6 Bug 1474793 - Part 3: Allow references to static, single-generic C++ SharedFontList objects from Rust FontFamilyList. r=emilio
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
2019-03-30 00:15:51 +00:00
Cameron McCormack
7649df02be Bug 1474793 - Part 2: Allow references to static C++ URLExtraData objects from Rust UrlExtraData. r=emilio
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
2019-03-30 00:15:43 +00:00
Masayuki Nakano
de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25338

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +00:00
Dorel Luca
5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano
9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25338

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
Emilio Cobos Álvarez
859ca6ad05 Bug 1540093 - Unship line-height: -moz-block-height. r=mats
They're only used in forms.css, and only for some anonymous content, which are
not content-accessible in the first place.

The only place where this could be exposed is calling
getComputedStyle(input, "::placeholder"), so I think this should be pretty safe,
but I've added a pref just in case.

While at it, also derive the Parse implementation. Less code is better.

Differential Revision: https://phabricator.services.mozilla.com/D25118

--HG--
extra : moz-landing-system : lando
2019-03-29 11:11:27 +00:00
Emilio Cobos Álvarez
3514c8548d Bug 1540093 - Refactor some enabledness checks. r=mats
There are some common checks that could get some easy-to-use aliases.

Differential Revision: https://phabricator.services.mozilla.com/D25117

--HG--
extra : moz-landing-system : lando
2019-03-29 11:12:12 +00:00
Emilio Cobos Álvarez
c752cecc84 Bug 1538589 - Fix ::marker invalidation when we need to potentially insert a marker as a result of a style change. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D24888

--HG--
extra : moz-landing-system : lando
2019-03-28 13:50:13 +00:00
Emilio Cobos Álvarez
992c298f60 Bug 1539267 - Bug 1539171 - Follow the list-item definition from the spec a bit more closely. r=mats
The HTML restriction doesn't match any browser.

This matches Edge, though I filed
https://github.com/w3c/csswg-drafts/issues/3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

--HG--
extra : moz-landing-system : lando
2019-03-27 15:03:20 +00:00
Emilio Cobos Álvarez
cfa6b9a741 Bug 1529681 - Update bindgen. r=bbouvier
This works around an LLVM bug and also pulls a fair amount of bugfixes and perf
improvements. None of the breaking changes affect either the style system or
cranelift stuff.

Changelog for convenience:

https://github.com/rust-lang/rust-bindgen/compare/v0.43.2...v0.49.0

Differential Revision: https://phabricator.services.mozilla.com/D20899

--HG--
extra : moz-landing-system : lando
2019-03-27 14:39:41 +00:00
Julian Descottes
04ab3b18ed Bug 1537876 - Augment CSS errors with the CSS selector r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D24894

--HG--
extra : moz-landing-system : lando
2019-03-27 12:12:55 +00:00
Emilio Cobos Álvarez
4a1b23092d Bug 1539326 - Fix servo build, and appease tidy checks. 2019-03-27 03:16:37 +01:00
Peter Hall
32484d9bdf Bug 1539326 - Cherry-pick changes for servo/servo#8539 (config preferences backend restructure). r=npotb 2019-03-27 03:16:24 +01:00
Emilio Cobos Álvarez
300bf233c5 Bug 1536718 - Honor browser.display.use_document_fonts again. r=manishearth,jwatt
Differential Revision: https://phabricator.services.mozilla.com/D24218

--HG--
extra : moz-landing-system : lando
2019-03-26 18:42:27 +00:00
Emilio Cobos Álvarez
58f4eeb7f4 Bug 1536584 - Remove bindings.rs. r=xidorn
I kept it building the most straight-forward way possible (pub use) because it
seems to me that bindings is not a bad name, and we should probably move
structs.rs to be bindings.rs rather than the other way around.

But that's a different bug in any case, need to think more about it.

Differential Revision: https://phabricator.services.mozilla.com/D24713

--HG--
extra : moz-landing-system : lando
2019-03-26 18:15:47 +00:00
Emilio Cobos Álvarez
b3c3646515 Bug 1538694 - Cleanup refcounted types. r=boris
And make the handling of ComputedStyle more similar to these.

Differential Revision: https://phabricator.services.mozilla.com/D24703

--HG--
extra : moz-landing-system : lando
2019-03-26 18:16:01 +00:00
Emilio Cobos Álvarez
72c43d2bf2 Bug 1538661 - Simplify Owned FFI types. r=boris
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
2019-03-26 18:15:59 +00:00
Bogdan Tara
b68e341245 Backed out 4 changesets (bug 1536584, bug 1538661, bug 1538694) for causing build bustages CLOSED TREE
Backed out changeset 563e8fb1be5d (bug 1538694)
Backed out changeset 7bd834c5800c (bug 1536584)
Backed out changeset f1eec8f7a3f8 (bug 1538694)
Backed out changeset 73a48619739e (bug 1538661)
2019-03-26 16:40:20 +02:00
Emilio Cobos Álvarez
a072622b02 Bug 1536584 - Remove bindings.rs. r=xidorn
I kept it building the most straight-forward way possible (pub use) because it
seems to me that bindings is not a bad name, and we should probably move
structs.rs to be bindings.rs rather than the other way around.

But that's a different bug in any case, need to think more about it.

Differential Revision: https://phabricator.services.mozilla.com/D24713

--HG--
extra : moz-landing-system : lando
2019-03-26 13:38:14 +00:00
Emilio Cobos Álvarez
45bc2e8f6c Bug 1538694 - Cleanup refcounted types. r=boris
And make the handling of ComputedStyle more similar to these.

Differential Revision: https://phabricator.services.mozilla.com/D24703

--HG--
extra : moz-landing-system : lando
2019-03-26 13:26:33 +00:00
Emilio Cobos Álvarez
16705172ca Bug 1538661 - Simplify Owned FFI types. r=boris
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
2019-03-26 13:25:42 +00:00
Mats Palmgren
4b5f164752 Bug 205202 part 3 - [css-lists][css-pseudo] Add support for the 'content' CSS property on ::marker pseudo elements. r=emilio 2019-03-24 23:13:53 +01:00
Mats Palmgren
53f517142f Bug 205202 part 1 - [css-lists][css-pseudo] Add support for the ::marker pseudo element on list items. Alias :-moz-list-bullet/number to that in the parser. r=emilio 2019-03-24 23:13:53 +01:00
Mats Palmgren
c750eaac07 Bug 288704 part 2 - [css-lists] Implement display:list-item counters using a built-in 'list-item' CSS counter. r=emilio 2019-03-24 23:13:52 +01:00
Mats Palmgren
f46136021c Bug 288704 part 1 - [css-lists] Add an inherited internal UA sheet property (-moz-list-reversed:true|false) to propagate <ol reversed> to its relevant decendants. r=emilio 2019-03-24 23:13:52 +01:00
Mats Palmgren
426b73e37a Bug 1518201 - [css-lists] Implement the counter-set property. r=emilio 2019-03-24 23:13:52 +01:00
Emilio Cobos Álvarez
022828031e Bug 1536586 - followup of the followup: Remove unused #[macro_use] in 32-bit builds.
CLOSED TREE
2019-03-22 00:09:22 +01:00
Emilio Cobos Álvarez
718605a203 Bug 1536586 - followup: Remove unused #[macro_use]s.
CLOSED TREE
2019-03-21 23:43:13 +01:00
Emilio Cobos Álvarez
ad066f1df7 Bug 1536586 - Simplify a bit our generated bindings by getting rid of FooBorrowed and FooBorrowedMut. r=heycam
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
2019-03-21 17:00:27 +00:00
Cameron McCormack
0b3540c9bb Bug 282126 - Part 4: Use horizontal metrics for ch in vertical mixed/sideways writing modes and for ex always. r=emilio
Depends on D23425

Differential Revision: https://phabricator.services.mozilla.com/D23426

--HG--
extra : moz-landing-system : lando
2019-03-21 04:50:47 +00:00
Cameron McCormack
076c3e7246 Bug 282126 - Part 2: Allow FontMetricsProvider to produce ex height and zero width independently. r=emilio
We are always able to produce an x height, but depending on whether the
glyph exists, we sometimes can't produce a zero glyph width.

Depends on D23423

Differential Revision: https://phabricator.services.mozilla.com/D23424

--HG--
extra : moz-landing-system : lando
2019-03-21 04:50:43 +00:00
Emilio Cobos Álvarez
0f9d0b6755 Bug 1537576 - fix some rust-nightly warnings about unused doc comments. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D24287

--HG--
extra : moz-landing-system : lando
2019-03-20 22:47:30 +00:00
Emilio Cobos Álvarez
fcc161a573 Bug 1516780 - Remove ComputedStyle::mBits. r=jfkthame,heycam
Use the Servo flags instead.

Differential Revision: https://phabricator.services.mozilla.com/D20729

--HG--
extra : moz-landing-system : lando
2019-03-19 21:10:30 +00:00
Emilio Cobos Álvarez
c9b429b7f8 Bug 1516780 - Keep track of whether a style is affected by font metrics. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D20728

--HG--
extra : moz-landing-system : lando
2019-03-19 21:10:13 +00:00
Boris Chiou
cbef6a9f42 Bug 1425837 - Part 6: Add individual transform properties into compositor animation list. r=hiro
Now, its time to let individual transform run on the compositor thread.

Depends on D19636

Differential Revision: https://phabricator.services.mozilla.com/D22566

--HG--
extra : moz-landing-system : lando
2019-03-18 18:05:00 +00:00
Boris Chiou
92fcc151e4 Bug 1425837 - Part 4: Implement compositor animations on translate/rotate/scale. r=hiro,birtles
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
2019-03-18 18:04:50 +00:00
Emilio Cobos Álvarez
5bf307c2a8 Bug 1535165 - Make the will-change bitfield use cbindgen. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D23414

--HG--
extra : moz-landing-system : lando
2019-03-18 18:08:08 +00:00
Emilio Cobos Álvarez
70e3f8ffcd Bug 1535165 - Use cbindgen for touch-action. r=dholbert
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
2019-03-18 18:01:55 +00:00
Emilio Cobos Álvarez
e66fb8488c Bug 1535165 - Use cbindgen for text-decoration-line. r=dholbert,boris
Differential Revision: https://phabricator.services.mozilla.com/D23412

--HG--
extra : moz-landing-system : lando
2019-03-18 17:58:16 +00:00
Emilio Cobos Álvarez
09763b1ac3 Bug 1533201 - Make cssPropertySupportsType take an enum. r=heycam,rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D22427

--HG--
extra : moz-landing-system : lando
2019-03-18 16:38:48 +00:00
Emilio Cobos Álvarez
63dc1243e4 Bug 1529537 - Make all font-metrics-affecting properties cascade early. r=heycam
And make font-size computation work on the whole font of the parent, not just
accounting for the parent's font-size.

Differential Revision: https://phabricator.services.mozilla.com/D20656

--HG--
extra : moz-landing-system : lando
2019-03-18 16:27:54 +00:00
Emilio Cobos Álvarez
ac54c9333b Bug 1534494 - Try to bring some more sanity into our font code. r=manishearth
It's not very easy to understand on its current state, and it causes subtle bugs
like bug 1533654.

It could be simpler if we centralized where the interactions between properties
are handled. This patch does this.

This patch also changes how MathML script sizes are tracked when scriptlevel
changes and they have relative fonts in between.

With this patch, any explicitly specified font-size is treated the same (being a
scriptlevel boundary), regardless of whether it's either an absolute size, a
relative size, or a wide keyword.

Relative lengths always resolve relative to the constrained size, which allows
us to avoid the double font-size computation, and not give up on sanity with
keyword font-sizes.

I think given no other browser supports scriptlevel it seems like the right
trade-off.

Differential Revision: https://phabricator.services.mozilla.com/D23070

--HG--
extra : moz-landing-system : lando
2019-03-18 15:37:03 +00:00
Emilio Cobos Álvarez
4baf60220e Bug 1533654 - Don't call PrefillDefaultForGeneric when inheriting font-family. r=heycam
This is the low-risk fix for this issue, that we should get into 67.

What's going on here is that font-family is tracked via the font list, from the
POV of the style system the font list is generally just the
RefPtr<SharedFontList>, but in Gecko there's also mDefaultGenericId.

The way we end up with the right mDefaultGenericId is fishy at best, bogus at
worst. I left various fixmes over time related to a bunch of this code.

After my patch, we end up with a mDefaultGenericId of serif, rather than the
right one (none).

The parent font always has none because nsLayoutUtils::ComputeSystemFont always
sets it to none if the font is known.

Before my patch, PrefillDefaultForGeneric with aGenericId of none (from the
parent), which makes it the default generic id for the current language, serif
in this case.

Before my optimization, apply_declaration_ignoring_phase called
copy_font_family_from, which resets both the font list _and_ the default
generic.

This patch achieves the same effect by not having the first mutation in the
first place.

This code is still terribly fishy in any case, all the _skip_font_family stuff
is just ridiculous. I'll try to clean up a bit after this, but for 68.

Differential Revision: https://phabricator.services.mozilla.com/D23026

--HG--
extra : moz-landing-system : lando
2019-03-12 00:48:27 +00:00
Emilio Cobos Álvarez
4c1252347e Bug 1533783 - Avoid crashing when calling insertRule("@import ...") on a detached sheet. r=heycam
This should unblock the fuzzers for now, though it's not the ideal solution.

It's the only reasonably easy solution to unblock them though, I think.

We should probably always keep track of the document a stylesheet was associated
with. We'll need that for constructible stylesheets anyway.

That requires some though on how to get the cycle-collection and such right,
though, and I wouldn't be able to write or land that ASAP.

Differential Revision: https://phabricator.services.mozilla.com/D23584

--HG--
extra : moz-landing-system : lando
2019-03-14 22:30:37 +00:00
Emilio Cobos Álvarez
5aa8533517 Bug 1533963 - Use a single RestyleHint representation. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D22828

--HG--
extra : moz-landing-system : lando
2019-03-14 11:47:50 +00:00
Emilio Cobos Álvarez
44b112b7e7 Bug 1535084 - followup: Add a comment to unbust the tree.
CLOSED TREE
2019-03-13 22:29:46 +01:00
Emilio Cobos Álvarez
e4b13f1adb Bug 1535084 - Cleanup contain property. r=dholbert
Now that cbindgen supports bitflags, this is trivial.

Differential Revision: https://phabricator.services.mozilla.com/D23371

--HG--
extra : moz-landing-system : lando
2019-03-13 19:55:54 +00:00
Emilio Cobos Álvarez
1d17f71255 Bug 1534726 - Fix servo build. 2019-03-12 19:01:35 +01:00
Emilio Cobos Álvarez
b3bd9a6099 Bug 1534726 - Reformat recent style system changes. 2019-03-12 19:01:28 +01:00
violet
7d525e84a8 Bug 1508028 - Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber. r=longsonr,emilio 2019-03-09 13:05:56 +00:00
Emilio Cobos Álvarez
6fa29022c2 Bug 1215878 - Optimize cascading of other wide keywords if possible. r=xidorn
The way the copy-on-write stuff works, and the way that we have to apply
properties from most specific to less specific guarantees that always that we're
going to inherit an inherited property, or reset a reset property, we have
already the right value on the style.

Revert relies on that, so there doesn't seem to be a reason to not use that fact
more often and skip useless work earlier.

Font-size is still special of course... I think I have a way to move the
specialness outside of the style, but piece by piece.

Differential Revision: https://phabricator.services.mozilla.com/D21882

--HG--
extra : moz-landing-system : lando
2019-03-07 12:48:07 +00:00
Emilio Cobos Álvarez
0b5807bc62 Bug 1215878 - Implement CSS revert keyword. r=heycam,birtles
The only fishy bit is the animation stuff. In particular, there are two places
where we just mint the revert behavior:

 * When serializing web-animations keyframes (the custom properties stuff in
   declaration_block.rs). That codepath is already not sound and I wanted to
   get rid of it in bug 1501530, but what do I know.

 * When getting an animation value from a property declaration. At that point
   we no longer have the CSS rules that apply to the element to compute the
   right revert value handy. It'd also use the wrong style anyway, I think,
   given the way StyleBuilder::for_animation works.

   We _could_ probably get them out of somewhere, but it seems like a whole lot
   of code reinventing the wheel which is probably not useful, and that Blink
   and WebKit just cannot implement either since they don't have a rule tree,
   so it just doesn't seem worth the churn.

The custom properties code looks a bit different in order to minimize hash
lookups in the common case. FWIW, `revert` for custom properties doesn't seem
very useful either, but oh well.

Differential Revision: https://phabricator.services.mozilla.com/D21877

--HG--
extra : moz-landing-system : lando
2019-03-07 11:59:36 +00:00
Emilio Cobos Álvarez
c6307e16b7 No bug - fix a typo.
DONTBUILD
2019-03-07 00:15:49 +01:00
Emilio Cobos Álvarez
be8ce9ba8a Bug 1532135 - followup: Add a comment as requested on Phabricator. 2019-03-07 00:15:47 +01:00
Emilio Cobos Álvarez
cb19991fd7 Bug 1533142 - Use more cbindgen features. r=kats
We can get back the fancy flag syntax as soon as we get C++17 inline variables,
which I sent an email to dev-platform@ about, with no reply.

Differential Revision: https://phabricator.services.mozilla.com/D22382

--HG--
extra : moz-landing-system : lando
2019-03-06 23:01:11 +00:00
Emilio Cobos Álvarez
eda315e71c Bug 1532135 - Derive more stuff for clip rects. r=boris
I feel a bit weird for using LenghtPercentageOrAuto to implement LengthOrAuto,
but I don't think much other code will use it so it seemed a bit better to me.

Differential Revision: https://phabricator.services.mozilla.com/D21863

--HG--
extra : moz-landing-system : lando
2019-03-06 21:37:48 +00:00
Emilio Cobos Álvarez
2028cb1479 Bug 1530751 - Make the pres context optional in the style system. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D21239

--HG--
extra : moz-landing-system : lando
2019-03-06 21:36:12 +00:00
Emilio Cobos Álvarez
8c9a745531 Bug 1530193 - Refactor preference stylesheet prefs to not require a pres context. r=jwatt
We really only have two sets of prefs, one for chrome-like documents
(stuff in chrome docshells + chrome-origin images), and one for the rest.

Differential Revision: https://phabricator.services.mozilla.com/D20946

--HG--
extra : moz-landing-system : lando
2019-03-06 21:34:30 +00:00
Daniel Holbert
1467eb13b8 Bug 1530896: Drop css parser support for 'contain:style'. r=emilio
We're not sure we're going to ship support for this value, and it's been marked
as 'at-risk' in the spec, so let's stop pretending we support it in the parser.

Spec issue:
https://github.com/w3c/csswg-drafts/issues/3280

Differential Revision: https://phabricator.services.mozilla.com/D22203

--HG--
extra : moz-landing-system : lando
2019-03-06 20:44:37 +00:00
Emilio Cobos Álvarez
25098daaaa Bug 1532122 - Make word-spacing, letter-spacing, and line-height use Rust lengths. r=boris
This also adopts the resolution from [1] while at it, making letter-spacing
compute to a length, serializing 0 to normal rather than keeping normal in the
computed value, which matches every other engine.

This removes the SMIL tests for percentages from letter-spacing since
letter-spacing does in fact not support percentages, so they were passing just
by chance.

[1]: https://github.com/w3c/csswg-drafts/issues/1484

Differential Revision: https://phabricator.services.mozilla.com/D21850

--HG--
extra : moz-landing-system : lando
2019-03-04 18:19:40 +00:00
Emilio Cobos Álvarez
dc03ea30c7 Bug 1532134 - Remove Options from TransformOperation. r=xidorn
This may or may not be part of the plan to get rid of nsCSSValue ;)

Option is not usable via FFI, and they should not be needed (we should be
following the shortest serialization principle instead). These patches also do
that, which matches the other transform properties. I think that slight change
is fine, if we can make it work, and consistent with other properties.

Alternative is adding more TransformOperation variants or such, which I rather
not do.

Differential Revision: https://phabricator.services.mozilla.com/D21862

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:54 +00:00
Emilio Cobos Álvarez
c3755249b4 Bug 1532134 - Use contextual_skip_if for background-size. r=xidorn
Also drive-by cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D21861

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:40 +00:00