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

style: Add an iterator for transition properties #26200

Merged
merged 1 commit into from Apr 17, 2020

Conversation

@mrobinson
Copy link
Member

mrobinson commented Apr 16, 2020

This simplifies the code a bit and also will allow us to more easily
make improvements to servo's animation implementation in the future.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because they should not change behavior.
@mrobinson mrobinson requested a review from emilio Apr 16, 2020
@highfive
Copy link

highfive commented Apr 16, 2020

Heads up! This PR modifies the following files:

  • @emilio: components/style/gecko/wrapper.rs, components/style/animation.rs, components/style/properties/helpers/animated_properties.mako.rs, components/style/properties/properties.mako.rs
@highfive
Copy link

highfive commented Apr 16, 2020

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@mrobinson
Copy link
Member Author

mrobinson commented Apr 16, 2020

@emilio, if you have some free moments do you mind looking at this change? I'm not entirely certain what the right procedure is for making changes to the Gecko-specific code. I've verified that the changes build, but I don't think I have try access any longer.

@mrobinson mrobinson added the A-stylo label Apr 16, 2020
@mrobinson mrobinson changed the title Add an iterator for transition properties style: Add an iterator for transition properties Apr 16, 2020
Copy link
Member

emilio left a comment

Thanks, and sorry for the lag. This looks good with a few nits to me.

I can push it to try, let me know if you want to recover access, I think we're pretty liberal reenabling accounts :)

});
}

let index = match self.index_range.next() {

This comment has been minimized.

@emilio

emilio Apr 16, 2020

Member

nit: You can use .next()?.

This comment has been minimized.

@mrobinson

mrobinson Apr 17, 2020

Author Member

Oh, nice. Fixed.

};

match self.style.get_box().transition_property_at(index) {
TransitionProperty::Custom(..) | TransitionProperty::Unsupported(..) => self.next(),

This comment has been minimized.

@emilio

emilio Apr 16, 2020

Member

May be better to make this a loop { } instead of recursive. I don't think it should be much harder.

This comment has been minimized.

@mrobinson

mrobinson Apr 17, 2020

Author Member

Sounds good. I've changed this too a loop and added a comment explaining what is going on.

pub fn transition_properties<'a>(
&'a self
) -> animated_properties::TransitionPropertyIterator<'a>
{

This comment has been minimized.

@emilio

emilio Apr 16, 2020

Member

{ should go to the previous line I think.

This comment has been minimized.

@jdm

jdm Apr 16, 2020

Member

rustfmt probably disagrees, since CI is passing.

This comment has been minimized.

@mrobinson

mrobinson Apr 17, 2020

Author Member

It seems like rustfmt might not be processing Mako templates? In any case, I've formatted this to look like the other methods in the file.

This comment has been minimized.

@emilio

emilio Apr 17, 2020

Member

Yeah, we don't rustfmt this file.

@emilio
emilio approved these changes Apr 16, 2020
Copy link
Member

emilio left a comment

r=me with the nits fixed.

@mrobinson mrobinson force-pushed the mrobinson:animation-iterator branch from a176159 to 18ddf64 Apr 17, 2020
@mrobinson
Copy link
Member Author

mrobinson commented Apr 17, 2020

Thanks, and sorry for the lag. This looks good with a few nits to me.

I can push it to try, let me know if you want to recover access, I think we're pretty liberal reenabling accounts :)

Thanks for the review! I've fixed your nits and will ask bors to merge this. Do you mind pushing this one to try for me? I think once I make one or two more changes to the gecko code, I might need try access again. I'd hate to ask people to do a bunch of work and then never use it.

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

📌 Commit 18ddf64 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

Testing commit 18ddf64 with merge 0675e1e...

bors-servo added a commit that referenced this pull request Apr 17, 2020
style: Add an iterator for transition properties

This simplifies the code a bit and also will allow us to more easily
make improvements to servo's animation implementation in the future.

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

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

💔 Test failed - status-taskcluster

@mrobinson
Copy link
Member Author

mrobinson commented Apr 17, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

Testing commit 18ddf64 with merge ef7a473...

bors-servo added a commit that referenced this pull request Apr 17, 2020
style: Add an iterator for transition properties

This simplifies the code a bit and also will allow us to more easily
make improvements to servo's animation implementation in the future.

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

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

💔 Test failed - status-taskcluster

This simplifies the code a bit and also will allow us to more easily
make improvements to servo's animation implementation in the future.
@mrobinson mrobinson force-pushed the mrobinson:animation-iterator branch from e0ac731 to fad79a7 Apr 17, 2020
@mrobinson
Copy link
Member Author

mrobinson commented Apr 17, 2020

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

📌 Commit fad79a7 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

Testing commit fad79a7 with merge fb45a63...

bors-servo added a commit that referenced this pull request Apr 17, 2020
style: Add an iterator for transition properties

This simplifies the code a bit and also will allow us to more easily
make improvements to servo's animation implementation in the future.

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

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

💔 Test failed - status-taskcluster

@mrobinson
Copy link
Member Author

mrobinson commented Apr 17, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

Testing commit fad79a7 with merge 8349b4f...

bors-servo added a commit that referenced this pull request Apr 17, 2020
style: Add an iterator for transition properties

This simplifies the code a bit and also will allow us to more easily
make improvements to servo's animation implementation in the future.

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

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Apr 17, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

Testing commit fad79a7 with merge 71940ff...

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2020

☀️ Test successful - status-taskcluster
Approved by: emilio
Pushing 71940ff to master...

@bors-servo bors-servo merged commit 71940ff into servo:master Apr 17, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:animation-iterator branch Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.