[dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-17 Thread Josh Matthews
While listening to the Gecko platform talk about shutting down video decoders for offscreen elements, I wondered about how we could do the same in Servo. We obviously don't support decoding video yet, but what would be an efficient way of doing that in the future? Cheers, Josh

Re: [dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-20 Thread Jack Moffitt
How is this done in Gecko? We learn something is not visible during one of the various cullings of WebRender. So I guess the idea would be to have some notification you send when something goes from visible previously to invisible. I suppose there is an analog when doing flow construction that you

Re: [dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-20 Thread Simon Sapin
On 17/06/16 13:01, Josh Matthews wrote: While listening to the Gecko platform talk about shutting down video decoders for offscreen elements, I wondered about how we could do the same in Servo. We obviously don't support decoding video yet, but what would be an efficient way of doing that in the

Re: [dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-20 Thread Robert O'Callahan
On Tue, Jun 21, 2016 at 4:41 AM, Jack Moffitt wrote: > How is this done in Gecko? > Display list analysis in the main thread. We learn something is not visible during one of the various cullings > of WebRender. So I guess the idea would be to have some notification > you send when something goe

Re: [dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-20 Thread Jack Moffitt
> The problem is that you want notifications ahead of time that an element is > predicted to become visible, so you can decode images/video etc hopefully > in time to render the element the moment it becomes visible. Does this mean you need scroll velocity and other such data to make such a predic

Re: [dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-20 Thread Robert O'Callahan
On Tue, Jun 21, 2016 at 9:16 AM, Jack Moffitt wrote: > > The problem is that you want notifications ahead of time that an element > is > > predicted to become visible, so you can decode images/video etc hopefully > > in time to render the element the moment it becomes visible. > > Does this mean

Re: [dev-servo] How to efficiently react to an element changing visibility status from DOM code?

2016-06-21 Thread Patrick Walton
Note that WR is now keeping the DOM up to date with the current scroll offset (or at least as close to "up to date" as you can be with APZ) so this could reasonably be done DOM-side, I imagine. Patrick On Jun 17, 2016 4:02 AM, "Josh Matthews" wrote: > While listening to the Gecko platform talk a