mediawiki.notification: Move offset() computation to next frame
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 4 Oct 2017 20:30:24 +0000 (21:30 +0100)
committerJames D. Forrester <jforrester@wikimedia.org>
Wed, 4 Oct 2017 21:41:25 +0000 (14:41 -0700)
commitf2e8cd6dbdfc4c2004c5ff5f2d20b6d484589c30
tree3bcd1bb621ac07a2ed64eaa563e21d346d0ef089
parent1653400c2f2e8dc941b2f1e81eebeb2587ca2d22
mediawiki.notification: Move offset() computation to next frame

Crrently on all page views in WMF production, the $.ready handler
is inserting the notif $area and subsequently doing a forced
style calculation due to getBoundingClientRect() from offset().

Move this to an animation frame instead and re-order the statements
so that DOM reads go before DOM writes.

Change-Id: I7c6201dc8d4e3227e01b75e853b6e4dc9a734031
resources/src/mediawiki/mediawiki.notification.js