Commit graph

7005 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
7ed3995725
style: Stop using PseudoElement::inherits_all.
This was done that way just because Servo didn't support the `all` property at
the time.

We should do it this way and optimize it if it's slow. Though I suspect that
most of stuff doesn't actually need to be inherited, my patch at bug 1498943
should make it much faster than what it would otherwise be.
2018-10-15 02:17:03 +02:00
Emilio Cobos Álvarez
f287691f2e
style: fix tidy issues and update test expectations. 2018-10-09 22:01:38 +02:00
Emilio Cobos Álvarez
912d65a392
style: Remove some more leftover code.
Differential Revision: https://phabricator.services.mozilla.com/D7755
2018-10-09 19:45:53 +02:00
Emilio Cobos Álvarez
d833754183
style: Remove nsCSSValue usage from font code.
Really sorry for the size of the patch.

Differential Revision: https://phabricator.services.mozilla.com/D7753
2018-10-09 19:45:45 +02:00
Emilio Cobos Álvarez
7345af613a
style: Serialize a bunch of image properties with Servo.
I had to fix the conversion for BackgroundSize too, hopefully we can
simplify all this using cbindgen in the future instead of CalcValue.

Differential Revision: https://phabricator.services.mozilla.com/D7580
2018-10-09 19:45:35 +02:00
Nicholas Nethercote
0d5d5a9c82
style: Make static atom pointers constexpr.
This saves one word per static atom, per process.

The `nsGkAtoms` change is only a small part of this commit.

In regen_atoms.py:

- There is now only one link name per platform: nsGkAtoms::sAtoms[].

- But there is a new constant per atom, giving the index into
  nsGkAtoms::sAtoms[].

- And the `atom!` macro for each atom indexes into nsGkAtoms::sAtoms[] using
  the index constant.

- A couple of `*mut` pointers are now `*const`.

Elsewhere, the `(nsStaticAtom*)` casts within the `AppendElement()` calls are
necessary to avoid link errors, presumably due to some template instantiation
wrinkle.

Bug: 1449787
Reviewed-by: froydnj,emilio
2018-10-09 19:45:10 +02:00
Nicholas Nethercote
c276c8a341
style: Tweak regen_atoms.py.
Specifically, give all the string templates the ''' form, and give them all
`_TEMPLATE` suffixes. This requires slightly changing the newline handling.

Bug: 1449787
Reviewed-by: emilio
2018-10-09 19:44:45 +02:00
Ryan Hunt
7f8a3530a3
style: Implement multi-position gradient color-stops syntax.
This commit adds the multi-position gradient color-stops syntax.

GradientItem::parse_comma_separated is extended to attempt to parse
a LengthOrPercent after each color stop. If it succeeds, it appends
an additional color stop with a duplicate color and the specified
position.

This change is only to the parsing, serialization is left unchanged
as per [1].

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

Differential Revision: https://phabricator.services.mozilla.com/D7380
2018-10-09 19:44:35 +02:00
Emilio Cobos Álvarez
2cf4e9998a
style: Serialize -moz-image-region and clip with Servo.
This changes the serialization of -moz-image-region to be consistent with that
of clip(), but it's an internal property and the specified value is already
serialized by Servo so I think it's the right thing to do.

There are also no internal callers of the getter.

Differential Revision: https://phabricator.services.mozilla.com/D7069
2018-10-09 19:44:21 +02:00
Xidorn Quan
b1cc6b4598
style: Rename pref "layout.css.scrollbar-colors.enabled" to "layout.css.scrollbar-color.enabled".
Differential Revision: https://phabricator.services.mozilla.com/D7030
2018-10-09 19:44:08 +02:00
Martin Stransky
6a1078c551
style: [CSD] Enable round corners by default by -moz-gtk-csd-transparent-background media query.
Replace mozilla.widget.use-argb-visuals pref by
-moz-gtk-csd-transparent-background media query at browser.css to draw
transparent background. The media query is set by toolkit code and enabled when
compatible window manager is detected.

Differential Revision: https://phabricator.services.mozilla.com/D6658
2018-10-09 19:43:50 +02:00
Emilio Cobos Álvarez
2751df808b
style: Don't apply containing shadow-host rules to NAC.
This is a regression from bug 1487856.

Differential Revision: https://phabricator.services.mozilla.com/D6700
2018-10-09 19:43:42 +02:00
Emilio Cobos Álvarez
426683cd4b
style: Remove an outdated comment.
This was fixed, css/css-scoping/shadow-cascade-order-001.html tests it.
2018-10-09 19:43:33 +02:00
Emilio Cobos Álvarez
75bebf1618
style: Avoid walking the rule tree three times from apply_declarations.
Just once is slow enough.

Differential Revision: https://phabricator.services.mozilla.com/D6574
2018-10-09 19:43:26 +02:00
bors-servo
196bec2b87
Auto merge of #21789 - mbrubeck:deps, r=nox
Upgrade to uluru 0.3

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21789)
<!-- Reviewable:end -->
2018-09-23 05:32:17 -04:00
Matt Brubeck
7f4efd4b71 Upgrade to uluru 0.3 2018-09-22 17:24:47 -07:00
bors-servo
d2a79b39c5
Auto merge of #21787 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each individual commit for details.

https://bugzilla.mozilla.org/show_bug.cgi?id=1493435

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21787)
<!-- Reviewable:end -->
2018-09-22 15:11:25 -04:00
Emilio Cobos Álvarez
1954a0a1a1
Partially revert #21746.
This reverts the relevant bits from #21746 so that style and dependencies can
build with stable.

This is important because:

 * `selectors` is a published crate.

 * Gecko compiles with stable (more or less).

I reviewed that PR under the assumption that the union feature was stable, since
untagged unions are stable since 1.19, but turns out that smallvec uses non-Copy
types in unions, which are still unstable.

This leaves the union feature used on Servo, so that it gets testing, taking
advantage of features being additive.
2018-09-22 18:51:42 +02:00
Boris Chiou
e5f8155d6c
style: Flip boolean half way for path interpolation.
According to the new svg 2 spec update (#543), we flip the flag half way for
path interpolation.

Differential Revision: https://phabricator.services.mozilla.com/D6192
2018-09-22 17:54:03 +02:00
Brad Werth
b55bfc49fb
style: Provide a specialized parse_method for mask-image to use CORS.
Differential Revision: https://phabricator.services.mozilla.com/D5714
2018-09-22 17:53:49 +02:00
Emilio Cobos Álvarez
3c6be59d22
style: Back out bug 1481866.
The behavior the WG proposed is way more subtle than what that bug implements,
including:

 * Implementing two logical overflow longhands.
 * Expanding the overflow shorthand to different longhands depending on the
   syntax of that.

Meanwhile, Blink hasn't done the swap and will ship the same behavior that we
shipped in Firefox 61 (bug 1453148), that is, overflow-x, then overflow-y.

So I think lacking a clear way forward we should revert this change and preserve
our shipped behavior.

Differential Revision: https://phabricator.services.mozilla.com/D6317
2018-09-22 17:53:26 +02:00
Xidorn Quan
0bcffa7094
style: Merge the two scrollbar color properties into scrollbar-color.
Differential Revision: https://phabricator.services.mozilla.com/D6115
2018-09-22 17:53:15 +02:00
Jonathan Kew
5c66290142
style: Use nsAtom instead of nsString for FontFamilyName.
Bug: 1490997
Reviewed-by: lsalzman
2018-09-22 17:52:38 +02:00
Andre Bogus
34b5d8fbe8 This updates the smallvec crate and enables the union feature
We had a mix of 0.6.2 and 0.6.5 (which is the current release),
this unifies to the latest version. It also enables the union
feature which removes the discriminant, reducing memory usage.
2018-09-19 07:16:30 +02:00
Emilio Cobos Álvarez
5ab81c4254
style: Make Servo build.
StrongRuleNode is really Sync.
2018-09-18 11:46:23 +02:00
Emilio Cobos Álvarez
4c97f68f3e
Fix tidy issues. 2018-09-18 11:46:01 +02:00
Manish Goregaokar
84ca681a78
servo_arc cleanups for publishing.
Differential Revision: https://phabricator.services.mozilla.com/D6034
2018-09-18 11:39:54 +02:00
Emilio Cobos Álvarez
22da3c22a2
style: Make LonghandId::flags an indexing operation.
I always see a bunch of time in our profiles in the iterator over the
declarations, this ensures it's not something dumb.

I suspect it's just a bunch of cache misses from walking the rule tree but in
any case this is consistent with the other getters we have and such.

Differential Revision: https://phabricator.services.mozilla.com/D5971
2018-09-18 11:39:48 +02:00
Emilio Cobos Álvarez
bc39f16b4b
style: Simplify CSSWideKeyword::parse.
Differential Revision: https://phabricator.services.mozilla.com/D5972
2018-09-18 11:39:42 +02:00
Emilio Cobos Álvarez
72ce653daf
style: Allow integer division inside calc() expressions.
Differential Revision: https://phabricator.services.mozilla.com/D5980
2018-09-18 11:39:36 +02:00
Emilio Cobos Álvarez
5cafac5d10
style: Remove DeclaredValue.
I think it used to be the case that all PropertyDeclaration variants had a
DeclaredValueOwned<T> inside. But that's no longer the case, so this abstraction
seems less useful now.

Differential Revision: https://phabricator.services.mozilla.com/D5978
2018-09-18 11:39:31 +02:00
Emilio Cobos Álvarez
4cd0f492f4
style: Deindent the non-css-wide-keyword-related code from cascade_property.
There's no good reason we construct a DeclaredValue as an intermediate step.

Differential Revision: https://phabricator.services.mozilla.com/D5977
2018-09-18 11:39:25 +02:00
Emilio Cobos Álvarez
c155efe7a5
style: Remove DeclaredValue::WithVariables.
We never construct it.

Differential Revision: https://phabricator.services.mozilla.com/D5976
2018-09-18 11:39:17 +02:00
Emilio Cobos Álvarez
d5ba19696a
style: Make ExtremumLength::valid_for static.
Differential Revision: https://phabricator.services.mozilla.com/D5975
2018-09-18 11:39:12 +02:00
Emilio Cobos Álvarez
8040c8bfec
style: Split apply_declarations into its own file, and without mako.
All that font code thrown out in the middle was making me mad.

There should be no change in behavior from this patch.

I ran rustfmt on the code but I corrected manually the following:

  https://github.com/rust-lang-nursery/rustfmt/issues/3025

Differential Revision: https://phabricator.services.mozilla.com/D5970
2018-09-18 11:39:06 +02:00
Emilio Cobos Álvarez
278ab8613f
style: Fix servo build and drop a FIXME there. 2018-09-15 19:19:18 +02:00
Emilio Cobos Álvarez
8aeaa3fc02
style: Remove a useless type bound. 2018-09-15 19:19:18 +02:00
Emilio Cobos Álvarez
da5283d066
style: Fix Gecko build. 2018-09-15 19:19:18 +02:00
Hiroyuki Ikezoe
3d909132ba
style: Implement any-hover and any-pointer media queries features.
Differential Revision: https://phabricator.services.mozilla.com/D3609
2018-09-15 17:57:29 +02:00
Hiroyuki Ikezoe
9354a42fc1
style: Add media feature keys for hover and pointer.
https://drafts.csswg.org/mediaqueries-4/#hover
https://drafts.csswg.org/mediaqueries-4/#pointer

In this patch series, we don't introduce any-hover and any-pointer media
features yet, but functionalities for them on each platform backends will be
introduced in this patch series, so eIntID_AllPointerCapabilities and relevant
stuff is added in this patch for the convenience that each platform backends
can be reviewed at once.

Differential Revision: https://phabricator.services.mozilla.com/D3296
2018-09-15 17:57:18 +02:00
Cameron McCormack
1f45fc0339
style: Update comments to no longer point to nsRuleNode.
There are a few mentions of nsRuleNode left but they are mostly
historical references so it makes sense to keep them.

Differential Revision: https://phabricator.services.mozilla.com/D5505
2018-09-15 17:57:12 +02:00
Brad Werth
6d57cbd881
style: Expand the Parser trait to allow anonymous CORS to be applied.
Depends on D5106

Differential Revision: https://phabricator.services.mozilla.com/D5341
2018-09-15 17:57:05 +02:00
Brad Werth
b96d44e329
style: Change Gecko_ImageValue_Create to take a CORS mode argument.
Differential Revision: https://phabricator.services.mozilla.com/D5106
2018-09-15 17:56:57 +02:00
Emilio Cobos Álvarez
ca335ba2e4
style: Remove unused nsStyleFont::{EnableZoom, UnZoomText}.
Differential Revision: https://phabricator.services.mozilla.com/D5530
2018-09-15 17:56:47 +02:00
Emilio Cobos Álvarez
25db9e3be7
style: Teach ComputeSquaredDistance derive about #[animation(constant)].
Differential Revision: https://phabricator.services.mozilla.com/D5337
2018-09-15 17:56:41 +02:00
Simon Sapin
2a996fbc8f Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
2018-09-12 13:33:32 +08:00
Matt Brubeck
a77d05538b Switch from new-ordered-float back to ordered-float
The `new-ordered-float` fork has been merged back into the original
`ordered-float` crate.
2018-09-11 09:59:01 -07:00
chansuke
8dab4d659a
Format style component. 2018-09-09 16:24:45 +02:00
Boris Chiou
31fc6cd565
style: Use the standalone struct and enum for the flags in SVG path.
We define the standalone types for using derive macro easily and overriding
the behaviors of this traits. This could avoid defining the general
behavior of booleans.

Depends on D4788

Differential Revision: https://phabricator.services.mozilla.com/D4813
2018-09-09 16:09:08 +02:00
Boris Chiou
b0604c9be5
style: Make offset-path: path() animatable.
Here, we change the animation type of offset-path as ComputedValue, so
we could do animation on it. Also enable the wpt for offset-path
interpolation. In test_transition_per_property.html, we add some basic tests
ifor offset-path.

ToAnimatedZero for PathCommand will be dropped later.

Because the animations of arcs with mismatched flags are fallen back to
discrete animations, the result of getComputedValue is not normalized in this
case. This makes some wpt failed even though the progress is 100%.

Depends on D4786

Differential Revision: https://phabricator.services.mozilla.com/D4787
2018-09-09 16:08:56 +02:00