style: Refactor the cascade function.
The `cascade_primary_or_pseudo` function was nice when we shared more code, but
right now I think it just makes it harder to understand what's going on.
<!-- 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/16909)
<!-- Reviewable:end -->
The `cascade_primary_or_pseudo` function was nice when we shared more code, but
right now I think it just makes it harder to understand what's going on.
stylo: Propagate quirks mode information from Gecko to Servo
r=bholley in bugzilla
---
<!-- 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 [Bug 1360488](https://bugzilla.mozilla.org/show_bug.cgi?id=1360488)
<!-- 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/16819)
<!-- Reviewable:end -->
Check ElementHasAnimations flag in rust side.
We can bail out earlier before calling an FFI function.
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1364264 .
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because it's for stylo
<!-- 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/16826)
<!-- Reviewable:end -->
Fix typo and simplify for PresentationalHintsSynthesizer
<!-- 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 do not require tests because it only affects build.
<!-- 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/16785)
<!-- Reviewable:end -->
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.
What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.
Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.
MozReview-Commit-ID: FF1KWZv2iBM
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
1. We add a new arm to TransitionProperty, TransitionProperty::Unsupported,
which contains an Atom, so it's better to remove the Copy trait from
TransitionProperty.
2. TransitionProperty::Unsupported(Atom) represents any non-animatable, custom,
or unrecognized property, and we use Atom to store the ident string for
serialization.
stylo: Bug 1353628 - Support shorthand properties for CSS Transition.
These patches add shorthand properties into TransitionProperty, so we can parse the shorthand properties properly and create transitions for them.
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1353628
- [X] There are tests for these changes
<!-- 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/16527)
<!-- Reviewable:end -->
In order to make TransitionProperty::parse() also work on shorthands, we
should add shorthands into TransitionProperty, and add the arms in other
functions which match TransitionProperty.
MozReview-Commit-ID: KFd26KcQf3N
1. We need to call get_after_change_style, which is the computed styles
without transition rules, while process_animations.
2. If we have after-change style, we may replace the new computed values with
after-change style, according to whether we really need to update
transitions.
3. There are some cases we don't update transitions, so we need to early
return. might_needs_transitions_update() will check it first and it
will filter out most common cases.
4. needs_transitions_update() will check each property and existing running
transitions to make sure we really don't need to update transitions.
The logic of this function is similar with that of
nsTransitionManager::DoUpdateTransitions().
MozReview-Commit-ID: 2ccdPjgrxKz
Add one FFI to check if there is any transition in CSSTransitionCollection.
This will be used to check if we need to update transition and if we
should compute the after-change style.
MozReview-Commit-ID: 6HpVAtrx6Rc