Commit graph

7448 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a109fbb7c8 style: Use ArcSlice for quotes.
This saves the intermediate allocation.

Differential Revision: https://phabricator.services.mozilla.com/D30546
2019-05-29 16:14:10 +02:00
Emilio Cobos Álvarez
bbc77e3977 style: Share computed and specified value representation of -moz-context-properties.
Differential Revision: https://phabricator.services.mozilla.com/D30545
2019-05-29 16:14:10 +02:00
Emilio Cobos Álvarez
2bc4c42d45 style: Use an ArcSlice as the computed value representation of inherited list properties.
This adds a bit of complexity, which I think will pay off in the end. Removals
incoming.

Differential Revision: https://phabricator.services.mozilla.com/D30544
2019-05-29 16:14:09 +02:00
Emilio Cobos Álvarez
ab8776a144 style: Use OwnedSlice in the specified and computed values of most vector properties.
This is just a refactor in the right direction. Eventual goal is:

 * All inherited properties use ArcSlice<>.
 * All reset properties use OwnedSlice<> (or ThinVec<>).

No conversion happens at all, so we can remove all that glue, and also
compute_iter and co.

Of course there's work to do, but this is a step towards that.

Differential Revision: https://phabricator.services.mozilla.com/D30127
2019-05-29 16:14:07 +02:00
Emilio Cobos Álvarez
b61eb84d96 style: Use ManuallyDrop for style structs.
We destroy them manually, so it's the right thing to do.

This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:

 * Remove the hack that replaced all nsStrings for nsStringReprs.
 * Remove ns{,C}StringRepr (followup)
 * Add members with destructors to the style structs (you see where I'm going :)).

Differential Revision: https://phabricator.services.mozilla.com/D30450
2019-05-29 16:14:07 +02:00
Cameron McCormack
3a22bb6c49 style: Add Gecko profiler labels for when the style threads are doing work.
Differential Revision: https://phabricator.services.mozilla.com/D30869
2019-05-29 16:14:06 +02:00
Josh Matthews
2875e5ccb3 Upgrade parking_lot to 0.8. 2019-05-25 07:18:06 -04:00
Paul Rouget
1758207393 Glutin update: dependencies update 2019-05-25 07:15:30 -04:00
Josh Matthews
60688da71a Revert "Glutin update: dependencies update"
This reverts commit 30fb18e711.
2019-05-22 14:18:38 -04:00
Paul Rouget
30fb18e711 Glutin update: dependencies update 2019-05-22 09:55:38 +02:00
Bastien Orivel
00ac887862 Update xml5ever and html5ever 2019-05-19 22:14:28 +02:00
bors-servo
3f30720bba
Auto merge of #23363 - Darkspirit:https, r=jdm
More https

* Disabled unused legacy TLS.
It will be disabled for Nightly 72 or 73 in 5-7 months and ride the [trains](https://wiki.mozilla.org/Release_Management/Calendar).
https://blog.mozilla.org/security/2018/10/15/removing-old-versions-of-tls/
* Updated MPL license in a few files.
It would be nice if a new version of https://pypi.org/project/servo_tidy/ could be released to update WebRender as well.
* Switched servo-deps.s3.amazonaws.com back to https.
This was recently regressed by 10585be25c and fc28073dfb.
* Made https the default protocol for address bar on desktop.
Press Ctrl+L on the Glutin port and enter `example.com`:
Servo previously assumed you meant `http://example.com/`, now it is `https://example.com/`.

---

- [x] `./mach build --release` 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/23363)
<!-- Reviewable:end -->
2019-05-14 08:21:17 -04:00
Jan Andre Ikenmeyer
97deef4e19
Update MPL license to https 2019-05-10 15:03:19 +02:00
Emilio Cobos Álvarez
db2f6aa8ca style: Rustfmt + build fix. 2019-05-10 12:43:06 +02:00
Emilio Cobos Álvarez
f429c28f23 style: Add bindings for ArcSlice and ThinArc, and use them to reduce copies of SVG path data.
As I said over bug 1549593, the eventual goal is to use ArcSlice in all
inherited properties. But this seemed like a good first candidate that doesn't
require me to move around a lot more code, since we were already using cbindgen
for the path commands.

Differential Revision: https://phabricator.services.mozilla.com/D30134
2019-05-10 12:43:05 +02:00
Emilio Cobos Álvarez
0d5c4481b8 style: Introduce ArcSlice, a small wrapper over ThinArc but without an explicit header.
We could make the header PhantomData or something, but then we wouldn't be able
to bind to C++, since C++ doesn't have ZSTs. So add a canary instead to add a
runtime check of stuff being sane.

Differential Revision: https://phabricator.services.mozilla.com/D30133
2019-05-10 12:43:04 +02:00
Emilio Cobos Álvarez
2ed2151b3d style: Move OwnedSlice to style_traits.
Differential Revision: https://phabricator.services.mozilla.com/D30126
2019-05-10 12:43:04 +02:00
Emilio Cobos Álvarez
559235edad style: Use the owned slice type for basic shape polygon coordinates.
This enables destructors for tagged unions in cbindgen, implemented in:

 * https://github.com/eqrion/cbindgen/pull/333

Which allow us to properly generate a destructor for the cbindgen-generated
StyleBasicShape (which now contains an OwnedSlice).

For now, we still use the glue code to go from Box<BasicShape> to
UniquePtr<BasicShape>. But that will change in the future when we generate even
more stuff and remove all the glue.

I could add support for copy-constructor generation to cbindgen for tagged
enums, but I'm not sure if it'll end up being needed, and copy-constructing
unions in C++ is always very tricky.

Differential Revision: https://phabricator.services.mozilla.com/D29769
2019-05-10 12:43:03 +02:00
Emilio Cobos Álvarez
330bccd659 style: Add an owned slice type which cbindgen can understand.
Passing these by value won't be ok of course, but that's fine.

I plan to combine this with https://github.com/eqrion/cbindgen/pull/333 to
actually be able to share representation for ~all the things, this is just the
first bit.

Box<T>, Atom and Arc<T> will be much easier since cbindgen can understand them
without issues.

It's boxed slices the only ones I should need something like this. I could avoid
it if I rely on Rust's internal representation, which we can per [1], but then I
need to teach cbindgen all about slices, which is generally hard, I think.

[1]: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/reference/src/layout/pointers.md

Differential Revision: https://phabricator.services.mozilla.com/D29768
2019-05-10 12:43:02 +02:00
Emilio Cobos Álvarez
4b761848a0 style: Remove unnecessary mut usage. 2019-05-10 12:43:01 +02:00
Cameron McCormack
ca756a8550 style: Implement -webkit-line-clamp.
Differential Revision: https://phabricator.services.mozilla.com/D20115
2019-05-10 12:43:00 +02:00
Emilio Cobos Álvarez
dd6252e34f style: Don't report errors for properties for which we've parsed another value in the same declaration block.
I thought a bit about how to test it and it's not particularly great.
test_css_parse_error_smoketest.html is great to assert that something _gets_
reported, but not that it doesn't :)

Differential Revision: https://phabricator.services.mozilla.com/D30201
2019-05-10 12:42:57 +02:00
Emilio Cobos Álvarez
02210264e7 style: Centralize a bit invalid value error reporting.
Also, buffer the errors, since we're going to want to look at the whole
declaration block to skip reporting them.

This shouldn't change behavior, just moves some work to the caller, and defers a
bit the work so that it happens only when error reporting is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D30200
2019-05-10 12:42:56 +02:00
Emilio Cobos Álvarez
1bb15d8819 style: scroll-snap-coordinate shouldn't use NotInitial.
The initial value for this is indeed `none` (and thus empty). The Rust code was
confused.

This property is disabled by default these days, and I think the
get_initial_value() function, which is what could get confused, is not called
for this property, so I think this shouldn't be observable.

Differential Revision: https://phabricator.services.mozilla.com/D30124
2019-05-07 13:01:55 +02:00
Mats Palmgren
0c982dcd16 style: [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands.
Differential Revision: https://phabricator.services.mozilla.com/D29974
2019-05-07 13:01:05 +02:00
Emilio Cobos Álvarez
561018da7d style: Fix servo build. 2019-05-07 12:56:06 +02:00
Emilio Cobos Álvarez
57874ae90a style: Rustfmt recent changes. 2019-05-07 12:56:02 +02:00
Jeremy Ir
d89e4ad4f3 style: Convert NS_STYLE_BORDER to an enum class in nsStyleConsts.h.
Converting the NS_STYLE_BORDER definitions in to enumerated classes as
per bug 1277133.

The original constants broke the convention used by the rest of the
definitions as the CSS property being described is `border-collapse`,
so corrections were made with the migration to the enumerated class.

Differential Revision: https://phabricator.services.mozilla.com/D29951
2019-05-07 12:55:56 +02:00
Masayuki Nakano
89bf34f46e Move all remaining members of nsIPresShell to mozilla::PresShell
Additionally, this sorts out the order of member variables for minimizing the
instance size.

And also this changes `enum RenderFlags` to `enum class RenderingStateFlags`.

Differential Revision: https://phabricator.services.mozilla.com/D29312
2019-05-07 12:55:49 +02:00
Emilio Cobos Álvarez
627514b737 style: Implement selector-matching for ::part().
Also fairly straight-forward. This may get more complicated when we do part
forwarding, if any.

I've opened https://github.com/w3c/csswg-drafts/issues/3841 in what I think
would be a cleaner model for forwarding.

Differential Revision: https://phabricator.services.mozilla.com/D28063
2019-05-07 12:55:46 +02:00
Emilio Cobos Álvarez
a23ad3be50 style: Add parsing support for ::part().
Disabled for now of course. This should be pretty uncontroversial I'd think.

Differential Revision: https://phabricator.services.mozilla.com/D28060
2019-05-07 12:55:44 +02:00
Emilio Cobos Álvarez
c990c9623d style: Use rust types for vertical-align.
The previous commit removed the dependence on the discriminant value, so we
don't need to keep discriminants different from text-align anymore.

Differential Revision: https://phabricator.services.mozilla.com/D29361
2019-05-07 12:55:41 +02:00
Emilio Cobos Álvarez
8123007717 style: Use rust types for gradient stops.
This doesn't clean up all that much, yet, but it's a step in the right
direction.

Differential Revision: https://phabricator.services.mozilla.com/D29168
2019-05-07 12:55:39 +02:00
Emilio Cobos Álvarez
e40500622e style: Add a pref for a simpler -moz- gradient parsing.
This won't reintroduce any of the regressions that were triggered by our
previous attempts to turn off -moz prefixed gradients, and lets us massively
simplify the gradient code, if it sticks.

Differential Revision: https://phabricator.services.mozilla.com/D29346
2019-05-07 12:55:37 +02:00
Emilio Cobos Álvarez
bec81dc9c2 style: Fix :-moz-svg-use-shadow-tree-root pseudo-class.
Turns out removing the pseudo-class and such ends up not being quite as trivial
as I initially thought, or possible at all, since the fact that the <symbol> is
a <symbol> is observable via selectors, added a test for that.

Differential Revision: https://phabricator.services.mozilla.com/D29131
2019-05-07 12:55:35 +02:00
Brian Birtles
9636ef7be7 style: Allow animating the 'all' property from Web Animations.
Differential Revision: https://phabricator.services.mozilla.com/D28763
2019-05-07 12:55:33 +02:00
Emilio Cobos Álvarez
07c0c1e53f style: Allow CSS wide-keywords in custom property fallback.
Differential Revision: https://phabricator.services.mozilla.com/D28349
2019-05-07 12:55:31 +02:00
Emilio Cobos Álvarez
e5b5cd78a9 style: Remove support for XBL resources.
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380
2019-05-07 12:55:29 +02:00
Emilio Cobos Álvarez
50312e1457 style: Drop unused user-agent cascade datas when not holding the cache lock.
We want to drop the cascade data memory as soon as possible, so bug 1544546
introduced an UpdateStylistIfNeeded call from ShellDetachedFromDocument.

Unfortunately, this call can reenter into the global user-agent cascade data if
some of the CSS values kept alive by the cascade data keep alive an SVG
document, see the stack on this bug for an example. Make sure to drop the
user-agent cascade datas when not holding the cache lock to avoid this
situation.

Before bug 1535788, we just destroyed the stylist, so we kept holding a
reference from the cache, and that reference will be dropped sometime later when
other document updated their user-agent stylesheets (if they happened not to
match the cache of course).

Seems to me this doesn't ended up happening in our automation, but it could
happen in the wild, in theory at least.

It's nice that Rust made this a safe deadlock caught by our tests rather than a
very subtle and infrequent memory corruption.

The relevant SVG documents are probably the <input type=number> rules:

https://searchfox.org/mozilla-central/rev/d80f0a570736dce76a2eb184fb65517462089e8a/layout/style/res/forms.css#1050

Differential Revision: https://phabricator.services.mozilla.com/D28299
2019-05-07 12:55:28 +02:00
Emilio Cobos Álvarez
52026f602b style: Don't allow to parse XUL tree pseudo-elements with a single colon.
Now that they're not exposed to the web we can remove this special case.

Differential Revision: https://phabricator.services.mozilla.com/D28071
2019-05-07 12:55:27 +02:00
Emilio Cobos Álvarez
c0b17cc844 style: Don't keep two list of stylesheets in ServoStyleSet.
Just one set of stylesheets is enough. While at it, unify SheetType and Origin.

Differential Revision: https://phabricator.services.mozilla.com/D27564
2019-05-07 12:55:26 +02:00
Mats Palmgren
098eb300ac style: [cssom][css-grid] 'grid-auto-flow: row dense' should serialize to 'dense' since 'row' is implied.
Differential Revision: https://phabricator.services.mozilla.com/D28058
2019-05-07 12:55:25 +02:00
Emilio Cobos Álvarez
477bda81d3 style: Unify a bit Servo and Gecko code in properties.mako.rs.
Mostly removing #[cfg] statements, so npotb.
2019-05-07 12:55:24 +02:00
Emilio Cobos Álvarez
09d497db3d style: Refactor the selector parser to make implementing ::part() easier.
::slotted() is already weird in the sense that it supports a pseudo-element
afterwards (so ::slotted(*)::before is valid for example).

::part() is weirder because you are supposed to allow stuff like
::part(foo):hover, ::part(foo):hover::before, etc.

In order to avoid making the already-complex parse_compound_selector more
complex, shuffle stuff so that we pass the progress of our current compound
selector around, and is the parsing code for each selector which decides whether
it's ok to parse at the given point.

Differential Revision: https://phabricator.services.mozilla.com/D27158
2019-05-07 12:55:23 +02:00
Emilio Cobos Álvarez
498a163cdf style: The counters code should use atoms rather than strings.
Servo already atomizes the counter names, it makes no sense to copy the string
rather than bumping the refcount.

Differential Revision: https://phabricator.services.mozilla.com/D27061
2019-05-07 12:55:22 +02:00
Jonathan Kew
a9e473c6e8 style: Allow full-width and/or full-size-kana values of text-transform to be combined with a case transformation.
Differential Revision: https://phabricator.services.mozilla.com/D27402
2019-05-07 12:55:21 +02:00
bors-servo
62031e3cb0
Auto merge of #23289 - CYBAI:regex-1.1, r=jdm
Update regex to 1.1

I just found the `aho-corasick` dependency is still `0.6.9` and then I found `regex` depends on it.

I remember there's a rewrite of `aho-corasick` at BurntSushi/aho-corasick@e8493baf54 to improve itself.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because it just updates `regex` crate

<!-- 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/23289)
<!-- Reviewable:end -->
2019-04-29 15:37:25 -04:00
CYBAI
5b9f151f03 Update regex to 1.1 2019-04-29 22:25:12 +09:00
Fernando Jiménez Moreno
d0b2e826ef Move StylesheetSetRef to script 2019-04-26 12:00:26 +02:00
Fernando Jiménez Moreno
e4f34fde1b Rename StylesheetSet to StylesheetSetRef 2019-04-26 12:00:26 +02:00