Commit graph

7437 commits

Author SHA1 Message Date
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Jan Andre Ikenmeyer
1097d3fe00
Replace http with https in docs 2018-11-06 11:39:09 +01:00
Emilio Cobos Álvarez
ac6f921588
style: Fix servo build. 2018-11-05 12:44:54 +01:00
Emilio Cobos Álvarez
8560c8dd5a
Fix tidy issues. 2018-11-05 12:33:39 +01:00
Emilio Cobos Álvarez
99f9d84555
style: Simplify invalid custom property handling.
It's a bit useless to keep a set of invalid properties if we're going
to use them just to reject lookups into another key. This makes it more
consistent with the cascade / no-references code, and should not change
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D9632
2018-11-05 12:33:28 +01:00
Emilio Cobos Álvarez
b7da1bac88
style: Implement the env() function with hardcoded zeros for safe-area-inset.
Intent to Implement and Ship: https://groups.google.com/d/msg/mozilla.dev.platform/EVKyR1B87T0/_l-_qK8SAAAJ

Differential Revision: https://phabricator.services.mozilla.com/D9609
2018-11-05 12:33:16 +01:00
Emilio Cobos Álvarez
5af6abfb78
style: Simplify the SVG animation code.
It's overly generic for no good reason.

Differential Revision: https://phabricator.services.mozilla.com/D10844
2018-11-05 12:33:05 +01:00
Emilio Cobos Álvarez
c88a483322
style: Move animation of svg-related bits outside of animated_properties.
Being in mako is unnecessary, and makes it harder to debug and such.

Differential Revision: https://phabricator.services.mozilla.com/D10843
2018-11-05 12:32:58 +01:00
Emilio Cobos Álvarez
8b49ef813f
style: Remove nscsspropertyid_is_{animatable,transitionable}.
There are better ways, plus the existing code didn't handle aliases at
all (not that it needed to, but it's better if it does).

Differential Revision: https://phabricator.services.mozilla.com/D10838
2018-11-05 12:32:52 +01:00
Emilio Cobos Álvarez
707bd841a8
style: Move various font-related animation code to its own file.
Similarly, the code is not trivial and doesn't really need to be in
mako.

Differential Revision: https://phabricator.services.mozilla.com/D10842
2018-11-05 12:32:45 +01:00
Emilio Cobos Álvarez
778ae7d745
style: Move various length animation implementations to its own file.
It's nicer, I think.

Differential Revision: https://phabricator.services.mozilla.com/D10841
2018-11-05 12:32:40 +01:00
Emilio Cobos Álvarez
f159c20198
style: Move the keyframes property priority stuff outside of animated_properties.
Similarly, no need to be here.

Differential Revision: https://phabricator.services.mozilla.com/D10840
2018-11-05 12:32:33 +01:00
Emilio Cobos Álvarez
282edf1a13
style: Move shorthand IDL order stuff out of animated_properties.
Doesn't really need to be in a mako file.

Differential Revision: https://phabricator.services.mozilla.com/D10839
2018-11-05 12:32:25 +01:00
Emilio Cobos Álvarez
d035d02517
style: Don't keep a separate list of ignored-when-colors-disabled longhands.
Most of the change is moving sets around to be static functions on
LonghandIdSet. I think I like that pattern, but I can also make the new set a
global static and add mako code to be `pub` or something.

Though I think the LonghandIdSet::foo().contains(..) pattern is nice to read :)

Differential Revision: https://phabricator.services.mozilla.com/D10653
2018-11-05 12:32:15 +01:00
Emilio Cobos Álvarez
33fed65597
style: Don't match document author rules if not needed for revalidation.
When you're in a ShadowRoot and can share style with a sibling, the sharing code
is smart enough to skip document author rules.

But then it could get confused if you also include document rules, since
revalidation selectors are matched against these.

This is not a correctness issue, because we're matching more than what we need,
and avoid sharing if we failed.

Also fix the detection for user rules in any_applicable_rule_data.

Differential Revision: https://phabricator.services.mozilla.com/D10117
2018-11-05 12:32:02 +01:00
Emilio Cobos Álvarez
a7b5ba14c0
style: Use references in the shapes code.
It doesn't make much sense to return const UniquePtr<Foo>& for something that
can't be null, it's just confusing.

Also make more stuff actually const.

Differential Revision: https://phabricator.services.mozilla.com/D10647
2018-11-05 12:31:49 +01:00
Cameron McCormack
52c3ba00b3
style: Fix inconsistent CRISPEDGES constant name.
Differential Revision: https://phabricator.services.mozilla.com/D10452
2018-11-05 12:31:38 +01:00
Cameron McCormack
d43c4ce81e
style: Support unprefixed image-rendering: crisp-edges.
For now, we keep supporting the prefixed version, since there are examples/instructions
on the Web that don't include an unprefixed value.

Differential Revision: https://phabricator.services.mozilla.com/D10451
2018-11-05 12:31:22 +01:00
Cameron McCormack
5976956e1c
style: Handle reversed ranges in @font-face descriptors.
Differential Revision: https://phabricator.services.mozilla.com/D10327
2018-11-05 12:31:11 +01:00
Boris Chiou
33b2514198
style: Drop "mozilla" prefix in cbindgen_types in ServoBindings.toml.
A minor update to drop the redundant "mozilla" namespace prefix in
`cbindgen_types` array.

Depends on D10305

Differential Revision: https://phabricator.services.mozilla.com/D10325
2018-11-05 12:31:02 +01:00
Boris Chiou
b81bbb85b4
style: Use alias for StylePathCommand.
So we could drop transmute in svg_path related functions.

Differential Revision: https://phabricator.services.mozilla.com/D10140
2018-11-05 12:30:54 +01:00
Boris Chiou
c7027e2676
style: Use alias for StyleFillRule.
This needs to update the "fill-rule" and "clip-rule" to use
predefined_type to avoid some compilation errors.

Differential Revision: https://phabricator.services.mozilla.com/D10142
2018-11-05 12:30:46 +01:00
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