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

--HG--
extra : rebase_source : 33e9db953f21168c76716329568191625bd15896
This commit is contained in:
Hiroyuki Ikezoe 2017-08-02 20:01:08 +09:00
Родитель 8b0ea4a17c
Коммит 9bf9d338f9
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -20,7 +20,7 @@ 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

Просмотреть файл

@ -276,7 +276,7 @@ fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,2) == anim-gradient-attr-presence-0
# 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