[css-grid] Scroll reset position when updating inner html on content
[WebKit-https.git] / LayoutTests / resources / plugin.js
1 // Wait for the load event, run post layout tasks, run the specified function,
2 // and notify the test runner that the test is done.
3
4 var NotifyDone = true;
5 var DoNotNotifyDone = false;
6
7 function runAfterPluginLoad(func, notifyDone, node) {
8     if (window.testRunner)
9         testRunner.waitUntilDone();
10
11     window.addEventListener('load', function() {
12         if (window.internals)
13             internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(node);
14
15         if (func)
16             func();
17
18         if (notifyDone && window.testRunner)
19             testRunner.notifyDone();
20     }, false);
21 }