Re: [cssom-view] Expose the 'renderport' to content

On 8/04/16 8:44 PM, Simon Pieters wrote:
> What if there are use cases for reading it at other times? In 
> particular during page load. With events it's typically racy whether 
> the event gets fired before the relevant event listener has been set 
> up, and it's a layer violation to fire an event in response to setting 
> a listener. Maybe a Promise?

This does seem like a useful use case to solve, but it's not clear to me 
how a Promise would work.

With an event listener, we would want to fire it in response to the 
listener being added, and then only fire it when changes occur. Wouldn't 
a promise require a new request each time, and we wouldn't be able to 
distinguish between the 'initial' case, and the normal one?

>
> I suppose that exposing a property could mean that it would have to 
> flush layout on getting if we want to avoid out of date information, 
> and maybe we don't want to introduce new things that flush layout?
>
Right, that was the main reason to prefer a callback rather than a property.

- Matt

Received on Monday, 11 April 2016 10:11:00 UTC