Auto merge of #16826 - hiikezoe:check-animation-flag, r=birtles
Auto merge of #16826 - hiikezoe:check-animation-flag, r=birtles

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 -->

emilio/servo,paulrouget/servo,saneyuki/servo,avadacatavra/servo,saneyuki/servo,cbrewster/servo,dati91/servo,rnestler/servo,KiChjang/servo,paulrouget/servo,CJ8664/servo,DominoTree/servo,cbrewster/servo,peterjoel/servo,DominoTree/servo,mbrubeck/servo,notriddle/servo,eddyb/servo,KiChjang/servo,nnethercote/servo,paulrouget/servo,avadacatavra/servo,dsandeephegde/servo,pyfisch/servo,thiagopnts/servo,paulrouget/servo,sadmansk/servo,fiji-flo/servo,nnethercote/servo,DominoTree/servo,notriddle/servo,emilio/servo,DominoTree/servo,szeged/servo,canaltinova/servo,saneyuki/servo,canaltinova/servo,thiagopnts/servo,splav/servo,larsbergstrom/servo,fiji-flo/servo,ConnorGBrewster/servo,nnethercote/servo,pyfisch/servo,rnestler/servo,dsandeephegde/servo,nnethercote/servo,dati91/servo,CJ8664/servo,CJ8664/servo,saneyuki/servo,mbrubeck/servo,SimonSapin/servo,paulrouget/servo,paulrouget/servo,notriddle/servo,rnestler/servo,larsbergstrom/servo,dati91/servo,ConnorGBrewster/servo,KiChjang/servo,thiagopnts/servo,SimonSapin/servo,ConnorGBrewster/servo,fiji-flo/servo,CJ8664/servo,upsuper/servo,sadmansk/servo,avadacatavra/servo,mattnenterprise/servo,notriddle/servo,eddyb/servo,dsandeephegde/servo,thiagopnts/servo,upsuper/servo,pyfisch/servo,pyfisch/servo,peterjoel/servo,mattnenterprise/servo,splav/servo,canaltinova/servo,DominoTree/servo,rnestler/servo,szeged/servo,SimonSapin/servo,splav/servo,DominoTree/servo,ConnorGBrewster/servo,peterjoel/servo,larsbergstrom/servo,thiagopnts/servo,pyfisch/servo,notriddle/servo,pyfisch/servo,mattnenterprise/servo,dsandeephegde/servo,anthgur/servo,peterjoel/servo,fiji-flo/servo,emilio/servo,canaltinova/servo,larsbergstrom/servo,KiChjang/servo,anthgur/servo,thiagopnts/servo,KiChjang/servo,saneyuki/servo,notriddle/servo,szeged/servo,sadmansk/servo,upsuper/servo,mbrubeck/servo,SimonSapin/servo,emilio/servo,eddyb/servo,fiji-flo/servo,emilio/servo,mbrubeck/servo,dati91/servo,eddyb/servo,rnestler/servo,jimberlage/servo,paulrouget/servo,sadmansk/servo,anthgur/servo,DominoTree/servo,mattnenterprise/servo,KiChjang/servo,cbrewster/servo,jimberlage/servo,emilio/servo,larsbergstrom/servo,rnestler/servo,nnethercote/servo,jimberlage/servo,upsuper/servo,saneyuki/servo,jimberlage/servo,eddyb/servo,pyfisch/servo,sadmansk/servo,fiji-flo/servo,dsandeephegde/servo,canaltinova/servo,nnethercote/servo,peterjoel/servo,SimonSapin/servo,eddyb/servo,nnethercote/servo,dsandeephegde/servo,jimberlage/servo,notriddle/servo,DominoTree/servo,mattnenterprise/servo,peterjoel/servo,upsuper/servo,mbrubeck/servo,fiji-flo/servo,thiagopnts/servo,szeged/servo,mattnenterprise/servo,szeged/servo,dati91/servo,splav/servo,rnestler/servo,anthgur/servo,anthgur/servo,paulrouget/servo,KiChjang/servo,fiji-flo/servo,splav/servo,saneyuki/servo,emilio/servo,SimonSapin/servo,jimberlage/servo,saneyuki/servo,notriddle/servo,avadacatavra/servo,notriddle/servo,sadmansk/servo,larsbergstrom/servo,CJ8664/servo,szeged/servo,cbrewster/servo,DominoTree/servo,CJ8664/servo,notriddle/servo,dati91/servo,cbrewster/servo,avadacatavra/servo,mbrubeck/servo,canaltinova/servo,jimberlage/servo,emilio/servo,nnethercote/servo,SimonSapin/servo,ConnorGBrewster/servo,jimberlage/servo,szeged/servo,dsandeephegde/servo,larsbergstrom/servo,saneyuki/servo,paulrouget/servo,cbrewster/servo,peterjoel/servo,CJ8664/servo,thiagopnts/servo,szeged/servo,cbrewster/servo,splav/servo,larsbergstrom/servo,mbrubeck/servo,canaltinova/servo,anthgur/servo,ConnorGBrewster/servo,upsuper/servo,avadacatavra/servo,dati91/servo,peterjoel/servo,dati91/servo,SimonSapin/servo,splav/servo,pyfisch/servo,mbrubeck/servo,emilio/servo,paulrouget/servo,pyfisch/servo,larsbergstrom/servo,upsuper/servo,szeged/servo,anthgur/servo,splav/servo,avadacatavra/servo,splav/servo,emilio/servo,peterjoel/servo,KiChjang/servo,ConnorGBrewster/servo,KiChjang/servo,nnethercote/servo,cbrewster/servo,upsuper/servo,peterjoel/servo,eddyb/servo,DominoTree/servo,CJ8664/servo,pyfisch/servo,rnestler/servo,sadmansk/servo,avadacatavra/servo,KiChjang/servo,larsbergstrom/servo,saneyuki/servo,nnethercote/servo,eddyb/servo,canaltinova/servo,dsandeephegde/servo,splav/servo,ConnorGBrewster/servo,mattnenterprise/servo,anthgur/servo,mattnenterprise/servo,jimberlage/servo,szeged/servo,sadmansk/servo