Commit Graph

12699 Commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
1103c6531f Bug 1532134 - Use skip_if for translate serialization. r=xidorn
Trivial drive-by cleanup.

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

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:30 +00:00
Emilio Cobos Álvarez
2ade1e5e73 Bug 1532134 - When deriving something with an output type, map preconditions as well. r=xidorn
Otherwise, deriving ToComputedValue and ToAnimatedValue in structs or enums with
other where clauses just doesn't work.

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

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:21 +00:00
Emilio Cobos Álvarez
5bea6a1b83 Bug 1532134 - Implement a version of #[css(skip_if)] that takes more context. r=xidorn
I called it contextual_skip_if, though better names welcome.

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

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:06 +00:00
Emilio Cobos Álvarez
f02f6a3545 Bug 1218257 - Use rust lengths for the SVG lengths. r=boris
As it turns out we need this to avoid losing precision both during painting and
during serialization.

This patch also changes to serialize `context-value` if it's the computed value.

I could keep the previous behavior, but it makes no sense to serialize the
initial value. We're the only ones to support this value anyway, and I couldn't
find a definition or spec for this.

Also update tests and expectations for:

 * New unexpected passes.
 * Always serializing the unit in getComputedStyle.
 * Calc and interpolation support.

Chrome also always serializes the unit in getComputedStyle, so I'm pretty sure
this is compatible with them. Chrome is inconsistent and keeps numbers in
specified style, but that's inconsistent with itself and with other quirky
lengths, so I updated the tests instead.

Differential Revision: https://phabricator.services.mozilla.com/D21819
2019-03-03 00:16:24 +01:00
Emilio Cobos Álvarez
7e10c7b612 Bug 1218257 - Cleanup and fix interpolation of SVG lengths. r=boris
Instead of storing them as LengthPercentage | Number, always store as
LengthPercentage, and use the unitless length quirk to parse numbers instead.

Further cleanups to use the rust representation can happen as a followup, which
will also get rid of the boolean argument (since we can poke at the rust length
itself). That's why I didn't bother to convert it to an enum class yet.

Differential Revision: https://phabricator.services.mozilla.com/D21804
2019-03-03 00:16:13 +01:00
Emilio Cobos Álvarez
3d044b1111 Bug 1296042 - Make word-break: break-word behave like word-break: normal; overflow-wrap: anywhere. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D21398

--HG--
extra : moz-landing-system : lando
2019-03-01 02:33:07 +00:00
Emilio Cobos Álvarez
5eb5f7eff7 Bug 1530847 - Add a Zero trait that doesn't require Add, and use it in place of num_traits and IsZeroLength. r=heycam
Use it to be consistent in InsetRect serialization and storage between Servo and
Gecko.

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

--HG--
extra : moz-landing-system : lando
2019-02-28 19:03:03 +00:00
Emilio Cobos Álvarez
90554be433 Bug 1530826 - Fix computed value clamping. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D21268

--HG--
extra : moz-landing-system : lando
2019-02-26 23:34:25 +00:00
Emilio Cobos Álvarez
b7bb398730 Bug 1516454 - Use rust lengths for border corners. r=boris
The test in https://github.com/web-platform-tests/wpt/pull/15423 hasn't been
synced over yet, but it passes with this patch of course.

Differential Revision: https://phabricator.services.mozilla.com/D20960
2019-02-26 06:01:34 -08:00
Hiroyuki Ikezoe
43d46aa4b7 Bug 1530571 - Explicitly specify animation_value_type for scroll-padding. r=boris
Otherwise the Trait for clamping negative animation value isn't generated thus
negative animating results are exposed in computed values.

Depends on D21152

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

--HG--
extra : moz-landing-system : lando
2019-02-26 10:17:25 +00:00
Cosmin Sabou
a499294d09 Backed out 4 changesets (bug 1516454, bug 1530247) for multiple failures on Linux x64 asan. CLOSED TREE
Backed out changeset 180c7672c57c (bug 1516454)
Backed out changeset a460a4d0a66c (bug 1516454)
Backed out changeset c6ab8d3dd19a (bug 1530247)
Backed out changeset 43862dc87e0b (bug 1516454)
2019-02-26 00:49:27 +02:00
Emilio Cobos Álvarez
b411b3894d Bug 1516454 - Use rust lengths for border corners. r=boris
The test in https://github.com/web-platform-tests/wpt/pull/15423 hasn't been
synced over yet, but it passes with this patch of course.

Differential Revision: https://phabricator.services.mozilla.com/D20960
2019-02-25 12:42:31 -08:00
Cosmin Sabou
2bc99829bf Backed out changeset 4d220064bcf8 (bug 1529681) for causing Windows 2012 AArch64 build bustages. CLOSED TREE
--HG--
extra : histedit_source : a68af39c236effa1c63bb091f4f72146c84a1be3
2019-02-25 20:31:13 +02:00
Emilio Cobos Álvarez
a185f2109d Bug 1516454 - Make the generic size not use euclid under the hood. r=firefox-style-system-reviewers,boris
The euclid size is not really used for anything. Also rename it to Size2D to
avoid cbindgen conflicts with values::length::Size.

Depends on D20958

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

--HG--
extra : moz-landing-system : lando
2019-02-25 03:05:39 +00:00
Emilio Cobos Álvarez
76fb626711 Bug 1516454 - Simplify border-radius serialization. r=firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D20958

--HG--
extra : moz-landing-system : lando
2019-02-25 03:03:15 +00:00
Emilio Cobos Álvarez
a970076f63 Bug 1529681 - Update bindgen. r=bbouvier 2019-02-25 09:51:02 -08:00
Andreea Pavel
6d82da21f3 Backed out changeset e99833064d36 (bug 1529681) for build bustages on a CLOSED TREE 2019-02-25 18:44:17 +02:00
Emilio Cobos Álvarez
66f3c5b7eb 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.47.2

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

--HG--
extra : moz-landing-system : lando
2019-02-25 09:43:11 +00:00
Boris Chiou
542cdbc4f0 Bug 1529422 - Part 2: Let GetScaleValue support individual transforms. r=hiro,emilio
So we can let KeyframeEffect::ContainsAnimatedScale check individual
transforms, which is used by ActiveLayerTracker.

Depends on D19631

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

--HG--
extra : moz-landing-system : lando
2019-02-24 03:27:51 +00:00
Emilio Cobos Álvarez
d0982a7b89 No bug - Appease tidy. r=whitespace-only 2019-02-23 21:13:19 -08:00
Emilio Cobos Álvarez
b45ffb4f71 No bug - Remove unnecessary derive. r=npotb 2019-02-23 21:13:17 -08:00
Emilio Cobos Álvarez
c59f73ed00 No bug - Rustfmt recent changes. r=whitespace-only 2019-02-23 21:13:15 -08:00
Emilio Cobos Álvarez
99549860f7 Bug 1529058 - Use Rust types from transform-origin / perspective-origin. r=mattwoodrow
Depends on D20381

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

--HG--
extra : moz-landing-system : lando
2019-02-19 20:28:47 +00:00
Emilio Cobos Álvarez
c4ae51b99d Bug 1529058 - Use Rust types for perspective and z-index. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D20381

--HG--
extra : moz-landing-system : lando
2019-02-19 23:04:45 +00:00
Asfiya
2b8ec74bf6 Bug 1528940 - convert NS_STYLE_FLEX_DIRECTION to an enum class in nsStyleConsts.h r=emilio
Converted the #define variable NS_STYLE_FLEX_DIRECTION to an enum class in nsStyleConsts.h and made changes in other files that access it

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

--HG--
extra : moz-landing-system : lando
2019-02-19 17:01:59 +00:00
scharing
87df459a63 Bug 1528464 - Convert NS_STYLE_MASK_MODE_* to enum class r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D20063

--HG--
extra : moz-landing-system : lando
2019-02-19 16:54:52 +00:00
Emilio Cobos Álvarez
bf84e7fd35 Bug 1528035 - Improve #[derive(Parse)]. r=xidorn
I want to do this so that I can get rid of Either<>. The reasons for getting rid
of either is multiple:

 * It doesn't generate as nice C++ code using cbindgen.
 * It isn't that nice to use either from Rust.
 * cbindgen has bugs with zero-sized types.

I started using this for ColorOrAuto and a few others, for now.

Differential Revision: https://phabricator.services.mozilla.com/D19844
2019-02-19 15:22:55 +01:00
Emilio Cobos Álvarez
c9cb04e111 Bug 1527972 - Use Rust types for some misc properties. r=jwatt
-moz-tab-size, border-image-outset and border-image-slice.

This is not a particularly interesting patch, just removes some code. We can
remove way more code when a few related properties are also ported.

Differential Revision: https://phabricator.services.mozilla.com/D19825
2019-02-19 15:22:40 +01:00
Emilio Cobos Álvarez
d2cbf071d5 Bug 1528712 - Remove nsFont::featureValueLookup. r=jfkthame
It's a global object, it doesn't have to be stored in nsFont. Pass it from the
caller like the user font set and co.

Depends on D20141

Differential Revision: https://phabricator.services.mozilla.com/D20142
2019-02-19 14:54:04 +01:00
Emilio Cobos Álvarez
8ccb77e27d Bug 1528712 - Remove a couple trivial dependencies on nsPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D20141
2019-02-19 14:54:01 +01:00
Emilio Cobos Álvarez
dad3a20b22 Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam
This is more consistent with what the Rust bits of the style system do, and
removes a pointer from ComputedStyle which is always nice.

This also aligns the Rust bits with the C++ bits re. not treating xul pseudos as
anonymous boxes. See the comment in nsTreeStyleCache.cpp regarding those.

Can't wait for XUL trees to die.

Depends on D19001

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

--HG--
extra : moz-landing-system : lando
2019-02-19 13:44:33 +00:00
Ciure Andrei
965d533ca4 Backed out 2 changesets (bug 1528712) for Linux spcshell and reftest failures (test_ext_browserSettings.js, 1022481-1.html) CLOSED TREE
Backed out changeset 2d5c4e71e258 (bug 1528712)
Backed out changeset d981515b874b (bug 1528712)
2019-02-19 14:25:57 +02:00
Emilio Cobos Álvarez
f97a9f50a2 Bug 1528712 - Remove nsFont::featureValueLookup. r=jfkthame
It's a global object, it doesn't have to be stored in nsFont. Pass it from the
caller like the user font set and co.

Depends on D20141

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

--HG--
extra : moz-landing-system : lando
2019-02-18 14:03:47 +00:00
Emilio Cobos Álvarez
522e6c9366 Bug 1528712 - Remove a couple trivial dependencies on nsPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D20141

--HG--
extra : moz-landing-system : lando
2019-02-19 11:17:28 +00:00
Hiroyuki Ikezoe
64a777f7b5 Bug 1528834 - Implement scroll-snap-align parser and serializer. r=emilio
https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align

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

--HG--
extra : moz-landing-system : lando
2019-02-18 23:10:08 +00:00
Hiroyuki Ikezoe
0a5721ad9c Bug 1528640 - Implement scroll-padding parser and serializer. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D20103

--HG--
extra : moz-landing-system : lando
2019-02-18 02:46:09 +00:00
Hiroyuki Ikezoe
842f78da12 Bug 1528639 - Implement scroll-margin parser and serializer. r=emilio
The reason why we use  RelaxedAtomBoolis that
ScrollSnapUtils::GetSnapPointForDestination() is called both from the main and
the compositor threads, and the function will have a branch depending on the
pref value.

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

--HG--
extra : moz-landing-system : lando
2019-02-18 02:25:54 +00:00
Jonathan Kingston
83bd9bdac8 Bug 1494034 - Add support for CSS prefers-color-scheme media feature. r=emilio 2019-02-15 21:40:35 +01:00
Cosmin Sabou
a4b19fcd61 Merge mozilla-inbound to mozilla-central. a=merge
--HG--
rename : browser/components/nsBrowserContentHandler.js => browser/components/BrowserContentHandler.jsm
2019-02-15 20:39:45 +02:00
Brian Birtles
95e299f85d Bug 1524480 - Don't share styles when an element has animations applied to it; r=emilio
We already avoid putting styles in the shared style cache for an element that
has animations[1] but if we are doing the initial style of two siblings where
the _second_ has animations applied, there is nothing to stop us from trying to
share with the first (un-animated) element. This patch adds a check to prevent
sharing in that case since sharing style between animated elements is unsound
for the reasons described in [1].

A number of tests including:

  testing/web-platform/tests/web-animations/animation-model/animation-types/visibility.html

will fail without this fix once we remove the style flush from
KeyframeEffect::SetKeyframes later in this patch series.

[1] https://searchfox.org/mozilla-central/rev/6e3cc153566f5f288ae768a2172385b8436d61dd/servo/components/style/sharing/mod.rs#597

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

--HG--
extra : moz-landing-system : lando
2019-02-15 06:35:04 +00:00
Emilio Cobos Álvarez
9db2ce6d9b Bug 1527542 - Use rust types for background-size. r=jwatt
Hopefully straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D19625
2019-02-15 04:09:26 +01:00
Emilio Cobos Álvarez
95454d416b Bug 1527438 - Use Rust types for Position. r=jwatt
This one should be much easier to review / much more pleasant to see :-)

Differential Revision: https://phabricator.services.mozilla.com/D19563
2019-02-15 04:05:32 +01:00
Emilio Cobos Álvarez
aec730ed7d Bug 1527410 - Preserve calc() rounding behavior. r=heycam,jrmuizel
See the comment. I don't really this is ideal, I filed bug 1528114 to
investigate changing that.

Differential Revision: https://phabricator.services.mozilla.com/D19584
2019-02-15 03:59:34 +01:00
Emilio Cobos Álvarez
e9ae3b0907 Bug 1527410 - Use Rust sizes for flex-basis, width, height, and their min/max properties. r=jwatt
Really sorry for the size of the patch :(

Only intentional behavior change is in the uses of HasLengthAndPercentage(),
where it's easier to do the right thing. The checks that used to check for
(IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915.

Differential Revision: https://phabricator.services.mozilla.com/D19553
2019-02-15 03:59:31 +01:00
Emilio Cobos Álvarez
dc933f3117 Bug 1526736 - Rename MozLength to Size, and MaxLength to MaxSize. r=heycam
MozLength is not a very descriptive name. If we're going to use it in both Gecko
and Servo we may as well name it something more accurate.

I would've chosen `ContentSize` per CSS2[1][2] if it wasn't a lie in presence
of box-sizing. I don't have better ideas than `Size`, given that.

[1]: https://drafts.csswg.org/css2/visudet.html#propdef-width
[2]: https://drafts.csswg.org/css2/box.html#content-width

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

--HG--
extra : moz-landing-system : lando
2019-02-11 10:59:49 +00:00
Alan Jeffrey
9dbc608ab3 No bug - Cherry-pick changes from Servo PR #22825. r=npotb 2019-02-10 06:51:02 +01:00
Emilio Cobos Álvarez
29b0cd4d4c Bug 1523140 - Derive more length stuff, and shrink MaxLength / MozLength's repr(C) representation. r=boris
This patch:

 * Makes LengthPercentageOrAuto generic, and removes a bunch of code fo
   LengthPercentageOrNone, which was used only for servo and now can use the
   normal MaxLength (with a cfg() guard for the ExtremumLength variant).

 * Shrinks MaxLength / MozLength's repr(C) reperesentation by reducing enum
   nesting. The shrinking is in preparation for using them from C++ too, though
   that'd be a different bug.

 * Moves NonNegative usage to the proper places so that stuff for them can be
   derived.

I did this on top of bug 1523071 to prove both that it could be possible and
that stuff wasn't too messy. It got a bit messy, but just because of a bug I
had fixed in bindgen long time ago already, so this updates bindgen's patch
version to grab a fix instead of ugly workarounds :)

Differential Revision: https://phabricator.services.mozilla.com/D17762
2019-02-10 06:51:00 +01:00
Emilio Cobos Álvarez
8101ae2ea8 Bug 1523071 - Use Rust lengths for margin / padding / inset. r=jwatt
Also for the intersection observer root margin, since it was easier to fix it
up and clean it up than not doing it.

This is the first big step to get rid of nscoord. It duplicates a bit of logic
in nsLayoutUtils since for now max/min-width/height are still represented with
nsStyleCoord, but I think I prefer to land this incrementally.

I didn't add helpers for the physical accessors of the style rect sides that
nsStyleSides has (top/bottom/left/right) since I think we generally should
encourage the logical versions, but let me know if you want me to do that.

Differential Revision: https://phabricator.services.mozilla.com/D17739
2019-02-10 04:11:58 +01:00
Emilio Cobos Álvarez
ca19235faa Bug 1523071 - Use the style system's LengthPercentage for shape-margin. r=jwatt
This also makes us pass a few WPTs because we stop losing precision when
serializing the computed value.

Differential Revision: https://phabricator.services.mozilla.com/D17738
2019-02-10 04:11:00 +01:00
Emilio Cobos Álvarez
0b8aea8fdd Bug 1523071 - Add bindings for LengthPercentage, and use it for text-indent. r=jwatt
Which is the only property that uses LengthPercentage alone.

Differential Revision: https://phabricator.services.mozilla.com/D17737
2019-02-10 04:10:24 +01:00
Emilio Cobos Álvarez
286396f97a Bug 1525955 - Cleanup a bit after bug 1525371. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D19001

--HG--
extra : moz-landing-system : lando
2019-02-08 22:40:26 +00:00
Emilio Cobos Álvarez
a820ea341b Bug 1525371 - followup: fix rusttests to reopen the CLOSED TREE. 2019-02-07 11:38:57 +01:00
Emilio Cobos Álvarez
38e4d112d2 Bug 1440384 - Generate combined transform just once. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D18567
2019-02-04 23:14:41 +01:00
Emilio Cobos Álvarez
a155f63750 Bug 1523712 - Make -moz-binding chrome / UA only. r=boris
But enable it in all tests because a lot of them rely on using it in the
style="" attribute for example, or in inline stylesheets, which will no longer
parse this (even in chrome documents), and we don't want to rewrite all the XUL
and XBL tests.

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

--HG--
extra : moz-landing-system : lando
2019-01-30 20:55:54 +00:00
Emilio Cobos Álvarez
6f7882539b No bug - rustfmt recent changes. 2019-01-29 03:22:06 +01:00
Emilio Cobos Álvarez
7c36c5a9ae Bug 1523142 - Simplify some conversion code used for mapped attributes. r=firefox-style-system-reviewers,boris
These days for the types we share computed value representation we don't really
need any special code.

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

--HG--
extra : moz-landing-system : lando
2019-01-28 00:04:06 +00:00
Emilio Cobos Álvarez
1381add9e4 Bug 1521405 - Cleanup a few shorthand properties. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D17082
2019-01-23 18:53:45 +01:00
Bobby Holley
819658d44b Bug 1521187 - Derive more. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D17029
2019-01-22 12:19:22 -08:00