mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Auto merge of #18719 - hiikezoe:use-normal-declaration-iterator, r=emilio
Use NormalDeclarationIterator for AnimationValueIterator <!-- 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 <!-- 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/18719) <!-- Reviewable:end -->
This commit is contained in:
commit
1a84dd594b
1 changed files with 4 additions and 8 deletions
|
@ -148,7 +148,7 @@ impl<'a> Iterator for NormalDeclarationIterator<'a> {
|
|||
|
||||
/// Iterator for AnimationValue to be generated from PropertyDeclarationBlock.
|
||||
pub struct AnimationValueIterator<'a, 'cx, 'cx_a:'cx> {
|
||||
iter: DeclarationImportanceIterator<'a>,
|
||||
iter: NormalDeclarationIterator<'a>,
|
||||
context: &'cx mut Context<'cx_a>,
|
||||
default_values: &'a ComputedValues,
|
||||
/// Custom properties in a keyframe if exists.
|
||||
|
@ -163,7 +163,7 @@ impl<'a, 'cx, 'cx_a:'cx> AnimationValueIterator<'a, 'cx, 'cx_a> {
|
|||
extra_custom_properties: Option<&'a Arc<::custom_properties::CustomPropertiesMap>>,
|
||||
) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
|
||||
AnimationValueIterator {
|
||||
iter: declarations.declaration_importance_iter(),
|
||||
iter: declarations.normal_declaration_iter(),
|
||||
context,
|
||||
default_values,
|
||||
extra_custom_properties,
|
||||
|
@ -177,15 +177,11 @@ impl<'a, 'cx, 'cx_a:'cx> Iterator for AnimationValueIterator<'a, 'cx, 'cx_a> {
|
|||
fn next(&mut self) -> Option<Self::Item> {
|
||||
loop {
|
||||
let next = self.iter.next();
|
||||
let (decl, importance) = match next {
|
||||
Some(decl_and_importance) => decl_and_importance,
|
||||
let decl = match next {
|
||||
Some(decl) => decl,
|
||||
None => return None,
|
||||
};
|
||||
|
||||
if importance.important() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let animation = AnimationValue::from_declaration(
|
||||
decl,
|
||||
&mut self.context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue