Bug 1413817 - Run requestAnimationFrame before resolving a Promise in waitForWheelEvent(). r?birtles
sendWheelAndPaintNoFlush waits for MozAfterPaint and calls a given callback
function when the MozAfterPaint is received. The MozAfterPaint is processed
after we did a paint process. That means that we have no chance to process
restyling between MozAfterPaint and requestAnimationFrame.
MozReview-Commit-ID: 1B8EZNozjFj
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -86,17 +86,19 @@ function waitForWheelEvent(aTarget) {
// system to send a wheel event to the element.
var targetRect = aTarget.getBoundingClientRect();
var centerX = targetRect.left + targetRect.width / 2;
var centerY = targetRect.top + targetRect.height / 2;
sendWheelAndPaintNoFlush(aTarget, centerX, centerY,
{ deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaY: targetRect.height },
- resolve);
+ () => {
+ requestAnimationFrame(resolve);
+ });
});
}
var omtaEnabled = isOMTAEnabled();
var isAndroid = !!navigator.userAgent.includes("Android");
var isServo = isStyledByServo();
var offscreenThrottlingEnabled =