Commit Graph

12616 Commits

Author SHA1 Message Date
violet
d5bbf998dd Bug 1351432 - Implement the break-spaces value of the white-space property r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D34499

--HG--
extra : moz-landing-system : lando
2019-06-12 10:23:49 +00:00
Boris Chiou
d6e5792aff Bug 1542064 - Add MOZ_DBG support for AnimationValue. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D33357

--HG--
extra : moz-landing-system : lando
2019-06-12 18:14:18 +00:00
Emilio Cobos Álvarez
8381c5ce61 Bug 1505489 - Add a pref and enable Shadow Parts in Nightly and for chrome stylesheets. r=heycam
I want to enable in Nightly to evaluate (in the medium term) shipping it without
the part forwarding, once the cascade order and importance issues are fixed, and
that we pass all the tests that don't involve forwarding.

That is, I want to monitor whether having ::part() causes compat issues or not.

Depends on D32648

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:42:58 +00:00
Emilio Cobos Álvarez
72a9fa3730 Bug 1505489 - Implement GeckoElement::each_part. r=heycam
This should make all the pieces come together.

Note that we don't need to look at the snapshot for ::part() for now (other than
when selector-matching normally) because I decided to just restyle the element
for now when the part attribute changes.

::part() can't affect descendants anyway (as long as we don't do the forwarding
stuff), and eager pseudo-elements are handled during the normal element restyle,
so it seems to me that adding all the complexity that we have for classes to
part may not be worth it at least yet.

Depends on D32647

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:42:49 +00:00
Emilio Cobos Álvarez
3685cf25a7 Bug 1505489 - Add code to make part rules affect the style of the elements. r=heycam
I still haven't implemented each_part(), so this will do nothing yet.

The cascade order stuff is fishy, I know, and I'll fix in a followup if it's
fine with you. I moved the sorting of the rules to rule_collector, since it
seemed to me it was better that way that duplicating the code, and those
SelectorMap functions only have a single caller anyway.

Depends on D32646

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:42:41 +00:00
Emilio Cobos Álvarez
838e209b31 Bug 1505489 - Collect ::part() rules during CascadeData rebuilds. r=heycam
Unlike for :host() or ::slotted(), or regular rules, we don't need a whole
SelectorMap<>, so gotta make the code a bit more generic.

Depends on D32645

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:42:32 +00:00
Emilio Cobos Álvarez
b2875e0362 Bug 1505489 - Add an extra flag to flag ::part() to selectors. r=heycam
This grows the selector struct, but only in 32-bit, since in 64-bit we take
space from the alignment padding that we're paying due to having the size of the
slice as a word.

Depends on D32644

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:42:23 +00:00
Emilio Cobos Álvarez
0d984c302b Bug 1505489 - Don't go through all the part names if not there. r=jwatt
This uses the bit added for tracking part attributes in order to avoid doing
wasted work.

Depends on D32643

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:42:09 +00:00
Emilio Cobos Álvarez
103cf22ede Bug 1505489 - Add plumbing code to invalidate shadow parts. r=heycam
Still does nothing, since we still do not collect part rules, but this is all
the plumbing that should allow us to invalidate parts when attributes or state
change on their ancestors.

Depends on D32641

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:41:51 +00:00
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