Commit graph

7582 commits

Author SHA1 Message Date
bors-servo
8f7440f368
Auto merge of #23827 - emilio:gecko-sync, r=emilio,manishearth
style: Sync changes from mozilla-central, and update euclid

See individual commits for details.

<!-- 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/23827)
<!-- Reviewable:end -->
2019-07-23 18:42:00 -04:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
Emilio Cobos Álvarez
2ff7cb5a37
style: Appease tidy. 2019-07-23 22:54:12 +02:00
Emilio Cobos Álvarez
3da8f85914
style: Fix a warning in Servo builds by moving a macro to where it's used. 2019-07-23 22:54:11 +02:00
Emilio Cobos Álvarez
8665d9dc12
Fix Servo build. 2019-07-23 22:54:10 +02:00
longsonr
243520fb27
style: Change dominant-baseline from reset to inherit.
Bug: 1353164
Reviewed-by: heycam
2019-07-23 22:54:09 +02:00
Charlie Marlow
6bc1b97a6c
style: renamed text-decoration-width to text-decoration-thickness.
Differential Revision: https://phabricator.services.mozilla.com/D38586
2019-07-23 22:54:09 +02:00
Nicolas Silva
239f2da9d9
style: Update to euclid 0.20.
Differential Revision: https://phabricator.services.mozilla.com/D38530
2019-07-23 22:54:08 +02:00
Emilio Cobos Álvarez
66eae2fc81
style: Remove the ability to build Gecko without the bindgen feature.
This is not used for anything, as far as I can tell.

Differential Revision: https://phabricator.services.mozilla.com/D38584
2019-07-23 22:54:07 +02:00
Emilio Cobos Álvarez
137044a3db
style: Update animations when a pseudo-element had animations but no longer has, and has been re-framed in the meantime.
This is the easy fix.

The hard fix (outlined in the comment) would be nice, but I don't think this bug
alone justifies it.

Differential Revision: https://phabricator.services.mozilla.com/D38184
2019-07-23 22:54:06 +02:00
Thomas Nguyen
59cf10d1b0
style: Modify URLExtraData rust debug to include referrerInfo.
Differential Revision: https://phabricator.services.mozilla.com/D36475
2019-07-23 22:54:06 +02:00
longsonr
2ab9156401
style: Remove dominant-baseline values that no longer exist.
Bug: 1353164
Reviewed-by: heycam
2019-07-23 22:54:05 +02:00
Boris Chiou
87231e676d
style: Add percentage for opacity (i.e. <alpha-value>).
The following properties accept <alpha-value> [1], which is
"<number> | <percentage>", so we update the parser, spec links, and
their web-platform-tests.
1. opacity
2. flood-opacity
3. fill-opacity
4. stroke-opacity
5. stop-opacity
6. -moz-window-opacity

Besides, shape-image-threshold [2] still only accepts <number>, so we need
to support a different version of `Opacity::parse()`.

[1] https://drafts.csswg.org/css-color/#typedef-alpha-value
[2] https://drafts.csswg.org/css-shapes/#shape-image-threshold-property

Differential Revision: https://phabricator.services.mozilla.com/D37493
2019-07-23 22:54:04 +02:00
Emilio Cobos Álvarez
65bf72f131
style: Set the property restrictions flags from the centralized list.
Differential Revision: https://phabricator.services.mozilla.com/D37721
2019-07-23 22:54:04 +02:00
Emilio Cobos Álvarez
e33a799775
style: Centralize property restrictions.
The assertion in properties.mako.rs ensures I got this right.

Differential Revision: https://phabricator.services.mozilla.com/D37720
2019-07-23 22:54:03 +02:00
Emilio Cobos Álvarez
2a500eadd3
style: scroll-margin properties shouldn't apply to first-line / first-letter.
From https://drafts.csswg.org/css-scroll-snap-1/#placement:

> None of the properties in this module apply to the ::first-line and
> ::first-letter pseudo-elements.

Differential Revision: https://phabricator.services.mozilla.com/D37719
2019-07-23 22:54:02 +02:00
Emilio Cobos Álvarez
b8e3247b32
style: Update spec link for font-variation-settings.
It had got outdated.

Differential Revision: https://phabricator.services.mozilla.com/D37718
2019-07-23 22:54:01 +02:00
Emilio Cobos Álvarez
10cb9c07aa
style: Don't apply property restrictions to pseudo-elements in UA stylesheets.
And remove some of the ::placeholder and ::cue hacks where we need to use
!important to make the property not apply for content but apply on UA sheets.

The comment about the white-space property was wrong, we don't enforce it with
!important in the UA stylesheets for <input> (we do for <textarea> though), so
I've kept the flag since it really applies.

Differential Revision: https://phabricator.services.mozilla.com/D37717
2019-07-23 22:54:01 +02:00
Cameron McCormack
e3b57efc7e
style: Ignore pref-controlled properties in cached scrollbar style assertions.
Now if you add a new inherited, pref-controlled property, you must
declare whether it can have an effect on scrollbar styles.  If no,
then the property will be skipped in the assertions that check
whether our cached styles are equal to those we would compute.

Differential Revision: https://phabricator.services.mozilla.com/D37507
2019-07-23 22:54:00 +02:00
Boris Chiou
145acbf876
style: Part 2: Retire the support for 3-valued syntax for position.
According to this resolved spec issue:
https://github.com/w3c/csswg-drafts/issues/2140,
we retire the 3-valued <position> on
1. `object-position`
2. `perspective-origin`,
3. `mask-position`
4. `circle()` and `ellipse()`
, but still keep the support for `background-position`.

Besides, I simply run this python script to generate the .ini file:
```
s = sys.argv[1] + ".ini"
with open(s, "w") as f:
    f.write('[{}]\n'.format(sys.argv[1]))
    f.write('  expected: FAIL\n')
    f.write('  bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559276\n')
```

Differential Revision: https://phabricator.services.mozilla.com/D37126
2019-07-23 22:53:59 +02:00
Jonathan Kew
6cf87d23f8
style: Add an 'auto' value for the CSS 'quotes' property, and make it use language-dependent quote marks.
Differential Revision: https://phabricator.services.mozilla.com/D36429
2019-07-23 22:53:59 +02:00
alwu
c00045b0c9
style: set CSS properties directly on '::cue'.
According to the spec [1], we have to set those CSS properties on the root node,
and then this root node would have a child node, background box [2], which would
contain all other child nodes.

In our case, the background box is `cueDiv` [3].

In theory, all those properties set on the root node should be inherited by the
background box. However, when the background box is a pseudo element `::cue`,
they won't be directly inherit from the the background box's parent, inherited
styles would acutally come from video instead.

Therefore, we have to directly set these properties on the pseudo element and
mark them as `!important` to avoid being overrided by user style script.

[1] https://www.w3.org/TR/webvtt1/#ref-for-list-of-webvtt-node-objects-9
[2] https://www.w3.org/TR/webvtt1/#webvtt-cue-background-box
[3] https://searchfox.org/mozilla-central/rev/11712bd3ce7454923e5931fa92eaf9c01ef35a0a/dom/media/webvtt/vtt.jsm#533-534

Differential Revision: https://phabricator.services.mozilla.com/D35694
2019-07-23 22:53:58 +02:00
bors-servo
e948c7dcc6
Auto merge of #23824 - servo:stylo-uninit, r=emilio
Stylo: replace uses of mem::uninitialized with MaybeUninit

<!-- 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/23824)
<!-- Reviewable:end -->
2019-07-23 16:28:42 -04:00
Simon Sapin
17ec774a49 Stylo: replace uses of mem::uninitialized with MaybeUninit
MozReview-Commit-ID: KGhYL6DJRaR
2019-07-16 08:03:54 +02:00
Bastien Orivel
28fa0f8009 Update rayon to dedupe crossbeam-epoch
As a bonus this also removes one version of crossbeam-utils
2019-07-12 21:01:33 +02:00
Emilio Cobos Álvarez
fbf6b926e5
style: Servo doesn't support backdrop-filter yet. 2019-07-08 14:59:16 +02:00
Emilio Cobos Álvarez
03a8e57b9c
style: Appease tidy. 2019-07-08 12:58:20 +02:00
Emilio Cobos Álvarez
55966412af
style: Rustfmt recent changes. 2019-07-08 12:56:47 +02:00
Emilio Cobos Álvarez
c913941669
style: Trivially simplify some recently-added code. 2019-07-08 12:56:37 +02:00
Emilio Cobos Álvarez
c5a90e1baf
style: Remove a map(From::from) statement that does literally nothing. 2019-07-08 12:47:04 +02:00
Emilio Cobos Álvarez
341023690c
style: Use cbindgen for fill and stroke.
Differential Revision: https://phabricator.services.mozilla.com/D36807
2019-07-08 12:46:46 +02:00
Emilio Cobos Álvarez
83da7c1535
style: Simplify parsing and storage of SVG paint server fallback. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D36806
2019-07-08 12:46:39 +02:00
Emilio Cobos Álvarez
f0b5d02901
style: Use more compact and ffi-friendly types for some svg props.
No functional change yet.

Differential Revision: https://phabricator.services.mozilla.com/D36805
2019-07-08 12:46:29 +02:00
Emilio Cobos Álvarez
a0df9f76de
style: Apply text-only zoom to system fonts.
Differential Revision: https://phabricator.services.mozilla.com/D36893
2019-07-08 12:46:22 +02:00
Calixte Denizet
1c452e6c45
style: Fix python3 lint issues on servo.
Differential Revision: https://phabricator.services.mozilla.com/D35247
2019-07-08 12:46:12 +02:00
Emilio Cobos Álvarez
4abfa1a2d8
style: Don't optimize out recascading of children when becoming or stopping being display: contents.
Since they can change whether descendants get blockified.

Differential Revision: https://phabricator.services.mozilla.com/D35818
2019-07-08 12:46:03 +02:00
Emilio Cobos Álvarez
1af30fa0c9
style: rustfmt recent changes. 2019-07-08 12:45:56 +02:00
Hugh Gallagher
069c0b06de
style: In CounterStyleOrNone check if SymbolsType is symbolic and skip if it is.
Differential Revision: https://phabricator.services.mozilla.com/D36235
2019-07-08 12:45:48 +02:00
Emilio Cobos Álvarez
31b166fb1b
style: Remove nsStyleCoord.
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).

Differential Revision: https://phabricator.services.mozilla.com/D36120
2019-07-08 12:45:36 +02:00
Emilio Cobos Álvarez
8d127014c3
style: Stop using nsStyleSides for -moz-image-rect.
Differential Revision: https://phabricator.services.mozilla.com/D36119
2019-07-08 12:45:28 +02:00
Emilio Cobos Álvarez
cc15afa348
style: Use cbindgen for grid track sizing.
Differential Revision: https://phabricator.services.mozilla.com/D36118
2019-07-08 12:45:21 +02:00
Charlie Marlow
034557a717
style: Adding parsing support for text-decoration-skip-ink
Differential Revision: https://phabricator.services.mozilla.com/D35831
2019-07-08 12:45:14 +02:00
Emilio Cobos Álvarez
3530ea9862
style: Restrict properties that apply to ::marker for now.
Differential Revision: https://phabricator.services.mozilla.com/D31680
2019-07-08 12:45:06 +02:00
Cameron McCormack
b8873f44aa
style: Cache computed styles of scrollbar part anonymous content.
Differential Revision: https://phabricator.services.mozilla.com/D33123
2019-07-08 12:44:25 +02:00
Connor Brewster
1aef82f806
style: Parse backdrop-filter CSS property.
Differential Revision: https://phabricator.services.mozilla.com/D35816
2019-07-08 12:44:15 +02:00
Emilio Cobos Álvarez
960be2fd01
style: Add an internal aspect-ratio CSS property.
Differential Revision: https://phabricator.services.mozilla.com/D29037
2019-07-08 12:43:58 +02:00
Emilio Cobos Álvarez
87e3dadf22
style: Use the cbindgen representation for grid line properties.
We clamp earlier (parse time rather than computed value time), but that's the
only behavior change, which I think doesn't really matter.

Differential Revision: https://phabricator.services.mozilla.com/D35198
2019-07-08 12:43:39 +02:00
Emilio Cobos Álvarez
248b2ac829
style: Generate top-level function and constant declarations for the style crate.
This needs https://github.com/eqrion/cbindgen/pull/362, but I expect it to be
uncontroversial. I'll add a patch to this bug when it's merged to update it.

cbindgen historically didn't include these, but it turns out to be pretty useful
to generate constants for the style crate (since the binding crate is
`servo/ports/geckolib`).

An alternative is to get a completely different cbindgen-generated header for
these, but that seems a bit wasteful. This generates the constants with the
Style prefix (so we'll get `StyleMAX_GRID_LINE` for example), which is very
ugly. But we probably want to eventually stop using the Style prefix and use a
namespace instead, plus it's trivial to do `auto kMaxLine = StyleMAX_GRID_LINE`,
for example, so it's probably not a huge deal.

Another alternative would be to use associated consts, which _are_ generated by
cbindgen. Something like:

```
struct GridConstants([u8; 0]);
impl GridConstants {
    const MAX_GRID_LINE: i32 = 10000;
}
```

Which would yield something like:

```
static const int32 StyleGridConstants_MAX_GRID_LINE = 10000;
```

I'm not sure if you find it preferrable, but I'm also happy to change it in a
follow-up to use this.

We need to fix a few manual C++ function signature definitions to match the C++
declaration.

Differential Revision: https://phabricator.services.mozilla.com/D35197
2019-07-08 12:43:19 +02:00
Emilio Cobos Álvarez
98091243a7
style: Use a more similar representation in Rust and C++ for grid lines.
Option<> is not FFI-safe, so if we want to use the same representation
everywhere we need to get rid of it. This also makes it take the same amount of
memory as the C++ representation, and it's not very complex, I'd think.

Differential Revision: https://phabricator.services.mozilla.com/D35195
2019-07-08 12:43:07 +02:00
Nicholas Nethercote
323221051f
style: Change StaticPrefs from a class to a namespace.
This doesn't change the way C++ code uses static prefs. But it does slightly
change how Rust code uses static prefs, specifically the name generated by
bindgen is slightly different.

The commit also improves some comments.

Differential Revision: https://phabricator.services.mozilla.com/D35764
2019-07-08 12:42:58 +02:00