mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40: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.
|
/// Iterator for AnimationValue to be generated from PropertyDeclarationBlock.
|
||||||
pub struct AnimationValueIterator<'a, 'cx, 'cx_a:'cx> {
|
pub struct AnimationValueIterator<'a, 'cx, 'cx_a:'cx> {
|
||||||
iter: DeclarationImportanceIterator<'a>,
|
iter: NormalDeclarationIterator<'a>,
|
||||||
context: &'cx mut Context<'cx_a>,
|
context: &'cx mut Context<'cx_a>,
|
||||||
default_values: &'a ComputedValues,
|
default_values: &'a ComputedValues,
|
||||||
/// Custom properties in a keyframe if exists.
|
/// 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>>,
|
extra_custom_properties: Option<&'a Arc<::custom_properties::CustomPropertiesMap>>,
|
||||||
) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
|
) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
|
||||||
AnimationValueIterator {
|
AnimationValueIterator {
|
||||||
iter: declarations.declaration_importance_iter(),
|
iter: declarations.normal_declaration_iter(),
|
||||||
context,
|
context,
|
||||||
default_values,
|
default_values,
|
||||||
extra_custom_properties,
|
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> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
loop {
|
loop {
|
||||||
let next = self.iter.next();
|
let next = self.iter.next();
|
||||||
let (decl, importance) = match next {
|
let decl = match next {
|
||||||
Some(decl_and_importance) => decl_and_importance,
|
Some(decl) => decl,
|
||||||
None => return None,
|
None => return None,
|
||||||
};
|
};
|
||||||
|
|
||||||
if importance.important() {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let animation = AnimationValue::from_declaration(
|
let animation = AnimationValue::from_declaration(
|
||||||
decl,
|
decl,
|
||||||
&mut self.context,
|
&mut self.context,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue