Commit graph

407 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4c51624bcf
style: Add a FIXME comment which I think reveals a bug but I haven't confirmed it.
Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: DgCfqA5TNzP
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
875c4ff621
style: Cleanup and add references to decompose_3d_matrix.
Same, no functional change, but I basically rewrote this two times so...

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: FXOnJDPyPu5
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
6ddb04a483
style: Cleanup and add references to Quaternion::animate.
No functional change, but I did this while searching for the bug.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: KsJxFoYaOq1
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
99d4e7b65c
style: Trivial cleanup.
Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: K7zVYGiYAn6
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
92b856b70a
style: Reuse computed rotate animation.
I have the feeling this fixes a bug, but...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Aj478qCbMV9
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
2e500d70ef
style: Match rotate ops.
Per bug 1322189 we really should. I've copied the setup we have already for
translate / scale, but we should really clean this up a bit more I'd think.

In any case, probably skew should be matched as well...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Jky5k8HVfuH
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
2c1ec89943
style: Cleanup single transform functions that can't really error.
Also call them "resolve" since it's the general term for computing something
more specific than what you have.

Though I don't feel strongly about that, feel free to push back.

Bug: 1464595
Reviewed-by: hiro
MozReview-Commit-ID: KtqjzlppZLp
2018-05-28 15:39:13 +02:00
Emilio Cobos Álvarez
32c6d5b7c6
style: Refactor vector types.
This fixes clamping of mask-size and moves it out of mako while at it.

Bug: 1462829
Reviewed-by: hiro,xidorn
MozReview-Commit-ID: 9hiTe63odna
2018-05-28 15:37:28 +02:00
Emilio Cobos Álvarez
921c389247
style: Remove some unneeded cfg(..).
The less not-compiled code in common builds, the better for everybody.
2018-05-05 17:53:22 +02:00
Emilio Cobos Álvarez
0ef70d52f2
style: Fix perspective interpolation.
It's not sound to insert random matrices in random positions in the transform
operation list.

I cannot make any sense of what the old code was trying to do.

Bug: 1458715
Reviewed-by: hiro
MozReview-Commit-ID: 5BtCiueEPlR
2018-05-05 16:22:47 +02:00
Xidorn Quan
07de715bb5
style: Manually implement collect_completion_keywords for some types.
Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: 6T35uylxgho
2018-04-29 03:28:50 +02:00
Xidorn Quan
7fe7b2ffb1
style: Add a ValueInfo trait for exposing types needed by devtools.
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.

In my current plan, this new trait will be used in bug 1434130 to expose
values as well.

Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
2018-04-29 03:28:34 +02:00
Emilio Cobos Álvarez
f7636e6662
style: Update font-stretch to css-fonts-4.
These won't "just work", pending changes from bug 1436048 to use a floating
point representation for those.

Bug: 1454883
Reviewed-by: xidorn
MozReview-Commit-ID: Bi5iTdFreMA
2018-04-28 10:26:04 +02:00
Emilio Cobos Álvarez
bc1126ee8c
style: Update font-weight property and descriptor to css-fonts-4.
Bug: 1454596
Reviewed-by: xidorn
MozReview-Commit-ID: 27aS2UrgXjs
2018-04-28 10:25:59 +02:00
Xidorn Quan
1599357cff Make nscssproperty a method of longhand/shorthand/alias class. 2018-04-11 15:55:11 +10:00
Manish Goregaokar
e5afb22184 Use correct filler y value when animating with an implied-y translate()s 2018-04-06 08:11:58 -07:00
Fausto Núñez Alberro
cc838f54e5
Implement a URL-generic type for list-style-image
This should fix the following two "expected to fail" tests:

- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
  and elem.style uses the original URL

- getComputedStyle(elem) for url() listStyle uses the resolved URL
  and elem.style uses the original URL
2018-04-03 22:01:26 +02:00
Anthony Ramine
afaa00a344 Remove some uses of trivial_to_computed_value 2018-03-09 11:57:22 +01:00
Anthony Ramine
6ce5e9a869 Never store a squared root in SquaredDistance 2018-03-04 02:10:44 +01:00
Anthony Ramine
13c40f4fb8 Derive ToCss for TransitionProperty 2018-03-03 16:15:20 +01:00
Emilio Cobos Álvarez
68971c86bc
style: Remove unused function. 2018-02-28 12:04:49 +01:00
Emilio Cobos Álvarez
8c4b401dd3
style: Only expose longhands to rust via iterators.
The key here is that we only filter longhands if the shorthand is accessible to
content and vice-versa. This prevents the bug that prevented me to land this
patch before, which was us not expanding properly chrome-only shorthands.

Again, this is incomplete, and I need to teach LonghandsToSerialize to get a
potentially incomplete list of properties, and all that.
2018-02-28 00:19:31 +01:00
Anthony Ramine
e2a6d07dad Remove TransitionProperty::All 2018-02-26 14:30:53 +01:00
Anthony Ramine
aea66a9fb6 Move FontTag to the generic module 2018-02-15 12:03:00 +01:00
Anthony Ramine
f89ebf7fe9 Change AnimatedValue for NonNegativeNumber to CSSFloat 2018-02-13 16:12:30 +01:00
Anthony Ramine
da5acc81d2 Change AnimatedValue for NonNegativeLengthOrPercentage to its inner type 2018-02-13 16:12:29 +01:00
Anthony Ramine
18b9775173 Merge similar arms in AnimationValue::from_declaration 🐉🐲
This slims that function by 12KB according to bloaty.
2018-02-12 10:34:30 +01:00
Anthony Ramine
e2c674994a Use ascii_case_insensitive_phf_map in TransitionProperty::parse
This divides the size of this method by 30.
2018-02-12 00:42:34 +01:00
Anthony Ramine
c92d0a8902 Implement Clone for AnimationValue by hand 🐉🐲
We use the same trick as in PropertyDeclaration::clone.
2018-02-11 09:47:14 +01:00
Anthony Ramine
b95b6c66f3 Implement PartialEq for AnimationValue by hand 🐉🐲
We use the same trick as in PropertyDeclaration::eq.
2018-02-11 09:38:37 +01:00
Anthony Ramine
b9505ae72b Merge similar arms in AnimationValue::compute_squared_distance 🐉🐲
This uses the same trick as in PropertyDeclaration::eq.
2018-02-10 16:31:50 +01:00
Anthony Ramine
fc24cf34c5 Merge similar arms in AnimationValue::animate 🐉🐲
This uses the same trick as in PropertyDeclaration::eq and removes
roughly 10KB off of libxul.
2018-02-10 16:31:49 +01:00
Anthony Ramine
38520af970 Merge similar arms in AnimationValue::uncompute 🐉🐲
This uses the same kind of trick as PropertyDeclaration::clone and
removes 15KB off of libxul according to bloaty.
2018-02-10 16:31:48 +01:00
Anthony Ramine
aa7cc261f8 Determine animated types from specified types 2018-02-10 16:31:48 +01:00
Anthony Ramine
57daf06c71 Make PropertyDeclaration::id and AnimationValue::id inline 2018-02-10 16:31:46 +01:00
Anthony Ramine
921d1aeeba Make AnimationValue::id be just a pointer cast 🐉🐲
Now that PropertyDeclaration and AnimationValue have the same discriminants,
that means the trick found in PropertyDeclaration::id can be done in
AnimationValue::id.
2018-02-10 16:31:45 +01:00
Anthony Ramine
79775541f2 Make AnimationValue have the same variants as PropertyDeclaration
By making AnimationValue have the same representation as PropertyDeclaration
and Void variants for non-animatable properties, we know by constructions
that all properties have the same discriminant in both.
2018-02-10 12:37:30 +01:00
Anthony Ramine
f017743a55 Derive ComputeSquaredDistance for animated filters 2018-02-08 03:14:23 +01:00
Anthony Ramine
5195eb38f2 Make all PropertyDeclaration variants have only one field 2018-02-06 13:45:18 +01:00
Emilio Cobos Álvarez
3b34d734e6
style: Refactor font-feature-settings and font-variation-settings.
This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1434692
  https://bugzilla.mozilla.org/show_bug.cgi?id=1434724

Also does a fair amount of cleanup and all that, which was needed.
2018-02-01 12:54:45 +01:00
Emilio Cobos Álvarez
09398d42af
style: Move a bunch of font stuff living under generics to the proper module.
FontSettingsTagInt and such shouldn't be in the generic module, I know...

But that will change in a bit.
2018-02-01 02:35:33 +01:00
Emilio Cobos Álvarez
1380f1a14f
style: Remove the stupid space serialization on font-settings. 2018-02-01 02:35:32 +01:00
CJ Ku
8a4661b829 Implement Animate trait for individual transforms 2018-01-31 22:15:31 +00:00
CJ Ku
9a62c0bf02 Implement interpolation of Quaternions
So that we can reuse the code in ComputedRotate.
2018-01-31 22:12:35 +00:00
Anthony Ramine
cd8f96cc9e Change ToCss to take a CssWriter<W>
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
Bobby Holley
f858ce91e8 Avoid entraining various Debug impls in release builds.
MozReview-Commit-ID: Lp9i9EI5qdU
2018-01-13 09:51:46 -08:00
Manish Goregaokar
82e024913b stylo: Correctly handle interpolation where optional second argument for translate(), skew(), scale() exists in one but not the other
MozReview-Commit-ID: 59rNRAXBEN9
2017-12-18 18:45:25 -08:00
Brian Birtles
150db42ef6 Update references to Web Animations spec 2017-12-15 16:21:26 -06:00
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
Boris Chiou
3a38e815ec Implement Servo_ParseTransformIntoMatrix.
DOMMatrix needs to convert a specified transform list into a matrix, so
we could rewrite to_transform_3d_matrix by generics for both specified
and computed transform lists.

Besides, we have to update the test case because we use Transform3D<f64> to
compute the matrix, instead of Transform3D<f32>, so the result will be
the same as that in Gecko. Using 0.3 may cause floating point issue
because (0.3f32 as f64) is not equal to 0.3 (i.e. floating point precision
issue), so using 0.25 instead.
2017-11-28 10:08:12 +08:00