dillo-browser / dillo

Dillo, a multi-platform graphical web browser
https://dillo-browser.github.io/
GNU General Public License v3.0
513 stars 25 forks source link

Add event debugging mechanism #98

Open rodarima opened 3 months ago

rodarima commented 3 months ago

Similarly as the RTFL tools, we need a way to record step by step how the layouting engine is processing the tree. It is not enough that we show the last values of the widget tree as the debug window is currently doing.

In particular, I'm observing problems such as widget computing the available space by asking up in the tree until the root several times. This computation must be cached, as once a parent widget has computed the available size it shouldn't change until we finish the sizeRequest.

I'm thinking in adding a debugging mode in which Dillo records the last sizeRequests in a list, so we can explore one by one. Then, we also record the calls done by every widget, similarly as RTFL, but displayed directly on the browser. The idea is that we already distribute all the tools to debug problems builtin, so other people can take a look at what may be happening with low effort.

Ideally we should be able to turn it on only when the user requests it, otherwise we will introduce a lot of performance and memory problems.

rodarima commented 3 months ago

Here is an example using a tree, where we instrument some functions, much like RTFL:

kk

The difference is we can expand the nodes interactively, which helps hiding information that is not relevant.