Bug 1385089 - Set restyle subtree restyle hint if the element animates display style from 'none' to other. r=emilio
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 02 Aug 2017 20:01:08 +0900
changeset 422004 196347b931689ec0b6378e3dbee8141ca5d87540
parent 422003 1c99ecb8ddea376ad3f3ca09322cdede6b17501a
child 422005 a67ced4189ae8321dd61244bdd38cd9a762b0e82
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1385089 - Set restyle subtree restyle hint if the element animates display style from 'none' to other. r=emilio When display style is changed from 'none' to other in animation-only restyle we need to resolve descendant elements' style that were in the display:none subtree. Three possible ways to resolve the descendant elements' style; 1) Traversing unstyled elements in animation-only restyle We can't simply traverse unstyled elements in the animation-only restyle since when we decided to traverse the unstyled elements we don't know yet the elements will be initially styled or are in display:none subtree. It will result that the new elements are styled in animation-only restyle, it's undesirable. 2) Creating a SequentialTask and resolve the descendants' style with ServoStyleSet::StyleNewSubtree() We can't resolve the descendants' styles with ServoStyleSet::StyleNewSubtree() in SequentialTask since at the moment we are still in servo traversal (i.e. sInServoTraversal is true). That means AutoSetInServoTraversal fails in PrepareAndTraverseSubtree(). 3) Creating a SequentialTask and set restyle subtree hint and defer descendants' restyle in a subsequent normal traversal Note that, when we process throttled animations flush, we don't process normal traversal so the descendants will not be traversed until normal restyle happens but it will not be a big problem since it's really rare that user clicks display animation element just at the right moment when display property changes from none to other. Also, if it will be really a problem, we should process *only* transform animations on the compositor, it's ideally right thing to do. Display property never runs on the compositor. This patch takes the third approach. MozReview-Commit-ID: Krxa3kkdIq4
--- a/dom/smil/crashtests/crashtests.list
+++ b/dom/smil/crashtests/crashtests.list
@@ -15,17 +15,17 @@ load 551620-1.svg
 load 554141-1.svg
 load 554202-1.svg
 load 554202-2.svg
 load 555026-1.svg
 load 556841-1.svg
 load 572938-1.svg
 load 572938-2.svg
 load 572938-3.svg
-skip-if(stylo) load 572938-4.svg # Bug 1385089
+load 572938-4.svg
 load 588287-1.svg
 load 588287-2.svg
 load 590425-1.html
 load 592477-1.xhtml
 load 594653-1.svg
 load 596796-1.svg
 load 605345-1.svg
 load 606101-1.svg
--- a/layout/reftests/svg/smil/reftest.list
+++ b/layout/reftests/svg/smil/reftest.list
@@ -271,17 +271,17 @@ fuzzy-if(cocoaWidget&&layersGPUAccelerat
 # Test animation using defs element
 == anim-defs-gradient-property.svg lime.svg
 == anim-defs-gradient-attribute.svg lime.svg
 == anim-defs-fill.svg lime.svg
 == anim-defs-width.svg lime.svg
 # Test animation that changes 'display' attribute
 == anim-display.svg lime.svg
-skip-if(styloVsGecko||stylo) == anim-display-in-g-element.svg lime.svg # Bug 1385089
+== anim-display-in-g-element.svg lime.svg
 # Test animation that change 'display' style value to 'none'
 == anim-change-display-none-for-ancestor-elem.html lime.html
 == anim-change-display-none-for-target-elem.html lime.html
 == anim-change-display-none-for-dynamically-appended-elem.html lime.html
 == anim-change-display-block-for-dynamically-appended-elem.html anim-standard-ref.html
 pref(layout.css.clip-path-shapes.enabled,true) fuzzy(63,146) == anim-clipPath-viewBox.svg anim-clipPath-viewBox-ref.svg