зеркало из https://github.com/mozilla/gecko-dev.git
54a0194045
This patch does basically throttle animations on visibility:hidden element and unthrottle it once the animating element became visible or a child of the animating element became visible. But still there are some cases that we don't throttle such animations perfectly. For example; div.style.visibility = 'hidden'; // the 'div' has no children at this moment div.animate(..); // The animation is throttled div.appendChild(visibleChild); // The animation isn't throttled visibleChild.style.visibility = 'hidden'; // Now the animation should be throttled again, but actually it's not. To throttle this case properly, when the |visibleChild|'s visibility changed to hidden, we would need to do either 1) Check all siblings of the |visibleChild| have no visible children or 2) The parent element stores visible children count somewhere and decrease it and check whether the count is zero To achieve 1) we need to walk up ancestors and their siblings, actually it's inefficient. 2) is somewhat similar to what we already do for animating images but it's hard to reuse it for CSS animations since it does not take into account that descendants' visibilities. Another example that this patch does not optimize is the the case where animating element has children whose visibility is inherited and the element itself initially visible something like this; let child = document.createElement('div'); // child visibility is 'inherit' div.appendChild(child); div.animate(..); // the 'div' is visible // The animation isn't throttled since the animating element is visible div.style.visiblily = 'hidden'; // Now the animation should be throttled, but it's not since this patch does // not descend down all descendants to check they are invisible or not when the // animating element visibility changed to hidden. This patch adds a test case for this case introduced with todo_is(). Another test case added in this patch fails if we don't use nsPlaceholderFrame::GetRealFrameFor() in HasNoVisibleDescendants(). MozReview-Commit-ID: BJwzQvP9Yc4 --HG-- extra : rebase_source : e56505706bb2799b59bbfb3bbcce4a9ce86892f4 |
||
---|---|---|
.. | ||
base | ||
build | ||
doc | ||
forms | ||
generic | ||
inspector | ||
ipc | ||
mathml | ||
media | ||
painting | ||
printing | ||
reftests | ||
style | ||
svg | ||
tables | ||
tools | ||
xul | ||
moz.build |