diff options
author | Boris Chiou <boris.chiou@gmail.com> | 2017-05-19 16:00:52 +0800 |
---|---|---|
committer | Boris Chiou <boris.chiou@gmail.com> | 2017-05-20 20:04:56 +0800 |
commit | 63dc43648ed5b8012fefc189345b5a0b63d2a1b9 (patch) | |
tree | 69aca6a9ef28d99bdbbd0b0975a81e13643a8552 /components/script/layout_wrapper.rs | |
parent | 60e7a89d571335e5cb223eabac43fc4e028931e1 (diff) | |
download | servo-63dc43648ed5b8012fefc189345b5a0b63d2a1b9.tar.gz servo-63dc43648ed5b8012fefc189345b5a0b63d2a1b9.zip |
Trigger restyle if important rules are changed.
If we add/remove important rules, we may need to update a list of all important
rules (in Gecko) which overrides animation properties. Therefore, we need to
set a flag if we update the primary rules which includes important ones.
If we have animations on this element, we update its effect properties, and
also send a task to update cascade results.
Calling get_properties_overriding_animations() might cases some impact
on performance because we need to walk the rule tree, so if possible, we could
just store this set into TNode to avoid finding the properties for both old
and new rules each time. This could be a future work if necessary.
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r-- | components/script/layout_wrapper.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 62e5158f321..fca0f0949eb 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -486,7 +486,10 @@ impl<'le> TElement for ServoLayoutElement<'le> { } fn has_animations(&self) -> bool { - unreachable!("this should be only called on gecko"); + // We use this function not only for Gecko but also for Servo to know if this element has + // animations, so we maybe try to get the important rules of this element. This is used for + // off-main thread animations, but we don't support it on Servo, so return false directly. + false } fn has_css_animations(&self) -> bool { |