The OutsideViewport throttling was not implemented in r261113. It has been disabled since r242624 because the RenderingUpdate is currently serving the rAF callbacks with its speed regardless the rAF is throttled or not. The goal of the OutsideViewport throttling to save power by stoping calling the rAF callbacks of any <iframe> which is outside the viewport.
Created attachment 398578 [details] Patch
<rdar://problem/62937165>
These two tests fail consistently with this patch. webgl/2.0.0/conformance/canvas/rapid-resizing.html webgl/2.0.0/conformance2/rendering/canvas-resizing-with-pbo-bound.html These conformance tests are run by putting the test itself inside an <iframe> element. The script of the test relies on calling requestAnimationFrame() multiple times. The problem is the <iframe> in these tests are outside the viewport of the test window (800x600). Because the patch throttles the OutsideViewport rAF for 10 seconds, the rAF callback is called only every 10 seconds. And this is why they time out.
Possible solutions: 1. Add an internal setting to enable the 'OutsideViewport' rAF throttling. This setting will be on by default but it will be disabled for DRT and WTR. The new test which is attache here will enable it through Internals.setOutsideViewportThrottlingEnabled(). 2. Throttle rAF only for 3rd party <iframe> which is will be cross origin. But do not throttle rAF for 1st party <iframe> which will be same origin. 3. Adjust these tests to show the <iframe> even if partially.
Created attachment 398675 [details] Patch
Created attachment 398697 [details] Patch
(In reply to Said Abou-Hallawa from comment #4) > Possible solutions: > > 1. Add an internal setting to enable the 'OutsideViewport' rAF throttling. > This setting will be on by default but it will be disabled for DRT and WTR. > The new test which is attache here will enable it through > Internals.setOutsideViewportThrottlingEnabled(). This one.
(In reply to Simon Fraser (smfr) from comment #7) > (In reply to Said Abou-Hallawa from comment #4) > > Possible solutions: > > > > 1. Add an internal setting to enable the 'OutsideViewport' rAF throttling. > > This setting will be on by default but it will be disabled for DRT and WTR. > > The new test which is attache here will enable it through > > Internals.setOutsideViewportThrottlingEnabled(). > > This one. It is implemented in the attached patch.
Committed r261663: <https://trac.webkit.org/changeset/261663> All reviewed patches have been landed. Closing bug and clearing flags on attachment 398697 [details].