Граф коммитов

12493 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 7b4c4a4912 No bug - rustfmt recent style system changes. 2019-05-09 20:18:08 +02:00
Emilio Cobos Álvarez 647b7c7078 No bug - Fix Servo build. 2019-05-09 20:18:05 +02:00
Emilio Cobos Álvarez f65bcfba56 Bug 1549559 - Add bindings for ArcSlice and ThinArc, and use them to reduce copies of SVG path data. r=heycam
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

--HG--
extra : moz-landing-system : lando
2019-05-09 12:43:19 +00:00
Emilio Cobos Álvarez f59bb7ae91 Bug 1549559 - Introduce ArcSlice, a small wrapper over ThinArc but without an explicit header. r=heycam
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

--HG--
extra : moz-landing-system : lando
2019-05-09 10:53:50 +00:00
Emilio Cobos Álvarez 1de789c618 Bug 1549593 - Move OwnedSlice to style_traits. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30126

--HG--
rename : servo/components/style/owned_slice.rs => servo/components/style_traits/owned_slice.rs
extra : moz-landing-system : lando
2019-05-09 10:49:50 +00:00
Emilio Cobos Álvarez 38065025d9 Bug 1548691 - Use the owned slice type for basic shape polygon coordinates. r=TYLin,heycam
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

--HG--
extra : moz-landing-system : lando
2019-05-09 11:24:57 +00:00
Emilio Cobos Álvarez 7d9dca2244 Bug 1548691 - Add an owned slice type which cbindgen can understand. r=heycam
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

--HG--
extra : moz-landing-system : lando
2019-05-09 10:49:22 +00:00
Jonathan Kew c8c951fbbe Bug 1545177 - If descriptors of a FontFace are modified after creation, update the associated font entry so that face selection will respect the new values, and mark font sets as dirty. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D27980

--HG--
extra : moz-landing-system : lando
2019-05-09 09:43:42 +00:00
Emilio Cobos Álvarez 936ebd1f3a Bug 1550389 - Remove unnecessary mut usage. 2019-05-09 05:45:10 +02:00
Cameron McCormack f5b7d1380b Bug 866102 - Implement -webkit-line-clamp. r=mats,emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D20115

--HG--
extra : moz-landing-system : lando
2019-05-09 02:32:30 +00:00
Emilio Cobos Álvarez e3b9d16857 Bug 1549969 - Fix an assertion that doesn't account for alignment padding. r=bholley
I'm hitting this when trying to add bindings for box shadows, which are 32-bit
aligned.

Depends on D30352

Differential Revision: https://phabricator.services.mozilla.com/D30353

--HG--
extra : moz-landing-system : lando
2019-05-08 18:03:37 +00:00
Emilio Cobos Álvarez fcca6294b1 Bug 1549969 - Don't panic when creating empty ThinArcs. r=bholley
The change from [T; 1] to [T; 0] shouldn't change behavior since they have the
right alignment and we never poke at that particular array, but feels more
correct to avoid creating types that point to uninitialized data or outside of
their allocation, now that we allow empty slices.

Differential Revision: https://phabricator.services.mozilla.com/D30352

--HG--
extra : moz-landing-system : lando
2019-05-08 17:54:25 +00:00
Emilio Cobos Álvarez 17b3f8d8e7 Bug 1538101 - Don't report errors for properties for which we've parsed another value in the same declaration block. r=jdm
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-08 18:14:18 +02:00
Dorel Luca 6d69b04fd4 Backed out changeset eee17e1b0435 (bug 1538101) for Browser-chrome and DT failures. CLOSED TREE 2019-05-08 18:21:30 +03:00
Emilio Cobos Álvarez 1b7101750d Bug 1538101 - Don't report errors for properties for which we've parsed another value in the same declaration block. r=jdm
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

--HG--
extra : moz-landing-system : lando
2019-05-08 12:44:46 +00:00
Emilio Cobos Álvarez c8d19bedcd Bug 1538101 - Centralize a bit invalid value error reporting. r=jdm
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

--HG--
extra : moz-landing-system : lando
2019-05-08 12:44:36 +00:00
Emilio Cobos Álvarez 259aa236fd Bug 1549596 - Use PhantomData<T> in servo_arc. r=bholley
See https://github.com/rust-lang/rust/pull/60594#issuecomment-489966933

Differential Revision: https://phabricator.services.mozilla.com/D30169

--HG--
extra : moz-landing-system : lando
2019-05-08 08:01:01 +00:00
Emilio Cobos Álvarez 0789d1d403 Bug 1549596 - ThinArc should use NonNull. r=bholley
If only for parallelism with Arc<>.

Differential Revision: https://phabricator.services.mozilla.com/D30131

--HG--
extra : moz-landing-system : lando
2019-05-07 03:16:21 +00:00
Emilio Cobos Álvarez e736bff42d No bug - Cherry-pick some Servo removals from malloc_size_of. r=npotb 2019-05-07 12:59:40 +02:00
Oana Pop Rus 251b4874dc Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-05-07 01:33:06 +03:00
Oana Pop Rus 65399363fb Merge inbound to mozilla-central. a=merge 2019-05-07 00:45:24 +03:00
Emilio Cobos Álvarez ab4877cc37 Bug 1549589 - scroll-snap-coordinate shouldn't use NotInitial. r=hiro
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

--HG--
extra : moz-landing-system : lando
2019-05-06 21:31:16 +00:00
Emilio Cobos Álvarez 656a46330b Bug 1549301 - Fix Servo build. 2019-05-06 10:37:55 +02:00
Emilio Cobos Álvarez 94cde8dcec Bug 1549301 - Rustfmt recent style system changes. 2019-05-06 10:37:53 +02:00
Emilio Cobos Álvarez c78d89f5d6 Bug 1549301 - Import style system changes for Servo's Shadow DOM support. 2019-05-06 10:37:52 +02:00
Emilio Cobos Álvarez 959628ed83 Bug 1549301 - Fix some warnings. 2019-05-06 10:37:50 +02:00
Ian Moody a465f73789 Bug 1549301 - Remove :-servo-case-sensitive-type-attr().
No longer needed now that the case-sensitive flag for attributes selectors is
supported.
Update user-agent CSS sheet to use the standard flag.

Fixes #23227

This cherry-picks https://github.com/servo/servo/pull/23228.
2019-05-06 10:37:45 +02:00
Jeremy Ir 79895773c2 Bug 1548341 - Convert NS_STYLE_BORDER to an enum class in nsStyleConsts.h. r=dholbert
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

--HG--
extra : moz-landing-system : lando
2019-05-05 23:39:27 +00:00
Mats Palmgren af98466fc0 Bug 1549223 - [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29974

--HG--
extra : rebase_source : 4f76c70ab6335cd41e23bd692c0a4ea432b525e9
2019-05-06 02:43:50 +02:00
Masayuki Nakano 8a9d031686 Bug 253889 - part 3: Move all remaining members of nsIPresShell to mozilla::PresShell r=emilio
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

--HG--
extra : moz-landing-system : lando
2019-05-01 02:28:25 +00:00
Noemi Erli f1ef21cbc7 Backed out changeset 8c89fd37b79d (bug 1544242) for failures in browser_rules_shadowdom_slot_rules.js CLOSED TREE 2019-05-01 22:03:06 +03:00
Emilio Cobos Álvarez 27fc6a03c9 Bug 1545430 - Implement selector-matching for ::part(). r=heycam
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

--HG--
extra : moz-landing-system : lando
2019-05-01 17:28:23 +00:00
Emilio Cobos Álvarez f7fc67efda Bug 1545425 - Add parsing support for ::part(). r=heycam
Disabled for now of course. This should be pretty uncontroversial I'd think.

Differential Revision: https://phabricator.services.mozilla.com/D28060

--HG--
extra : moz-landing-system : lando
2019-05-01 17:25:13 +00:00
Emilio Cobos Álvarez fb5b637f4f Bug 1544242 - Fix selector-matching for nested pseudo-elements. r=heycam,mats
We always include the combinator for pseudo-elements now (not including it was
just an optimization) in order to not match when nested pseudo-elements are
involved.

We could add a more generic check in `matches_simple_selector` like:

```
if element.is_pseudo_element() {
    match *selector {
        Component::PseudoElement(..) |
        Component::NonTSPseudoClass(..) => {},
        _ => return false,
    }
}
```

But even that wouldn't be enough to make selectors like `:hover::marker` not
match on the `::before::marker` pseudo-element, plus that code is really hot.

So for now do the check on the `next_element_for_combinator` function. It's a
bit hacky but it's the best I could came up with...

While at it, simplify some checks to use is_pseudo_element() instead of
implemented_pseudo_element() directly.

Only the Rust patch as-is would make markers for ::before and ::after on list
items not show up, so we also need to switch ::marker to use ProbeMarkerStyle()
rather than ProbePseudoElementStyle(), since the marker should exist even if it
matches no rules.

Differential Revision: https://phabricator.services.mozilla.com/D27529

--HG--
extra : moz-landing-system : lando
2019-05-01 17:19:08 +00:00
Emilio Cobos Álvarez 1dc4cd8f3c Bug 1544242 - Check iterator length in SelectorIter::is_featureless_host_selector. r=heycam
I'm going to unconditionally generate the PseudoElement combinator, and this
causes issues since we'll put the raw `::pseudo` selectors in the host bucket,
which is obviously wrong.

Differential Revision: https://phabricator.services.mozilla.com/D27528

--HG--
extra : moz-landing-system : lando
2019-04-29 05:58:56 +00:00
Emilio Cobos Álvarez edde08a7cb Bug 1547985 - Use rust types for vertical-align. r=mats
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

--HG--
extra : moz-landing-system : lando
2019-05-01 13:08:34 +00:00
Emilio Cobos Álvarez 0593b77cc0 Bug 1547674 - Use rust types for gradient stops. r=boris
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

--HG--
extra : moz-landing-system : lando
2019-04-30 20:37:54 +00:00
Emilio Cobos Álvarez ab81a99c80 Bug 1547939 - Add a pref for a simpler -moz- gradient parsing. r=dholbert
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

--HG--
extra : moz-landing-system : lando
2019-04-30 19:48:27 +00:00
Emilio Cobos Álvarez a6845a59a2 Bug 1547619 - Fix :-moz-svg-use-shadow-tree-root pseudo-class. r=violet
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

--HG--
extra : moz-landing-system : lando
2019-04-29 08:04:22 +00:00
Brian Birtles 46c5c2141a Bug 1536688 - Allow animating the 'all' property from Web Animations; r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D28763

--HG--
extra : moz-landing-system : lando
2019-04-26 00:47:40 +00:00
Emilio Cobos Álvarez 88a1b27597 Bug 1546046 - Remove support for XBL resources. r=TYLin
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380

--HG--
extra : moz-landing-system : lando
2019-04-23 16:43:15 +00:00
Emilio Cobos Álvarez 73c98adccf Bug 1544886 - Allow CSS wide-keywords in custom property fallback. r=SimonSapin
Differential Revision: https://phabricator.services.mozilla.com/D28349

--HG--
extra : moz-landing-system : lando
2019-04-23 13:13:11 +00:00
Bogdan Tara ec489aa170 Backed out changeset e85cb54e5944 (bug 1546046) complementary backout after 1470880 was backed out CLOSED TREE 2019-04-23 06:55:29 +03:00
Emilio Cobos Álvarez daef6a8b67 Bug 1546046 - Remove support for XBL resources. r=TYLin
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380

--HG--
extra : moz-landing-system : lando
2019-04-22 21:57:22 +00:00
Emilio Cobos Álvarez f2b53c1479 Bug 1545979 - Drop unused user-agent cascade datas when not holding the cache lock. r=bholley
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

--HG--
extra : moz-landing-system : lando
2019-04-22 19:45:06 +00:00
Emilio Cobos Álvarez 824fde5850 Bug 1545440 - Don't allow to parse XUL tree pseudo-elements with a single colon. r=mats
Now that they're not exposed to the web we can remove this special case.

Differential Revision: https://phabricator.services.mozilla.com/D28071

--HG--
extra : moz-landing-system : lando
2019-04-19 04:41:17 +00:00
Emilio Cobos Álvarez d3f8a1f5a6 Bug 1544535 - Bug 1542263 - Don't keep two list of stylesheets in ServoStyleSet. r=firefox-style-system-reviewers,jwatt
Just one set of stylesheets is enough. While at it, unify SheetType and Origin.

Differential Revision: https://phabricator.services.mozilla.com/D27564

--HG--
extra : moz-landing-system : lando
2019-04-19 04:20:31 +00:00
Razvan Maries 74e5a11e50 Backed out changeset 24d0d307385d (bug 1545440) for perma failures on browser_parsable_css.js. CLOSED TREE 2019-04-19 02:06:41 +03:00
Andreea Pavel eb0b5758ea Merge mozilla-central to autoland. on a CLOSED TREE 2019-04-19 00:48:30 +03:00
Mats Palmgren fcba4dfac7 Bug 1500708 - [cssom][css-grid] 'grid-auto-flow: row dense' should serialize to 'dense' since 'row' is implied. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D28058

--HG--
extra : rebase_source : dd8109fa0853bc73e8859198196aa52b5523786a
2019-04-18 01:16:03 +02:00