Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upServo will do reflow 3x at startup #5093
Comments
|
Yep, the patch on #5096 kind of confirms that the extra 2x reflows are thanks to window resize events. |
|
Loading CNN will have many reflow events. Working with the theory that they could be triggered by images, I started with a simple page that has several elements (script, style, p, div, link and an image) and confirmed that the forced reflows are bound to the presence of an image. The test page: https://gist.github.com/Adenilson/15997c41a37a7ce29e85 What is a bit puzzling is that sometimes there will be a single reflowEvent and most frequently 2x reflows as seen in: https://gist.github.com/Adenilson/e068ab9a8a49ad345070 |
|
Based on @pcwalton's comments on IRC, it seems like the discrepancy between 1 and 2 reflows is when the image load completes. This seems like two bugs in one. The first bug is that loading an image shouldn't necessarily reflow. It's quite possible the size of the image is already known and no layout computation needs to happen. The second bug is that if the image isn't loaded, and it might reflow, we are doing extra reflow for no reason. In this case, I'm guessing it will use some default size since it doesn't know the real size, reflow, then reflow again when the size is known. This could explain the jiggling from #5083. |
|
Or rather, it explains some of the jiggling. Because that title slide has no images and the other ones will all have display: none! |
|
Ok, doing some work in another issue, I just stumbled on this: |
|
I have a question… is the layout non deterministic? I’m seeing some different results while running servo (e.g. concerning the display lists). For this page https://gist.github.com/Adenilson/850bc5260b2fcd218c9e I faced this https://gist.github.com/Adenilson/d3e7b1556eb109db6121 Can the display list optimizer drop some items from time to time? |
|
Non-determinism in end results (as opposed to just scheduling) smells like bugs. |
|
That being said, what is consistent is 2 reflow events at startup (FirstLoad, WindowResize) e.g. running with -Z relayout-event. And when there is a single image in the page, 2 other events (ReceivedReflowEvent + ReceivedReflowEvent). |
|
Is this still true? Can we close this? |
|
Bump :) |
|
I haven't worked on Servo for the last 5 years, my guess is that you can just close this issue. |
How to reproduce:
Start servo with ./servo --debug dump-display-list url
Expected result
It should dump the display list and print 'start printing display list' 3 times.
Further info
This points that reflow is being triggered at least 3 times. It is confirmed for both local and remote URLs, and happens in both OSX and Linux.
Maybe it has to do with window resize events forcing a new reflow?