Commit Graph

12317 Commits

Author SHA1 Message Date
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