Commit graph

407 commits

Author SHA1 Message Date
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
Manish Goregaokar
a37eb82da8
Use allow_empty vector longhand for box-shadow 2016-07-15 15:15:28 +05:30
bors-servo
beaef005c2 Auto merge of #11873 - notriddle:rotate_anim, r=glennw
Rotate animation

Add rotation interpolation code for the case where their direction vectors are equal.
___

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11808 (github issue number if applicable).
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11873)
<!-- Reviewable:end -->
2016-07-10 16:30:48 -07:00
Simon Sapin
2d52b13f2f Make geckolib possible to build on stable Rust 2016-07-05 15:37:16 +02:00
bors-servo
ed514d7934 Auto merge of #12159 - notriddle:fix_interpolate_cleanup_regression, r=emilio
Do not crash on partial calc interpolation

It should always be possible to interpolate between CalcLengthOrPercentage points.
____

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12151 (github issue number if applicable).
- [ ] There are tests for these changes  (*I STILL NEED TO WRITE TESTS*)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12159)
<!-- Reviewable:end -->
2016-07-03 06:35:01 -07:00
Michael Howell
f9a8fe0afe Do not crash on partial calc interpolation
Fixes #12151

Fixes regression introduced by #11924
2016-07-01 21:11:49 -07:00
Emilio Cobos Álvarez
30963dd74d
style: remove is_servo(), as_servo() and as_servo_mut()
This commit adds a need_index prop to the style system, and autogenerates
iterators, and a get_xxx_mod(i) function from a get_xxx_prop() and
get_xxx_at(index) functions.

This allows us to (finally!) take rid of the as_servo() hack. There are a few
unimplemented clones, but I'm just too lazy for that right now.
2016-07-01 14:22:53 -07:00
Emilio Cobos Álvarez
0216c14c24
style: Cleanup Interpolate code. 2016-06-29 10:03:12 +00:00