Commit graph

264 commits

Author SHA1 Message Date
bors-servo
8f3f8098c3 Auto merge of #16006 - upsuper:box-ordinal-group, r=Manishearth
Implement -moz-box-ordinal-group property

This PR fixes #16000.

<!-- 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/16006)
<!-- Reviewable:end -->
2017-03-17 15:15:01 -07:00
Xidorn Quan
9233882d49 Switch z-index to use predefined integer type 2017-03-17 23:08:03 +11:00
Xidorn Quan
b489c4ed90 Make Interpolate impl generic for Either 2017-03-17 23:08:00 +11:00
Xidorn Quan
0d556ddbf0 Add a predefined integer type 2017-03-17 23:07:57 +11:00
Hiroyuki Ikezoe
52bee9a4cf Add AnimationValueMap and expose it in FFI.
Current Gecko composes all of effects in the composite order at once.
We can put each computed value into this AnimationValueMap every time composing
an effect.
2017-03-17 12:29:34 +09:00
Bobby Holley
8cf331a498 Rearrange PropertyDeclaration to avoid embedding DeclaredValue.
From https://bugzilla.mozilla.org/show_bug.cgi?id=1347719

This effectively combines the discriminants of the two enums and reduces the
size of PropertyDeclaration by one word.

MozReview-Commit-ID: 9rCRiSVZTQT
2017-03-16 14:40:55 -07:00
Hiroyuki Ikezoe
16cba0876d Pass transition-property into gecko's struct. 2017-03-07 13:27:49 +09:00
austinprete
a2074f2653 Implement parsing/serialization for caret-color 2017-03-05 10:52:32 -07:00
Xidorn Quan
03f6d21cb5 Make DeclaredValue store CSSWideKeyword
Rather than having separate variant for each CSS-wide keyword.
2017-03-02 11:09:05 +11:00
Simon Sapin
0f2d000a23 Borrow input to match_ignore_ascii_case!
In cssparser version 0.11, this macro will stop implicitly borrowing its
own input.
2017-02-26 10:40:09 +01:00
Ethan Glasser-Camp
dd4f331603 Add support for MaxLength
This builds on the ExtremumLength type from the previous commit.
2017-02-24 15:44:49 -05:00
Ethan Glasser-Camp
76de979231 Implement a MinLength type
Implement an ExtremumLength type which contains all the enumerated
keyword values for min-width, min-height, max-width, and
max-height. Then, implement a MinLength which can be used for min-width
and min-height. So far this just maps to Gecko values.

Refs #13821.
2017-02-23 16:28:26 -05:00
bors-servo
af292c4a71 Auto merge of #15682 - upsuper:arc-types, r=Manishearth
Simplify defining arc ffi types

r? @Manishearth

I don't have a good sense for creating syntax... so if you have any suggestion for the syntax of `impl_arc_ffi` macro, it would be appreciated.

<!-- 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/15682)
<!-- Reviewable:end -->
2017-02-22 15:58:35 -08:00
Xidorn Quan
0cac276891 Simplify defining arc ffi types 2017-02-23 10:22:39 +11:00
Hiroyuki Ikezoe
396db281e3 Fill computed property values where the propery is missing in initial and final keyframes.
@keyframes anim {
  from { opacity: 0; transform: none; }
  to { transform: none; }
}

In above case, we have to add opacity property and value in the 'to' keyframe.
2017-02-22 19:04:50 +09:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Manish Goregaokar
6b0d3902de Factor out ClipRect type into values; use Either for clip
MozReview-Commit-ID: C3R1erJdiID
2017-02-09 15:09:35 -08:00
Nazım Can Altınova
adb6d20293 Box DeclaredValue::WithVariables 2017-02-09 11:10:10 +01:00
Nazım Can Altınova
78afe2b8d1 Box larger specified values to avoid memmove impact 2017-02-09 11:10:08 +01:00
Hiroyuki Ikezoe
22ff72dfc0 Make transform property animatable.
This just changes animatable to True, drops 'if product == "servo" block
, fixes indentations and moves 'use' declarations at the top of the file.

MozReview-Commit-ID: A96oxYXmknV
2017-02-04 08:54:00 +09:00
Hiroyuki Ikezoe
2bfa0f7a2d Bug 1328787 - Part 10: Set Keyframe.mPropertyValues for the case where keyframe is not specified. r=heycam 2017-01-29 09:07:41 +09:00
Hiroyuki Ikezoe
aa6372d99d Bug 1328787 - Part 9: Set Keyframe.mPropertyValues for the case where keyframe is specified. r=heycam
MozReview-Commit-ID: Ayt7IsYShl4
2017-01-29 09:07:41 +09:00
Manish Goregaokar
d87b710fdd stylo: Store servo computed values for animation properties
MozReview-Commit-ID: IoQLN5tdIBw
2017-01-11 15:24:53 -08:00
Emilio Cobos Álvarez
b023791af5
style: Document the animated_properties code. 2016-12-31 12:16:55 +01:00
Hiroyuki Ikezoe
3320457c07 Interpolate colors with premultiplied alpha.
We need to clamp each interpolated values because some cubic-bezier functions
produce values that are out of range [0, 1].
2016-12-28 09:18:22 +09:00
Nazım Can Altınova
ed806efade Make background-position a shorthand instead of a longhand 2016-12-15 01:36:30 +03:00
Nazım Can Altınova
b302642592 Implement background-position-x/y 2016-12-15 01:36:27 +03:00
Patrick Walton
89dff2d77f layout: Don't restart a transition if the end value for the new
transition is the same as the end value for a running transition per
CSS-TRANSITIONS § 3.

Besides being contrary to spec, the old behavior could cause a cascade
of CSS transitions incorrectly triggering themselves when calls to
`getComputedStyle()` were intermingled with them.

Improves performance of nytimes.com.
2016-11-30 16:36:02 -08:00
Emilio Cobos Álvarez
6c3458767b
style: Refactor and add infrastructure for font metrics in style.
This commit itself only moves things around and adds an extra parameter to the
`apply_declarations` function to eventually handle #14079 correctly.

Probably needs a more granular API to query fonts, á la nsFontMetrics, but
that's trivial to do once this is landed.

Then we should make the font provider mandatory, and implement the missing stylo
bits.
2016-11-13 11:54:10 +01:00
Ravi Shankar
c4fc49c559 Make use of Either<A, B> for LengthOrNone 2016-11-09 13:04:26 +05:30
Ravi Shankar
6061985898 Prefer Servo-specific ToCss for all types 2016-11-07 09:14:22 +05:30
bors-servo
f80623fd93 Auto merge of #13694 - emilio:style-animation, r=Manishearth,birtles
Introduce AnimationValue to manage animated properties in Gecko.

<!-- Please describe your changes on the following line: -->

Doesn't compile because there are a bunch of `from_computed_value` missing, and I need to take care of fixing that before, but open for discussion.

@birtles: is an interface like this something like what you were looking for?

cc @Manishearth

<!-- 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/13694)
<!-- Reviewable:end -->
2016-10-12 10:34:10 -05:00
Emilio Cobos Álvarez
79d64f2a38
style: Use progress consistently instead of time. 2016-10-12 10:35:29 +02:00
Emilio Cobos Álvarez
b79689361b
Introduce AnimationValue to manage animated properties in Gecko. 2016-10-12 10:31:22 +02:00
Keith Yeung
668163ec5c Emit TransitionEnd events in the layout thread and process it in the script thread 2016-10-11 19:36:06 -07:00
Nazım Can Altınova
63c329b69d Add decomposition and interpolation of 3D matrices 2016-09-16 12:57:25 +03:00
Nazım Can Altınova
5ee93b28cb Move decompose and recompose functions to impl and implement interpolations 2016-09-07 14:32:23 +03:00
Nazım Can Altınova
10b631dfd1 Implement recompose_matrix function 2016-09-06 18:57:25 +03:00
Nazım Can Altınova
61e2d85435 Implement Interpolate traits for matrix structs 2016-09-06 18:50:38 +03:00
Nazım Can Altınova
32810a9f9e Implement decompose_matrix function 2016-09-06 18:47:30 +03:00
Manish Goregaokar
c965beb3d9
Use conditional compilation for stylo properties 2016-09-02 17:45:48 +05:30
Manish Goregaokar
466df01e71
Review fixups 2016-08-22 22:45:16 +05:30
Manish Goregaokar
979a2798d5 Make Position a gecko-only vector longhand 2016-08-22 22:42:40 +05:30
bors-servo
daee53cb76 Auto merge of #12918 - hsinewu:12902-typedefs, r=Manishearth
12902 typedefs

<!-- Please describe your changes on the following line: -->
Using type alias instead of newtype.
Removing duplicated implementation, it's already inherited.
No more type constructors and foo.0
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12902 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because it's refactoring.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/12918)
<!-- Reviewable:end -->
2016-08-22 06:01:03 -05:00
hsinewu
ef9a690c9c Refactor: use type alias instead of newtype 2016-08-22 09:36:19 +08:00
Anthony Ramine
51768844ed Update euclid to 0.10.1 2016-08-21 03:03:45 +02:00
Anthony Ramine
fc58cc01f4 Fix interpolation of CalcLengthOrPercentage (fixes #12765) 2016-08-09 14:47:38 +02:00
Manish Goregaokar
44e33bcdc5
Move Position into its own values module 2016-08-02 15:57:23 +05:30
Simon Sapin
4b7060554b Rename ComputedValuesStruct to ComputedValues.
Doing this in a separate commit avoids mixups
with the ComputedValues trait that the previous commit removed.
2016-07-20 08:42:45 +02:00
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00