[dev-servo] Partial layout flushes

2017-03-27 Thread Boris Zbarsky
Has there been any thought put into being able to satisfy queries for 
layout information without doing a full style + layout flush on the 
page?  There are obviously things like CSS containment that can help 
here, but it seems like it might be worth it to see whether we can 
detect situations in which whatever stuff is dirty can't affect the 
information being queried.


Yes, I know this is a hard, researchy, problem.  ;)

-Boris
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] Partial layout flushes

2017-03-27 Thread Jack Moffitt
Responses to layout queries are just sent messages (if layout needed
invoking to answer them). It is possible to send them early as soon as
the relevant data has been computed. Servo does not do this currently
though. An initial implementation could just reply with the answer and
then keep running layout to completion. I assume this will still
require styling + 2 tree passes in most cases, but the last pass will
be shortened.

jack.

On Mon, Mar 27, 2017 at 8:28 AM, Boris Zbarsky  wrote:
> Has there been any thought put into being able to satisfy queries for layout
> information without doing a full style + layout flush on the page?  There
> are obviously things like CSS containment that can help here, but it seems
> like it might be worth it to see whether we can detect situations in which
> whatever stuff is dirty can't affect the information being queried.
>
> Yes, I know this is a hard, researchy, problem.  ;)
>
> -Boris
> ___
> dev-servo mailing list
> dev-servo@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] Partial layout flushes

2017-03-27 Thread Boris Zbarsky

On 3/27/17 10:36 AM, Jack Moffitt wrote:

Responses to layout queries are just sent messages (if layout needed
invoking to answer them). It is possible to send them early as soon as
the relevant data has been computed. Servo does not do this currently
though. An initial implementation could just reply with the answer and
then keep running layout to completion. I assume this will still
require styling + 2 tree passes in most cases, but the last pass will
be shortened.


That would be an interesting start, yes.

How would it handle the common failure mode I'd really like to address, 
where a page does:


1)  Modify style.
2)  Ask for layout data.
3)  Modify style.
4)  Ask for layout data.

At step 4, will we just need to wait for the layout from step 2 to 
complete before we can start the new restyling pass?


-Boris
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] Partial layout flushes

2017-03-27 Thread Jack Moffitt
> How would it handle the common failure mode I'd really like to address,
> where a page does:
>
> 1)  Modify style.
> 2)  Ask for layout data.
> 3)  Modify style.
> 4)  Ask for layout data.
>
> At step 4, will we just need to wait for the layout from step 2 to complete
> before we can start the new restyling pass?

Yes, but since layout runs in parallel and is pretty fast, I'd think
the common case was that it would be done by the time it got the
second request. I would think it would not be all that much harder to
actually stop layout before it was complete too, so this case would be
handled, but that leaves you with changes to the tree which haven't
produced display lists. My guess is that it will be hard to know
whether another synchronous query is coming and which mode should be
engaged.

jack.
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] Partial layout flushes

2017-03-27 Thread Boris Zbarsky

On 3/27/17 12:05 PM, Jack Moffitt wrote:

Yes, but since layout runs in parallel and is pretty fast, I'd think
the common case was that it would be done by the time it got the
second request.


I doubt layout is "pretty fast" on the scale involved here, which is 
"hundreds of times per frame".  But I'm obviously willing to be 
convinced otherwise by measurements.  ;)



My guess is that it will be hard to know
whether another synchronous query is coming and which mode should be
engaged.


Yes, I'm not saying there are easy solutions here.

-Boris

___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo