Commit graph

7064 commits

Author SHA1 Message Date
Boris Chiou
cb2533d61a
style: Use alias for StyleDisplay and StyleDisplayMode.
Map these two types to their original rust type in rust-bindgen.

Differential Revision: https://phabricator.services.mozilla.com/D10141
2018-11-05 12:30:38 +01:00
Boris Chiou
591a47858b
style: Use alias for StyleAppearance.
So we could avoid generating it in rust-bindgen and drop transmute.

Differential Revision: https://phabricator.services.mozilla.com/D10304
2018-11-05 12:30:29 +01:00
Boris Chiou
b00bbb3be7
style: Add a special list for cbindgen types to avoid generating redundant rust types.
We will blacklist this type and add a module raw line to map the gecko
type to its rust type (as an alias).

Differential Revision: https://phabricator.services.mozilla.com/D10303
2018-11-05 12:30:18 +01:00
Brian Birtles
8bc8a0bfa0
style: Interpolate the angle between mis-matched rotate() functions when the angle of one is zero.
Bug: 1501176
Reviewed-by: hiro
2018-11-05 12:29:52 +01:00
Emilio Cobos Álvarez
edf6e6a54f
style: Update cbindgen due to breaking change.
https://github.com/eqrion/cbindgen/pull/233 changed the way one of the options
we use work.

I think the new behavior is better, but we should do this sooner rather than
later, and fix broken builds.

Differential Revision: https://phabricator.services.mozilla.com/D10301
2018-11-05 12:29:37 +01:00
Emilio Cobos Álvarez
badb8f398a
style: Support ::before / ::after on ::slotted pseudos.
See https://github.com/w3c/csswg-drafts/issues/3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994
2018-11-05 12:29:30 +01:00
Sean Voisen
62aaf865aa
style: Ignore border-image-source when overriding document colors.
Differential Revision: https://phabricator.services.mozilla.com/D10017
2018-11-05 12:29:20 +01:00
Emilio Cobos Álvarez
a3fcfb6435
style: Add a fast path for querySelector{,All} when we have classes or tags in the rightmost compound.
Before this patch we were only optimizing the case of a single selector, which
is fine, but not enough to catch ones like .foo .bar or so.

This patch allows us to optimize classes and tags in the rightmost compound,
while keeping the current optimization for #id selectors.

Need to profile this, but code-wise should be ready for review.

Differential Revision: https://phabricator.services.mozilla.com/D9351
2018-11-05 12:29:10 +01:00
Emilio Cobos Álvarez
a9af61e3be
style: Don't allow auto in grid line names.
See https://github.com/w3c/csswg-drafts/issues/2856.

Differential Revision: https://phabricator.services.mozilla.com/D9882
2018-11-05 12:28:59 +01:00
Emilio Cobos Álvarez
26040d1b00
style: Remove unused style constant.
Also remove specified-value-only keywords, since those are handled
only in Rust code and C++ doesn't need to know about them.

Differential Revision: https://phabricator.services.mozilla.com/D9634
2018-11-05 12:28:10 +01:00
Emilio Cobos Álvarez
05f9f10a1c
style: Fix servo build and tidy lints. 2018-10-28 23:52:13 +01:00
Mats Palmgren
a51b4e754c
style: Force line-height:normal for themed comboboxes for compat with other UAs.
Bug: 1501908
Reviewed-by: emilio
2018-10-28 23:45:29 +01:00
Emilio Cobos Álvarez
20d9a076d4
style: Properly handle exhaustive matches in animation keywords to avoid a warning.
Need to do the gecko_inexhaustive thing because those animation properties have
an EndGuard_ generated by IPDL I suspect.
2018-10-28 23:45:24 +01:00
Boris Chiou
0c057d9299
style: Implement steps(jump-*) functions.
1. Add a new preference, layout.css.step-position-jump.enabled, for
   step(_, jump-*) timing functions.
2. We still keep JumpEnd and End tags, even though there is no difference
   between them. Therefore, we could disable the preference if needed.
3. Update the calculation of StepTiming to match the algorithm in the spec.
4. For servo, we implement the correct step function algorithm except
   for the handling of before_flag. This could be fixed later.

Depends on D9313

Differential Revision: https://phabricator.services.mozilla.com/D9314
2018-10-28 23:45:03 +01:00
Boris Chiou
3723042937
style: Generate StyleTimingFunction and drop ns_timing_function.rs.
First, we generate StyleComputedTimingFunction by cbindgen from Rust, and use
it in nsTimingFunction, so we could copy it directly without handling
the different memory layout. However, we have to rewrite the
nsTimingFunction and mozilla::ComputedTimingFunction for this.

Second, the rust-bindgen seems cannot generate the correct generic members
from complex C++ templates, especially for the nested template struct,
(https://github.com/rust-lang-nursery/rust-bindgen/issues/1429)
So we have to hide StyleTimingFunction to avoid the compilation errors.

Differential Revision: https://phabricator.services.mozilla.com/D9313
2018-10-28 23:44:51 +01:00
Boris Chiou
2bbcb5c633
style: Replace u32 with computed::Integer for computed::TimingFunction.
We make sure the step number is always positive, so using
computed::Integer is safe and can derive ToComputedValue.

Depends on D9311

Differential Revision: https://phabricator.services.mozilla.com/D9845
2018-10-28 23:44:42 +01:00
Boris Chiou
a20b6a5166
style: Split TimingFunction into a separate file to match spec.
TimingFunction is defined in a separate spec (i.e. css-easing), instead
of transform, so we move it into a different file.

Depends on D9310

Differential Revision: https://phabricator.services.mozilla.com/D9311
2018-10-28 23:44:26 +01:00
Boris Chiou
3a536f463c
style: Drop frames() timing function.
frames() timing function was removed from the spec, so we drop it.
Besides, some devtool tests are removed because they use frame(). I will
add them back by using new step function later.

Differential Revision: https://phabricator.services.mozilla.com/D9309
2018-10-28 23:44:16 +01:00
Brian Birtles
990f2c6bb9
style: Compare absolute dot-product to 1.0 when interpolating quaternions.
See the extended commit message for the following spec change:

  6b36d41ebc

Basically, by failing to take the absolute value, for certain content we can end
up doing division by zero which will mean that the test included in this patch
will cause an assertion to fail in debug builds and return
"matrix(NaN, NaN....)" in release builds.

Differential Revision: https://phabricator.services.mozilla.com/D9618
2018-10-28 23:44:04 +01:00
tb120
ac873c714f
style: Convert NS_STYLE_ANIMATION_PLAY_STATE_* to scoped enum StyleAnimationPlayState.
This change removes directives NS_STYLE_ANIMATION_PLAY_STATE_* and replaces the
values with those from a scoped enum called StyleAnimationPlayState.

Differential Revision: https://phabricator.services.mozilla.com/D9382
2018-10-28 23:43:53 +01:00
Emilio Cobos Álvarez
0191705e87
style: Use searchfox links instead of dxr links for nsRuleNode.
Searchfox has better blame.

Differential Revision: https://phabricator.services.mozilla.com/D9375
2018-10-28 23:43:45 +01:00
Brian Birtles
fc59165ff3
style: Implement the even more forgiving interpolation rules for transform lists.
As discussed in:

  https://github.com/w3c/csswg-drafts/issues/927

with tentative spec text:

  https://github.com/w3c/csswg-drafts/pull/3215

Differential Revision: https://phabricator.services.mozilla.com/D9185
2018-10-28 23:43:32 +01:00
bors-servo
2304f02123
Auto merge of #21971 - emilio:animations, r=jdm
Revert "style: Make the transitions code make sense again."

This reverts commit d6092fae27.

This change actually makes transitions start, and our code for stopping
transitions is just bogus, so we just keep re-starting them over and over, which
is not good.

<!-- 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/21971)
<!-- Reviewable:end -->
2018-10-19 23:00:31 -04:00
Emilio Cobos Álvarez
3b7b21ebb5
Revert "style: Make the transitions code make sense again."
This reverts commit d6092fae27.

This change actually makes transitions start, and our code for stopping
transitions is just bogus, so we just keep re-starting them over and over, which
is not good.
2018-10-19 01:21:04 +02:00
Emilio Cobos Álvarez
1505eaaade
style: Fix Servo build. 2018-10-19 01:15:26 +02:00
Emilio Cobos Álvarez
b66e828842
Fix various tidy issues. 2018-10-19 01:01:27 +02:00
Emilio Cobos Álvarez
fb0702476a
style: Remove StaticId.
Destructors in statics are ok now.

Differential Revision: https://phabricator.services.mozilla.com/D9004
2018-10-19 00:40:18 +02:00
Emilio Cobos Álvarez
d0c96bff27
style: followup test fix to the followup build fix. 2018-10-19 00:40:09 +02:00
Emilio Cobos Álvarez
edc40ce320
style: Implement @supports selector() syntax.
This implements the selector(<complex-selector>) syntax for @supports.

See https://github.com/w3c/csswg-drafts/issues/3207 for explainer and
discussion.

Probably would should wait for that to be sorted out to land this, or maybe we
should put it behind a pref to get the code landed and change our
implementation if the discussion there leads to a change.

Differential Revision: https://phabricator.services.mozilla.com/D8864
2018-10-19 00:40:02 +02:00
Emilio Cobos Álvarez
4e356b4bb9
style: Clear host rules from clear_cascade_data.
While at it, also measure them for about:memory.

Differential Revision: https://phabricator.services.mozilla.com/D8972
2018-10-19 00:39:41 +02:00
Cameron McCormack
5770247af0
style: Make css::URLValue::IsLocalRef call into CssUrlData::is_fragment.
This fixes the issue that we should no longer be looking for control characters.

Differential Revision: https://phabricator.services.mozilla.com/D8876
2018-10-19 00:39:31 +02:00
Cameron McCormack
623363e3c8
style: Have css::URLValue get URLExtraData from its CssUrlData.
Depends on D8874

Differential Revision: https://phabricator.services.mozilla.com/D8875
2018-10-19 00:39:22 +02:00
Cameron McCormack
c4491ea39d
style: Make css::URLValue hold on to a CssUrlData, not just its serialization.
Differential Revision: https://phabricator.services.mozilla.com/D8874
2018-10-19 00:39:13 +02:00
Benjamin Bouvier
ecb9de4acd
style: Apply rustfmt on build_gecko.rs.
Bug: 1499359
Reviewed-by: emilio
2018-10-19 00:38:58 +02:00
Benjamin Bouvier
ff34daa384
style: Remove unused HashMap import and remove namespacing around Table.
Bug: 1499359
Reviewed-by: emilio
2018-10-19 00:38:36 +02:00
Boris Chiou
c9d39b2b19
style: Move MozLength and MaxLength into generics.
Move MozLength and MaxLength into generics, and drop the manual implementation
of ToComputedValue.

Differential Revision: https://phabricator.services.mozilla.com/D8291
2018-10-19 00:38:25 +02:00
Boris Chiou
53eb6cd667
style: Store the correct computed values for keywords for sizing properties.
In order to get the correct computed value of these keywords, we have to
make sure we store the correct computed values in sizing properties in
both inline axis and block axis.

-moz-max-content and -moz-min-content should behave as the property's
initial value in block axis. -moz-fit-content and -moz-available are not
supported in block axis, so we also treat them as initial values.

Differential Revision: https://phabricator.services.mozilla.com/D8290
2018-10-19 00:38:14 +02:00
Benjamin Bouvier
170909fc31
style: Share bindgen flags globally.
Bug: 1495669
Reviewed-by: emilio,froydnj
2018-10-19 00:37:30 +02:00
Emilio Cobos Álvarez
2c52210ba7
style: Remove PseudoElement::inherits_all.
I plan to change servo to use all: inherit on its UA sheet.

I hope the patch below should make it good enough performance-wise. And also,
it's probably broken so I don't think it's worth supporting it specially.

Differential Revision: https://phabricator.services.mozilla.com/D8686
2018-10-19 00:37:24 +02:00
Emilio Cobos Álvarez
8a47c8b2e6
style: Don't copy structs to write the same value to them.
This makes us not allocate useless style structs when you're doing something
like resetting an already-reset property, or inheriting an already-inherited
property.

Seemed simple enough that I think we should do it. In practice we don't even
should pay an extra branch because I expect the compiler to be smart enough and
merge it with the one in the mutate() call.

Differential Revision: https://phabricator.services.mozilla.com/D8685
2018-10-19 00:37:17 +02:00
Cameron McCormack
4e174ace3b
style: Use helper function to set length and copy into nsTArrays of PODs from Rust.
Differential Revision: https://phabricator.services.mozilla.com/D8058
2018-10-19 00:37:08 +02:00
Cameron McCormack
d960db340c
style: Part 11: Move Gecko borrowed FFI types to a separate header file.
Differential Revision: https://phabricator.services.mozilla.com/D8653
2018-10-19 00:36:59 +02:00
Cameron McCormack
89e4d6c049
style: Move list of Servo Boxed types to a separate header file.
Differential Revision: https://phabricator.services.mozilla.com/D8652
2018-10-19 00:36:49 +02:00
Cameron McCormack
52d054ab5f
style: Add comments to ServoBindingTypes.h
Differential Revision: https://phabricator.services.mozilla.com/D8650
2018-10-19 00:36:40 +02:00
Diego Pino Garcia
3d41f0911f
style: Implement text-transform: full-size-kana.
Bug: 1498148
Reviewed-by: xidorn
2018-10-19 00:36:27 +02:00
Noemi Erli
f68f6669f4
Backed out changeset a00b402fb8e8 (bug 1498148) for Linting failure in builds/worker/checkouts/gecko/tools/lint/wpt.yml CLOSED TREE 2018-10-19 00:36:20 +02:00
Diego Pino Garcia
8d2124d820
style: Implement text-transform: full-size-kana.
Bug: 1498148
Reviewed-by: xidorn
2018-10-19 00:36:05 +02:00
Mats Palmgren
a400285eef
style: Unship most of the -moz-appearance values that aren't supported by -webkit-appearance in other UAs.
Bug: 1496720
Reviewed-by: emilio
2018-10-19 00:35:37 +02:00
Emilio Cobos Álvarez
2d9c764e2c
style: remove unneeded cast. 2018-10-19 00:35:31 +02:00
Emilio Cobos Álvarez
42def5a011
style: Always compute angle values to degrees.
This matches the spec, https://drafts.csswg.org/css-values/#angles, which says:

> All <angle> units are compatible, and deg is their canonical unit.

And https://drafts.csswg.org/css-values/#compat, which says:

>When serializing computed values [...], compatible units [...] are converted into a single canonical unit.

And also other implementations (Blink always serializes angles as degrees in
computed style for example).

Also allows us to get rid of quite a bit of code, and makes computed angle value
representation just a number, which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D8619
2018-10-19 00:35:22 +02:00