Commit graph

7437 commits

Author SHA1 Message Date
Bastien Orivel
053070e63b Update encoding_rs 2018-11-19 12:06:32 +01:00
Bastien Orivel
5fdcd8a850 Update bindgen 2018-11-19 12:06:28 +01:00
Bastien Orivel
9a7eeb349a Update crossbeam-channel to 0.3 2018-11-18 19:33:19 +01:00
Emilio Cobos Álvarez
06fe0a1fc0
style: Fix formatting. 2018-11-17 09:56:05 +01:00
Alex Gaynor
cd75cd6a86
style: fixed an unused import warning.
Differential Revision: https://phabricator.services.mozilla.com/D12028
2018-11-17 09:56:05 +01:00
Emilio Cobos Álvarez
ebb57eff22
style: Add a mechanism to serialize shorthands for getComputedStyle().
This implements the mechanism reusing the animation machinery for now, so it
asserts in a few cases that this wouldn't handle correctly.

For shorthands that have colors and other bits we'd need a more sophisticated
mechanism with a bit more code (that resolves colors and such), but it'd look
something like this regardless, and we should have this in any case.

Differential Revision: https://phabricator.services.mozilla.com/D11944
2018-11-17 09:56:05 +01:00
Emilio Cobos Álvarez
60331f01d0
style: Make the serialization of the mask shorthand more compact.
This helps to preserve the old longhand form when possible (mask used to be a
longhand), which will be relevant when we serialize this for the computed
value.

Differential Revision: https://phabricator.services.mozilla.com/D11943
2018-11-17 09:56:04 +01:00
Emilio Cobos Álvarez
0e7adcf18a
style: Simplify background-repeat.
This way we always serialize in the shortest form, and take less space.

This is useful because when serializing uncomputed values we'd like to compare
to the initial value to avoid serializing parts of a shorthand, but with the
existing implementation we would generate always a second keyword, which means
that we'll never match it.

This also matches Chrome and WebKit, incidentally, so I'm pretty confident the
behavior change when serializing specified style is web-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D11941
2018-11-17 09:56:04 +01:00
Emilio Cobos Álvarez
a5f0eb9205
style: Also move page-break-inside outside of mako.
Differential Revision: https://phabricator.services.mozilla.com/D11876
2018-11-17 09:56:04 +01:00
Emilio Cobos Álvarez
d9de68ad6a
style: Move the page-break-{before,after} properties to not use mako.
And respect the computed value of `left` / `right` / etc.

Differential Revision: https://phabricator.services.mozilla.com/D11872
2018-11-17 09:56:03 +01:00
Timothy Guan-tin Chien
9f28242def
Remove dom.webcomponents.customelements.enabled pref.
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

Differential Revision: https://phabricator.services.mozilla.com/D11249
2018-11-17 09:56:03 +01:00
Timothy Guan-tin Chien
3977854ee2
Remove dom.webcomponents.shadowdom.enabled.
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

Differential Revision: https://phabricator.services.mozilla.com/D11183
2018-11-17 09:56:02 +01:00
Cameron McCormack
dad9ad6b31
style: Store MediaFeatureDescription references as an index into the MEDIA_FEATURES array.
The current use of a static reference is incompatible with sharing style sheet data
across processes.

Differential Revision: https://phabricator.services.mozilla.com/D11845
2018-11-17 09:56:02 +01:00
Cameron McCormack
1576dd4c5b
style: Store variable references with a boxed slice rather than a PrecomputedHashSet.
Once we've parsed the variable references, there is no need to keep an entire HashSet
object around, as all we do is iterate over the values.

Differential Revision: https://phabricator.services.mozilla.com/D11735
2018-11-17 09:56:01 +01:00
Boris Chiou
41d2f7f3a2
style: Support keywords [x|y|z] on rotate.
Update the parser and the serialization to support the keywords, [x|y|z].

Differential Revision: https://phabricator.services.mozilla.com/D11531
2018-11-17 09:56:01 +01:00
Emilio Cobos Álvarez
f486ef7e47
style: Add an atom bit to know whether we're ascii lowercase.
And thus massively speed up ascii-case-insensitive atom comparisons when both
atoms are lowercase (which is the common case by far).

This removes almost all the slow selector-matching in this page, and it seems
an easier fix than storing the lowercased version of all class-names in quirks
mode in elements and selectors...

Differential Revision: https://phabricator.services.mozilla.com/D10945
2018-11-17 09:56:01 +01:00
Boris Chiou
d8bd29292e
style: Parse any order of number and angle for Rotate.
Rotate accepts rotate axis and angle in any order
(i.e. <number>{3} <angle> or <angle> <number>{3}), so we rewrite the
parser.

Differential Revision: https://phabricator.services.mozilla.com/D11417
2018-11-17 09:56:00 +01:00
Boris Chiou
0b9ecbccfe
style: Rewrite the interpolation of Rotate to return correct type.
The original implementation always returns Rotate::Rotate3D, but it is
not correct, so we have to rewrite it:
1. If both from value and to value are none, we don't have to convert it
   into identity value, so just return None.
2. If one of the value is none, we replace it with an identity value based on
   the other one's rotate axis.
3. If we only have 2D rotation, we just animate the <angle>.
4. Otherwise, we do interpolation by 3D rotation.

Differential Revision: https://phabricator.services.mozilla.com/D11247
2018-11-17 09:56:00 +01:00
Emilio Cobos Álvarez
c75a3e4db1
style: Remove serialize_basicshape_position.
Per https://github.com/w3c/csswg-drafts/issues/2274. There's a whole lot of new failures, but those need to be updated along with the spec changes in that issue.

We did resolve that position serialized the same everywhere though.

Differential Revision: https://phabricator.services.mozilla.com/D1933
2018-11-17 09:55:59 +01:00
Emilio Cobos Álvarez
6b5117d82d
style: Remove outdated comment. 2018-11-17 09:55:59 +01:00
Emilio Cobos Álvarez
4c3646eff0
style: Allow user-select: -moz-text on user-agent stylesheets only.
It's only used in contenteditable.css, and same usage in comm-central. That
sheet is loaded as a ua sheet so let's restrict it to that. No relevant
external usage either. This value was introduced in bug 1181130.

Differential Revision: https://phabricator.services.mozilla.com/D11584
2018-11-17 09:55:59 +01:00
Emilio Cobos Álvarez
4bc9bc11e1
style: Remove user-select: -moz-all.
It's an attempt of an alias to `all`, except it doesn't get handled in all
places.

Seems unused both in comm-central and mozilla-central, and all external usage I
could find is followed by -webkit-user-select: all.

Differential Revision: https://phabricator.services.mozilla.com/D11582
2018-11-17 09:55:55 +01:00
Emilio Cobos Álvarez
0c8b1a9004
style: Remove unimplemented values of the user-select property.
Can't believe we literally had no code to handle them.

Differential Revision: https://phabricator.services.mozilla.com/D11581
2018-11-17 09:55:51 +01:00
Emilio Cobos Álvarez
1aa6725f9a
style: Move user-select outside of mako.
This is the first step to unprefix user-select.

This has no behavior change, it's just a nicer way to do the same thing which
allows us to unship individual values more easily using parse(condition).

Differential Revision: https://phabricator.services.mozilla.com/D11580
2018-11-17 09:55:47 +01:00
Emilio Cobos Álvarez
fcada8a71e
style: Remove outdated comment. 2018-11-17 09:52:52 +01:00
CYBAI
db008b9393 Fix wrong spec link 2018-11-11 14:26:06 +08:00
Emilio Cobos Álvarez
bd9c53c5da
style: Manually extinguish multi-line use statements. 2018-11-10 21:42:24 +01:00
Emilio Cobos Álvarez
212b3e1311
style: Revert try -> r#try change.
Since we're in an inconsistent state because mako files weren't updated, and
it's really really ugly.
2018-11-10 21:42:17 +01:00
Emilio Cobos Álvarez
155caba595
style: Cargo fix + ./mach fmt. 2018-11-10 21:11:47 +01:00
Boris Chiou
c6ead1dc0e
style: Percentage values of translate are serialized as percent for computed values.
Basically, we rewrite the type of generics::transform::Translate and its
ToCss to match the spec. Besides, we always serialize Translate by servo,
so we could drop a lot of duplicated code.

Differential Revision: https://phabricator.services.mozilla.com/D11206
2018-11-10 21:11:36 +01:00
Emilio Cobos Álvarez
d9453bc0ea
style: Remove dynamic HTML5 atoms.
Co-authored-by: Nicholas Nethercote <nnethercote@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D11035
2018-11-10 21:11:19 +01:00
Mats Palmgren
35c061179a
style: Add -webkit-appearance:progress-bar and make that the default for <progress> for compatibility with other UAs.
Keep our old 'progressbar' as an alias for now, but unship
'progresschunk' by restricting it to UA/chrome sheets only.
Unship 'progresschunk-vertical' by removing it since it's
not used internally for anything.

Bug: 1501506
Reviewed-by: jwatt
2018-11-10 21:11:01 +01:00
Mats Palmgren
c194f42596
style: Add -webkit-appearance:meter and make that the default for <meter> for compatibility with other UAs.
Keep our old value 'meterbar' as an alias for now, but unship 'meterchunk'
by restricting it to UA/chrome sheets only.

Bug: 1501483
Reviewed-by: jwatt
2018-11-10 21:10:42 +01:00
Emilio Cobos Álvarez
667457a16c
style: Split up push_applicable_declarations.
Introduce RuleCollector, which contains all the state we need during the
cascade, and allows to reuse a bit of code.

Differential Revision: https://phabricator.services.mozilla.com/D11233
2018-11-10 21:10:34 +01:00
Emilio Cobos Álvarez
b7cefa5814
style: Cleanup text-align.
Use derive(FromPrimitive) instead.

Differential Revision: https://phabricator.services.mozilla.com/D11332
2018-11-10 21:10:25 +01:00
Emilio Cobos Álvarez
fa764fc8e9
style: Implement overflow-wrap: anywhere.
Per https://github.com/w3c/csswg-drafts/issues/2682

Differential Revision: https://phabricator.services.mozilla.com/D11328
2018-11-10 21:10:19 +01:00
Ting-Yu Lin
087ac72f73
style: Enable CSS column-span in UA stylesheet, and update test expectations.
We use "column-span: all" in ua.css in Part 3. To be able to flip the pref
in individual wpt tests, we need column-span to be always enabled
in UA stylesheets.

Differential Revision: https://phabricator.services.mozilla.com/D5212
2018-11-10 21:10:11 +01:00
Emilio Cobos Álvarez
9845a857ce
style: Allow ::slotted()::placeholder.
Differential Revision: https://phabricator.services.mozilla.com/D11132
2018-11-10 21:10:03 +01:00
Simon Sapin
b1822a39fa cargo fix --edition --features gecko 2018-11-10 17:47:28 +01:00
Simon Sapin
a15d33a10e cargo fix --edition 2018-11-10 17:47:28 +01:00
Simon Sapin
e1fcffb336 Use 2018-style paths in code generated by Mako 2018-11-10 17:47:28 +01:00
Emilio Cobos Álvarez
8cb5b149eb
style: Some minor formatting nits. 2018-11-08 15:22:31 +01:00
Emilio Cobos Álvarez
175e594652
style: Format recent patches. 2018-11-08 15:22:29 +01:00
Emilio Cobos Álvarez
efa54a876a
style: Fix code style of a recent commit. 2018-11-08 15:22:29 +01:00
Boris Chiou
23f2e99e99
style: Fix the default behavior of scale:<number>{1}.
The current spec says: "If only the X value is given, the Y value
defaults to the same value.", so we should update the behavior.

Besides, we also update the serialization, so we serialization both
specified and computed value by servo. We enable the preference
for all the css-transforms, so some of them are passed now.

Differential Revision: https://phabricator.services.mozilla.com/D10638
2018-11-08 15:22:28 +01:00
Emilio Cobos Álvarez
264a679c50
style: followup post-review nit. 2018-11-08 15:22:27 +01:00
Cameron McCormack
de5584c1f6
style: Store the Rust QuotePair slice as the computed quotes value in Gecko style structs.
Depends on D10651

Differential Revision: https://phabricator.services.mozilla.com/D10652
2018-11-08 15:22:26 +01:00
Cameron McCormack
acf7b65f36
style: Make quotes property representation allocate less.
Differential Revision: https://phabricator.services.mozilla.com/D10650
2018-11-08 15:22:26 +01:00
Cameron McCormack
56fd3b786f
style: Serialize background-size: auto auto as "auto".
With this change, all of Chrome, Edge, Firefox, and Safari serialize
background-size by omitting the second "auto" if the value is "auto
auto".  Other keywords are still repeated.

Differential Revision: https://phabricator.services.mozilla.com/D10446
2018-11-08 15:22:25 +01:00
Ting-Yu Lin
68f4ad9557
style: Remove preference "layout.css.shape-outside.enabled".
shape-outside, shape-margin, shape-image-threshold have been shipped in Firefox
62. We can remove the preference.

The change in devtools/shared/css/generated/properties-db.js is generated by
"./mach devtools-css-db"

The actual shape-image CORS mode tests in file_shape_outside_CORS.html are
moved into test_shape_outside_CORS.html because we don't need the <iframe>
trick to enable the feature.

Differential Revision: https://phabricator.services.mozilla.com/D10804
2018-11-08 15:22:24 +01:00