Commit graph

7626 commits

Author SHA1 Message Date
bors-servo
aa60077563
Auto merge of #23973 - emilio:gecko-sync, r=emilio,jdm
style: Sync changes from mozilla-central.

See each individual commit 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/23973)
<!-- Reviewable:end -->
2019-08-16 06:44:52 -04:00
Emilio Cobos Álvarez
4752110d53
Fix Servo build and unify display representation. 2019-08-15 17:11:08 +02:00
Emilio Cobos Álvarez
4d8fc4b8f7
style: Fix formatting of recent changes. 2019-08-15 17:02:37 +02:00
Emilio Cobos Álvarez
cea6966fd2
style: Fix Servo build. 2019-08-15 17:02:37 +02:00
Mats Palmgren
5949d42bf7
style: Implement 'display:block ruby'.
Differential Revision: https://phabricator.services.mozilla.com/D40211
2019-08-15 17:02:30 +02:00
Mats Palmgren
2d29e6edd4
style: Implement 'inline list-item' and 'inline flow-root list-item' values for the 'display' property.
Differential Revision: https://phabricator.services.mozilla.com/D39832
2019-08-15 17:02:23 +02:00
Mats Palmgren
07dad28e49
style: Hide some 'display' values in devtools auto-completion that we want to discourage authors from using.
Differential Revision: https://phabricator.services.mozilla.com/D39810
2019-08-15 17:02:17 +02:00
Mats Palmgren
a9814ccb82
style: Implement multi-keyword 'display' values for Gecko.
Differential Revision: https://phabricator.services.mozilla.com/D39764
2019-08-15 17:02:09 +02:00
Charlie Marlow
cf7b0e13b6
style: adding from-font support to text-underline-offset and text-decoration-thickness.
Differential Revision: https://phabricator.services.mozilla.com/D41476
2019-08-15 17:02:01 +02:00
Emilio Cobos Álvarez
566f1ea600
style: Use shortest serialization for computed text-emphasis-style too.
Differential Revision: https://phabricator.services.mozilla.com/D41513
2019-08-15 17:01:54 +02:00
Emilio Cobos Álvarez
0844439bb2
style: Adjust comment grammar as suggested by xidorn. 2019-08-15 17:01:47 +02:00
Emilio Cobos Álvarez
0c76998719
style: Remove now-incorrect comment. 2019-08-15 17:01:39 +02:00
Joel Olsson
6a3ef7e959
style: Enable font-size:xxx-large.
Differential Revision: https://phabricator.services.mozilla.com/D41240
2019-08-15 17:01:33 +02:00
Charlie Marlow
0d0f1fb69c
style: updating text-underline-offset to support ::first-line/first-letter/placeholder.
Differential Revision: https://phabricator.services.mozilla.com/D41227
2019-08-15 17:01:27 +02:00
Emilio Cobos Álvarez
a9e914e3f0
style: Undo last minute serialization change so that I can land it with tests. 2019-08-15 17:01:20 +02:00
Emilio Cobos Álvarez
7f02662770
style: Use cbindgen for text-emphasis-style.
I sent https://github.com/eqrion/cbindgen/pull/377 since I got sick of
copy-pasting the private default constructor stuff :)

Differential Revision: https://phabricator.services.mozilla.com/D41419
2019-08-15 17:01:14 +02:00
Emilio Cobos Álvarez
fa06241ab6
style: Simplify text-emphasis-style.
Differential Revision: https://phabricator.services.mozilla.com/D41418
2019-08-15 17:01:06 +02:00
Charlie Marlow
9e826e380a
style: updating text-decoration-skip-ink to support ::first-line/first-letter/placeholder.
Differential Revision: https://phabricator.services.mozilla.com/D41228
2019-08-15 17:00:58 +02:00
Nicholas Nethercote
bb032c1ddc
style: Use static_prefs::pref!.
It's much nicer.

One nice thing about this is that the new code is subject to the existing
threadedness checking, which identified that several of these should be atomic
because they're accessed off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D40792
2019-08-15 17:00:37 +02:00
Charlie Marlow
ad1d028e40
style: added text-decoration-thickness to the text-decoration shorthands.
Differential Revision: https://phabricator.services.mozilla.com/D40335
2019-08-15 17:00:31 +02:00
Boris Chiou
29f6db4d16
style: Support multiple track sizes for grid-auto-{columns|rows}.
Support `<track-size>+` on the implicit track sizing properties,
grid-auto-columns and grid-auto-rows.

Differential Revision: https://phabricator.services.mozilla.com/D38408
2019-08-15 17:00:25 +02:00
Emilio Cobos Álvarez
69191d8b8c
style: Don't write manual glue code for the order property.
The default code works just as well.

Differential Revision: https://phabricator.services.mozilla.com/D40698
2019-08-15 17:00:18 +02:00
Emilio Cobos Álvarez
3c346c35d2
style: Fix Rust unit tests. 2019-08-15 17:00:03 +02:00
Emilio Cobos Álvarez
708ce04896
Bug 1519958 - Improve stack size of grid templates and re-enable style struct size assertions disabled in the previous patch. r=boris
This re-enables the assertion which was disabled on the previous patch by doing
a bit of boxing around.

Differential Revision: https://phabricator.services.mozilla.com/D36599
2019-08-15 16:58:52 +02:00
Emilio Cobos Álvarez
3e39998068
style: Refactor grid types to preserve repeat() at computed value time and use cbindgen.
I'm _really_ sorry for the size of the patch. I tried to do this in two steps
but it was a lot of work and pretty ugly.

This patch makes us use cbindgen for grid-template-{rows,columns}, in order to:

 * Make us preserve repeat() at computed-value time. This is per spec since
   interpolation needs to know about repeat(). Except for subgrid, which did the
   repeat expansion at parse-time and was a bit more annoying (plus it doesn't
   really animate yet so we don't need it to comply with the spec).

 * Tweaks the WPT tests for interpolation to adopt the resolution at:
   https://github.com/w3c/csswg-drafts/issues/3503.

Trade-off here, as this patch stands, is that this change makes us use less
long-living memory, since we expand repeat() during layout, but at the cost of a
bit of CPU time during layout (conditional on the property applying though,
which wasn't the case before). It should be very easy to store a cached version
of the template, should this be too hot (I expect it isn't), or to change the
representation in other ways to optimize grid layout code if it's worth it.

Another trade-off: I've used SmallPointerArray to handle line-name merging,
pointing to the individual arrays in the style data, rather than actually
heap-allocating the merged lists. This would also be pretty easy to change
should we measure and see that it's not worth it.

This patch also opens the gate to potentially improving memory usage in some
other ways, by reference-counting line-name lists for example, though I don't
have data that suggests it is worth it.

In general, this patch makes much easier to tweak the internal representation of
the grid style data structures. Overall, I think it's a win, the amount of magic
going on in that mako code was a bit huge; it took a bit to wrap my head around
it.

This patch comments out the style struct size assertions. They will be
uncommented in a follow-up patch which contains some improvements for this type,
which are worth getting reviewed separately.

Also, this patch doesn't remove as much code as I would've hoped for because of
I tried not to change most of the dom/grid code for inspector, but I think a
fair bit of the nsGridContainerFrame.cpp code that collects information for it
can be simplified / de-copy-pasted to some extent. But that was a pre-existing
problem and this patch is already quite massive.

Differential Revision: https://phabricator.services.mozilla.com/D36598
2019-08-15 16:58:44 +02:00
Emilio Cobos Álvarez
0e8b1853a7
style: Expand and simplify a macro that's not very useful.
Skip whitespace upfront rather than on each individual branch. The only
difference in behavior is that we would've consumed some extra whitespace in the
error case, but I don't think that matters at all.

We were consuming some extra whitespace as well after the close path command for
example, which wasn't parsing anything.

Differential Revision: https://phabricator.services.mozilla.com/D40539
2019-08-15 16:58:37 +02:00
Emilio Cobos Álvarez
2c17050819
style: Deindent a bit SVG path parsing code.
None cannot be returned, since we just called peek() and it returned something.

Differential Revision: https://phabricator.services.mozilla.com/D40538
2019-08-15 16:58:31 +02:00
Emilio Cobos Álvarez
3ec38e252f
style: Remove the GetCSNeedsLayoutFlush flag, as it is unneeded now.
Differential Revision: https://phabricator.services.mozilla.com/D40300
2019-08-15 16:58:14 +02:00
Boris Chiou
c6cdaaf1cf
style: Make offset-anchor animatable.
Per the spec issue, https://github.com/w3c/csswg-drafts/issues/3482,
we update the wpt to keep the percentage in `calc()` for `offset-anchor`.

Differential Revision: https://phabricator.services.mozilla.com/D39552
2019-08-15 16:58:08 +02:00
Boris Chiou
33690b9eaf
style: Support offset-anchor.
Differential Revision: https://phabricator.services.mozilla.com/D39432
2019-08-15 16:58:02 +02:00
Emilio Cobos Álvarez
e04273a4d9
style: Move the overrides to a separate struct in nsPresContext.
Just so that we can keep track of these together.

Differential Revision: https://phabricator.services.mozilla.com/D40247
2019-08-15 16:57:56 +02:00
Emilio Cobos Álvarez
07b8666029
style: Simplify emulated medium setup in nsPresContext.
Differential Revision: https://phabricator.services.mozilla.com/D40246
2019-08-15 16:57:50 +02:00
Emilio Cobos Álvarez
032347f4ff
style: Fix cursor prefixed aliases to do the right thing.
This was an oversight in bug 1520154. We kept the -moz- version in the specified
value but not the computed value.

That's a very peculiar way of making aliases work. This makes them work
consistently as many other aliases instead.

Also, add an assert that would've caught this much much earlier.

Differential Revision: https://phabricator.services.mozilla.com/D40063
2019-08-15 16:57:41 +02:00
Bastien Orivel
f7411db717 Update toml to 0.5 and cbindgen to 0.9 2019-08-13 13:26:13 +02:00
Bastien Orivel
62e46cf87c Force the std feature for log
While trying to build this crate with the gecko feature rust complained
about us using `log::set_boxed_logger` because it requires the std feature
which was not explicitly set in that crate.
2019-08-13 13:24:35 +02:00
Anthony Ramine
8e6591b81b Fix a panic when using layout 2020 2019-08-06 18:07:31 +02:00
bors-servo
196c511d5e
Auto merge of #23896 - nox:layout-2020, r=SimonSapin
Remove most of the things in layout 2020

We keep mostly the query system. There is probably more to delete but
that's a good start I think.

<!-- 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/23896)
<!-- Reviewable:end -->
2019-08-01 08:08:19 -04:00
Anthony Ramine
f8341daf95 Fix compilation errors due to the rebase
It's too complicated to make all the commits in that branch compile properly.
2019-08-01 13:50:52 +02:00
Simon Sapin
c38c964f1b Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30) 2019-07-31 13:34:01 +02:00
Emilio Cobos Álvarez
46236d015b
style: Fix some issues with #23856 in Gecko. 2019-07-30 12:06:26 +02:00
Boris Chiou
4813390e60
style: Accept percentage for shape-image-threshold.
Differential Revision: https://phabricator.services.mozilla.com/D39241
2019-07-30 12:06:19 +02:00
Simon Sapin
0215d09ccb Generate apis.html and css-properties.json for docs as part of crates’ build scripts
… rather than as an extra step after `cargo doc`.
This helps always using the correct set of CSS properties
(for layout 2013 v.s. 2020).
2019-07-30 08:37:33 +02:00
Simon Sapin
ddb4e369dd Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020}
Renaming the variable helped make sure I looked at every use.
2019-07-29 17:37:03 +02:00
Simon Sapin
f1300bb98b Auto-generate CSSStyleDeclaration.webidl for CSS properties based on the style crate 2019-07-29 17:37:03 +02:00
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