Commit graph

843 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
173f489d7b
style: Add documentation lost in a rebase, plus implement box-shadow animations. 2016-06-28 15:27:59 +00:00
Emilio Cobos Álvarez
2d566ef0ef
style: Fix parsing and add generated keyframes 2016-06-28 15:20:59 +00:00
Emilio Cobos Álvarez
f149d4d577
style: Don't calculate animations just on style changes.
Calculate it also on the first restyle.
2016-06-28 15:13:04 +00:00
Emilio Cobos Álvarez
8527762b83
style: Allow pausing and unpausing animations.
There's a bit of flickering when unpausing where the node has the original
state, but I'm not totally sure where it comes from, posibly from
PropertyAnimation returning None due to no styles changing?
2016-06-28 15:13:03 +00:00
Emilio Cobos Álvarez
2b2e58a868
style: WTF I was thinking about when I wrote that? 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
33f581883b
style: Support animation-direction. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
9cf2e52d36
tidy: Clean up warnings and tidy lints. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
cb3da24f08
style: layout: Get actual keyframes working!
There are a few shortcomings, for example:

 * We don't do the same as other browsers when some properties are not specified
   in some of the keyframes, though this is easy to work out (though a bit more
   expensive in the sense that we should apply all the previous keyframes' style
   instead of just the previous and the next.

 * To trigger the initial animation, a restyle is necessary. Should be easy to
   do an initial restyle off-hand or something like that, but for now this is
   worked-around adding a :hover rule to the node.

   Also, the animation is resetted when the node is hovered. That's a bug, but
   is probably not so difficult to test.

 * A few things, mainly animation-direction, are not supported yet, but
   shouldn't be that hard to support.

Still a lot of work to do, but I think this approach might be ok.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
bc970596d6
layout: Make animations work... more or less.
There's some maths I've done wrong, but it DOES animate some things, though
they're only triggered past the first restyle, and we probably have some
duplications where the animations arrive to layout.

Anyway, got to go.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
c16c5acade
style: Rewrite the animation representation to allow having state in layout
I have to make the appropriate changes in layout, but I'm running out of battery
in the bus.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
5b27e46d04
style: Atomize animation names. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
0077eb147c
style: Actually animate something!
So this actually allows some more animations to be triggered. The bad part of
this is that they're actually triggered always when the style is recalculated,
so we're going to have at least some more state into the node, and the
constellation, which would have to keep track of the animations states.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
18f09289ce
style: Inline a few functions that are just another function call 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
f389cf61c4
style: Make animation functions as generic as possible. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
058bfb39ae
style: Refactor the @keyframes parsing and add adequate computation for it. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
6a362ae8e8
style: Refactor all the animated properties to use the style system properly 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
818bc6d4a2
style: parse the remaining animation longhands. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
f529786700
style: Add animation-iteration-count parsing under experimental flag 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
b6ecb1ccb1
style: Add animation-timing-function parsing as experimental. 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
c80084cd29
style: Add animation-duration parsing under experimental flag 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
60192bb830
style: Refactor to pass animations cleanly, land animation-name parsing as experimental 2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
c1fd7432e9
style: Add @keyframe rule parsing. 2016-06-28 15:09:53 +00:00
Simon Sapin
3932a82a2c Replace usage of discriminant_value in viewport.rs 2016-06-28 06:47:57 +02:00
Simon Sapin
f3d6859ab7 Replace usage of std::intrinsics::discriminant_value in properties.mako.rs 2016-06-28 06:46:40 +02:00
bors-servo
3809e4a23d Auto merge of #11834 - servo:style-docs, r=SimonSapin
Add some documentation to the style crate.

<!-- 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/11834)
<!-- Reviewable:end -->
2016-06-27 17:14:55 -05:00
Ms2ger
79e0d18a1d Add some documentation to the style crate. 2016-06-27 17:33:14 +02:00
Anthony Ramine
38a79e4506 Update Rust to 1.11.0-nightly (ad7fe6521 2016-06-23)
I also properly bump any dependency related to the serde_macros removal
from webrender_traits
2016-06-27 14:13:44 +02:00
Michael Howell
f6fb3eabd8 Clean up code
😁
2016-06-25 15:52:34 -07:00
bors-servo
209be8113d Auto merge of #11833 - Ms2ger:LocalToCss, r=jdm
Merge AuExtensionMethods and LocalToCss.

<!-- 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/11833)
<!-- Reviewable:end -->
2016-06-23 12:39:17 -05:00
bors-servo
3de14d9ca0 Auto merge of #11835 - servo:diy-as-unsafe-cell, r=nox
Use our copy of RefCell for style data

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

This allows removing `#![feature(as_unsafe_cell)]` in geckolib and make progress towards #11815.

---
<!-- 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 part of #11815.

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require new tests because they don’t introduce no functional changes.

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11835)
<!-- Reviewable:end -->
2016-06-23 09:19:28 -05:00
Simon Sapin
6807bb615f Add commit hash to be reverted in FIXME comment. 2016-06-23 16:14:33 +02:00
Simon Sapin
f7f81e0ed0 Use our copy of RefCell for style data.
This allows removing `#![feature(as_unsafe_cell)]` in geckolib
and make progress towards #11815.
2016-06-23 16:13:49 +02:00
Ms2ger
f82cf3da12 Merge AuExtensionMethods and LocalToCss. 2016-06-23 15:39:56 +02:00
Ms2ger
4381107c21 Make the STYLE_BLOOM global private. 2016-06-23 13:52:26 +02:00
Simon Sapin
b103e8baa7 Remove some usage of unstable features in geckolib 2016-06-22 15:49:07 +02:00
Simon Sapin
3822bb269c Change style_traits to a single "servo" Cargo feature
... instead of fine-grained heap_size and serde-serialization ones.
2016-06-22 15:48:52 +02:00
Simon Sapin
00b6210519 Make the style crate almost build on stable Rust.
`discriminant_value` will need to be replaced with something else later.
2016-06-22 15:44:13 +02:00
Simon Sapin
ea73c8efac Make it possible to build the style_traits crate with a stable compiler.
Testing this on CI to make sure we don’t regress it is blocked on #11806
2016-06-22 15:40:53 +02:00
Keith Yeung
d66a04ea6c Update string_cache to v0.2.20 2016-06-20 12:17:28 +08:00
Emilio Cobos Álvarez
fa6dd1d61b
stylo: Support the rest of the background-xxx P1 properties.
We do the same that with background-{image, repeat}, we just use the first
element until servo can parse and use a list efficiently.
2016-06-15 11:49:57 +02:00
Ms2ger
e723d72570 Move the initialize_data method out of the TNode trait.
This reduces the dependency of TNode implementations on layout types.
2016-06-13 15:21:29 +01:00
Ms2ger
ae5cb0ceb0 Move the TNode::initialize_data() call from recalc_style_at to its callers.
This will allow us to make it an inherent method.
2016-06-13 15:11:21 +01:00
Anthony Ramine
b97c7a8c4d Don't load all font faces sources
We stop at the first one we manage to load.
2016-06-10 21:51:06 +02:00
bors-servo
b64b21ace0 Auto merge of #11565 - nox:fonts, r=metajack
Introduce FontFaceRules::effective_sources()

<!-- 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/11565)
<!-- Reviewable:end -->
2016-06-07 03:50:18 -05:00
bors-servo
0f1f99a4bf Auto merge of #11572 - nox:placeholder-shown, r=SimonSapin
Implement :placeholder-shown (fixes #10561)

<!-- 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/11572)
<!-- Reviewable:end -->
2016-06-06 23:44:16 -05:00
Anthony Ramine
64b34d5162 Introduce FontFaceRules::effective_sources()
This avoids downloading fonts in formats we don't support.
2016-06-06 23:43:09 +02:00
Ms2ger
06a1d04ca6 Move LengthOrPercentageOrAuto to style::attr. 2016-06-06 08:54:34 +02:00
Ms2ger
1c65ce8f36 Deny unsafe code in some more modules. 2016-06-04 18:07:16 +02:00
Anthony Ramine
ff899dc703 Implement :placeholder-shown (fixes #10561) 2016-06-03 14:45:14 +02:00
Bobby Holley
decf8c40f7
Stop mapping overflow-wrap to mWordWrap.
This was fixed in gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=955857
2016-06-01 14:07:04 +02:00