Commit graph

25052 commits

Author SHA1 Message Date
Jack Britton
1dd1cb4f4f Implement DocumentFragment XML serialization. 2019-04-12 12:49:18 -04:00
Emilio Cobos Álvarez
6377855526 Fix gfx unit tests. 2019-04-12 14:17:21 +02:00
Emilio Cobos Álvarez
34ad6150c8 Remove an unused extern crate. 2019-04-12 12:20:16 +02:00
Emilio Cobos Álvarez
49842f5031 style: Fix servo build, and appease tidy / fmt. 2019-04-12 12:20:15 +02:00
Emilio Cobos Álvarez
8c004c0858 style: Reformat recent changes. 2019-04-12 12:20:14 +02:00
Emilio Cobos Álvarez
7c4f9bbf49 style: Make the list-item increment not visible from the computed style.
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
2019-04-12 12:20:14 +02:00
Hiroyuki Ikezoe
cf7f64c9dc style: Enable the new scroll snap and disable the old scroll snap on nightly.
Differential Revision: https://phabricator.services.mozilla.com/D22804
2019-04-12 12:20:13 +02:00
Hiroyuki Ikezoe
21481e315e style: Switch to the new scroll-snap-type syntax for the old scroll snap implementation and drop the scroll-snap-type-{x,y} longhands.
Now scroll-snap-type is a longhand property.

Differential Revision: https://phabricator.services.mozilla.com/D21622
2019-04-12 12:20:12 +02:00
Hiroyuki Ikezoe
2f457ed144 style: Rename ScrollSnapType to ScrollSnapStrictness.
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
2019-04-12 12:20:12 +02:00
Emilio Cobos Álvarez
0a84073767 style: Use rust lengths for row-gap / column-gap.
Differential Revision: https://phabricator.services.mozilla.com/D26915
2019-04-12 12:20:11 +02:00
Emilio Cobos Álvarez
0f57b7b833 style: Fix ToResolvedValue implementation for caret-color, and serialize some color properties with Servo.
Differential Revision: https://phabricator.services.mozilla.com/D26785
2019-04-12 12:20:10 +02:00
Emilio Cobos Álvarez
5fd4e17020 style: Use ToResolvedValue for computed style serialization.
Differential Revision: https://phabricator.services.mozilla.com/D26784
2019-04-12 12:20:09 +02:00
Emilio Cobos Álvarez
a47dcb5707 style: Derive ToResolvedValue.
Differential Revision: https://phabricator.services.mozilla.com/D26783
2019-04-12 12:20:09 +02:00
Emilio Cobos Álvarez
6ac777ebf2 style: Add derive code for a new ToResolvedValue trait, and a few trivial implementations.
Differential Revision: https://phabricator.services.mozilla.com/D26782
2019-04-12 12:20:08 +02:00
Mats Palmgren
9b66f452cb style: Remove a note about <li value> style mapping that is no longer true.
Differential Revision: https://phabricator.services.mozilla.com/D26814
2019-04-12 12:20:07 +02:00
Emilio Cobos Álvarez
fce58015d6 style: Cleanup unused style traversal flags.
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
2019-04-12 12:20:07 +02:00
Emilio Cobos Álvarez
a7636010ee style: Remove a redundant use statement. 2019-04-12 12:20:06 +02:00
Emilio Cobos Álvarez
fc0dad2074 style: Handle the non-generic path earlier in the derive code.
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
2019-04-12 12:20:05 +02:00
Emilio Cobos Álvarez
c3ab3f0963 style: Share more code between ToAnimatedValue and ToComputedValue derive.
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
2019-04-12 12:20:04 +02:00
Emilio Cobos Álvarez
ae32e4df40 style: Use an explicit stack to measure rule tree memory usage.
A patch of mine that makes us measure the rule tree more often triggers this.

Differential Revision: https://phabricator.services.mozilla.com/D26595
2019-04-12 12:20:04 +02:00
Emilio Cobos Álvarez
369acffea8 style: Make color and text-decoration-line not early properties.
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
2019-04-12 12:20:03 +02:00
Emilio Cobos Álvarez
5d2724994c style: Remove the last usage of lossy currentcolor.
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
2019-04-12 12:20:02 +02:00
Emilio Cobos Álvarez
681f861018 style: Use rust lengths for outline-offset.
Differential Revision: https://phabricator.services.mozilla.com/D26156
2019-04-12 12:20:02 +02:00
Emilio Cobos Álvarez
f8fce03e82 style: Use Servo lengths for column-width.
Differential Revision: https://phabricator.services.mozilla.com/D26155
2019-04-12 12:20:01 +02:00
Emilio Cobos Álvarez
ef0b6bb225 style: Trivially remove some dead code.
Differential Revision: https://phabricator.services.mozilla.com/D26154
2019-04-12 12:20:01 +02:00
Emilio Cobos Álvarez
79fc59c75f style: Use only the new name for StyleColor.
That is, change all uses of StyleComplexColor to just StyleColor.

Differential Revision: https://phabricator.services.mozilla.com/D25977
2019-04-12 12:20:00 +02:00
Emilio Cobos Álvarez
53ccbc5751 style: Use the rust color representation.
Differential Revision: https://phabricator.services.mozilla.com/D25976
2019-04-12 12:19:59 +02:00
Emilio Cobos Álvarez
691eb36ffe style: Expose colors via cbindgen.
Also s/Foreground/CurrentColor.

Differential Revision: https://phabricator.services.mozilla.com/D25975
2019-04-12 12:19:59 +02:00
Emilio Cobos Álvarez
a6f32bc762 style: Fix revalidation in <svg:use> subtree.
So as to avoid incorrectly sharing styles across elements.

Differential Revision: https://phabricator.services.mozilla.com/D25918
2019-04-12 12:19:58 +02:00
Emilio Cobos Álvarez
b268ef6aed style: Remove some redundant use statements. 2019-04-12 12:19:57 +02:00
Emilio Cobos Álvarez
c106fb1231 style: Remove comment that is outdated since I fixed it in bug 1483808. 2019-04-12 12:19:56 +02:00
Emilio Cobos Álvarez
0406be7b68 style: Make the fixed generic family a parse-time alias to monospace.
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
2019-04-12 12:19:56 +02:00
Emilio Cobos Álvarez
2184e3f2e5 style: Cleanup generic font-family handling.
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
2019-04-12 12:19:55 +02:00
Emilio Cobos Álvarez
c49a88ec84 style: Trivially cleanup and remove some dead font code.
Differential Revision: https://phabricator.services.mozilla.com/D24271
2019-04-12 12:19:54 +02:00
Emilio Cobos Álvarez
2f8e05e9e0 style: Autogenerate Servo_ binding functions with cbindgen.
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
2019-04-12 12:19:54 +02:00
Cameron McCormack
debd837bf0 style: Add FFI API to create a StyleSheet backed by shared data.
Differential Revision: https://phabricator.services.mozilla.com/D17199
2019-04-12 12:19:53 +02:00
Cameron McCormack
7aac260c5d style: Add FFI API to use SharedMemoryBuilder.
Differential Revision: https://phabricator.services.mozilla.com/D17198
2019-04-12 12:19:52 +02:00
Cameron McCormack
40248ae5fd style: Add derived ToShmem implementations.
Differential Revision: https://phabricator.services.mozilla.com/D17197
2019-04-12 12:19:52 +02:00
Cameron McCormack
128c6ae94a style: Add ToShmem impl for FontFamilyList.
Differential Revision: https://phabricator.services.mozilla.com/D17196
2019-04-12 12:19:51 +02:00
Cameron McCormack
1f966535ac style: Add ToShmem impl for UrlExtraData.
Differential Revision: https://phabricator.services.mozilla.com/D17195
2019-04-12 12:19:50 +02:00
Cameron McCormack
41f6e67893 style: Add ToShmem impl for URLValueSource.
Differential Revision: https://phabricator.services.mozilla.com/D17194
2019-04-12 12:19:49 +02:00
Cameron McCormack
b8506e4a55 style: Add ToShmem impl for shared_lock::Locked.
Depends on D17192

Differential Revision: https://phabricator.services.mozilla.com/D17193
2019-04-12 12:19:48 +02:00
Cameron McCormack
8c007ad999 style: Add ToShmem impl for Atom.
Differential Revision: https://phabricator.services.mozilla.com/D17192
2019-04-12 12:19:48 +02:00
Cameron McCormack
48718b876c style: Add ToShmem impls for collections and strings.
Differential Revision: https://phabricator.services.mozilla.com/D17191
2019-04-12 12:19:47 +02:00
Cameron McCormack
7fa7c103d6 style: Add simple ToShmem implementations.
Differential Revision: https://phabricator.services.mozilla.com/D17190
2019-04-12 12:19:46 +02:00
Cameron McCormack
f6ef35c5d3 style: Add support for deriving ToShmem.
Differential Revision: https://phabricator.services.mozilla.com/D17189
2019-04-12 12:19:45 +02:00
Cameron McCormack
d8a758272e style: Factor out some of style_derive.
Differential Revision: https://phabricator.services.mozilla.com/D17188
2019-04-12 12:19:45 +02:00
Cameron McCormack
f581d2afb2 style: Add SharedMemoryBuilder type and ToShmem trait.
Differential Revision: https://phabricator.services.mozilla.com/D17187
2019-04-12 12:19:44 +02:00
Cameron McCormack
f889b303da style: Add support for static references to servo_arc::Arc. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D17186
2019-04-12 12:19:43 +02:00
Cameron McCormack
b71a601a36 style: Add support for read only SharedRwLocks, which don't need any locking.
Differential Revision: https://phabricator.services.mozilla.com/D17185
2019-04-12 12:19:42 +02:00