mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1634456 - Use double-raf to wait for caret scrolling to happen.
Before bug 1634153, we were using Dispatch(), so setTimeout(0) was the right thing to wait for. In bug 1634153 I used the existing mechanism which works as an early refresh driver runner, so we need to wait for a refresh driver tick, not an event loop turn. Differential Revision: https://phabricator.services.mozilla.com/D73834
This commit is contained in:
parent
081eb32294
commit
6dd8794692
@ -11,7 +11,9 @@
|
||||
synthesizeKey("KEY_ArrowDown");
|
||||
// caret should now be at the start of the third line
|
||||
document.body.offsetHeight;
|
||||
setTimeout(function(){ document.documentElement.removeAttribute("class"); },0);
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}));
|
||||
}
|
||||
function runTests() {
|
||||
document.querySelector('textarea').focus();
|
||||
|
@ -19,7 +19,9 @@
|
||||
synthesizeKey("KEY_ArrowRight"); // collapse to the end of the selection
|
||||
// caret should now be at the start of the third line
|
||||
document.body.offsetHeight;
|
||||
setTimeout(function(){ document.documentElement.removeAttribute("class"); },0);
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}));
|
||||
}
|
||||
function runTests() {
|
||||
document.querySelector('textarea').focus();
|
||||
|
Loading…
Reference in New Issue
Block a user