Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrete type animations #16292

Merged
merged 3 commits into from Apr 7, 2017

Conversation

@hiikezoe
Copy link
Contributor

commented Apr 7, 2017

This is a PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1336668


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because there is a test case in web-platform-tests.

This change is Reviewable

@highfive

This comment has been minimized.

Copy link

commented Apr 7, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/longhand/background.mako.rs, components/style/properties/longhand/effects.mako.rs, components/style/properties/longhand/text.mako.rs, components/style/properties/longhand/position.mako.rs, components/style/properties/longhand/svg.mako.rs, components/style/properties/longhand/list.mako.rs, components/style/properties/longhand/outline.mako.rs, components/style/properties/longhand/xul.mako.rs, components/style/properties/longhand/padding.mako.rs, components/style/properties/data.py, components/style/properties/longhand/font.mako.rs, components/style/properties/longhand/pointing.mako.rs, components/style/properties/longhand/inherited_box.mako.rs, components/style/properties/longhand/inherited_text.mako.rs, components/style/properties/gecko.mako.rs, components/style/properties/longhand/color.mako.rs, components/style/properties/longhand/counters.mako.rs, components/style/properties/longhand/border.mako.rs, components/style/properties/longhand/box.mako.rs, components/style/properties/longhand/margin.mako.rs, components/style/properties/longhand/table.mako.rs, components/style/properties/longhand/ui.mako.rs, components/style/properties/longhand/inherited_table.mako.rs, components/style/properties/helpers/animated_properties.mako.rs, components/style/properties/longhand/column.mako.rs, components/style/properties/longhand/inherited_svg.mako.rs
  • @emilio: components/style/properties/longhand/background.mako.rs, components/style/properties/longhand/effects.mako.rs, components/style/properties/longhand/text.mako.rs, components/style/properties/longhand/position.mako.rs, components/style/properties/longhand/svg.mako.rs, components/style/properties/longhand/list.mako.rs, components/style/properties/longhand/outline.mako.rs, components/style/properties/longhand/xul.mako.rs, components/style/properties/longhand/padding.mako.rs, components/style/properties/data.py, components/style/properties/longhand/font.mako.rs, components/style/properties/longhand/pointing.mako.rs, components/style/properties/longhand/inherited_box.mako.rs, components/style/properties/longhand/inherited_text.mako.rs, components/style/properties/gecko.mako.rs, components/style/properties/longhand/color.mako.rs, components/style/properties/longhand/counters.mako.rs, components/style/properties/longhand/border.mako.rs, components/style/properties/longhand/box.mako.rs, components/style/properties/longhand/margin.mako.rs, components/style/properties/longhand/table.mako.rs, components/style/properties/longhand/ui.mako.rs, components/style/properties/longhand/inherited_table.mako.rs, components/style/properties/helpers/animated_properties.mako.rs, components/style/properties/longhand/column.mako.rs, components/style/properties/longhand/inherited_svg.mako.rs
@highfive

This comment has been minimized.

Copy link

commented Apr 7, 2017

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@hiikezoe

This comment has been minimized.

Copy link
Contributor Author

commented Apr 7, 2017

Patches have been reviewed by @emilio and @birtles .

// https://w3c.github.io/web-animations/#discrete-animation-type
% if prop.animation_type == "discrete":
if progress < 0.5 {
Ok(AnimationValue::${prop.camel_case}(*from))

This comment has been minimized.

Copy link
@emilio

emilio Apr 7, 2017

Member

nit: This and the other Ok(..) lines are over-indented.

@@ -124,6 +124,7 @@ def __init__(self, style_struct, name, spec=None, animatable=None, derived_from=
self.creates_stacking_context = arg_to_bool(creates_stacking_context)
self.fixpos_cb = arg_to_bool(fixpos_cb)
self.abspos_cb = arg_to_bool(abspos_cb)
self.animation_type = animation_type

This comment has been minimized.

Copy link
@emilio

emilio Apr 7, 2017

Member

Perhaps it makes sense to move this line under the validations?

This comment has been minimized.

Copy link
@hiikezoe

hiikezoe Apr 7, 2017

Author Contributor

thanks!

@emilio

This comment has been minimized.

Copy link
Member

commented Apr 7, 2017

@bors-servo delegate+

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2017

✌️ @hiikezoe can now approve this pull request

Hiroyuki Ikezoe added 3 commits Apr 7, 2017
animation_type takes following values:

animation_type="none" for non-animatable properties
animation_type="normal" for animatable properties
animation_type="discrete" for animatable but discrete type of animations

We use string value to distinguish the case where no animation_type is
specified.
animation_type="discrete" will be used in a subsequent patch to make a property
animatable as discrete type.
…ete.

For discrete type of animations, we just need to return 'from' value if
progress is less than 0.5 and otherwise return 'to' value.

https://w3c.github.io/web-animations/#discrete-animation-type
@hiikezoe hiikezoe force-pushed the hiikezoe:discrete-type-animations branch from 2ecdde1 to 53b4cc3 Apr 7, 2017
@hiikezoe

This comment has been minimized.

Copy link
Contributor Author

commented Apr 7, 2017

@bors-servo r=emilio,birtles

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2017

📌 Commit 53b4cc3 has been approved by emilio,birtles

@highfive highfive assigned emilio and unassigned metajack Apr 7, 2017
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2017

⌛️ Testing commit 53b4cc3 with merge 8c2548a...

bors-servo added a commit that referenced this pull request Apr 7, 2017
…rtles

Discrete type animations

<!-- Please describe your changes on the following line: -->
This is a PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1336668

---
<!-- 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

<!-- Either: -->
- [X] These changes do not require tests because there is a test case in web-platform-tests.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/16292)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: emilio,birtles
Pushing 8c2548a to master...

@bors-servo bors-servo merged commit 53b4cc3 into servo:master Apr 7, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@hiikezoe hiikezoe deleted the hiikezoe:discrete-type-animations branch Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.