I realize this is likely a pipe dream, but I'm asking it here just in case.
What I want is a library that provides a GUI widget. Ideally this would be a widget that can be used in apps using some widely-supported GUI toolkit (like Qt). But if it just displays a GUI on its own, that's fine (as long as it will work on Windows, Mac and Linux).
I want this GUI widget to render HTML/CSS. That is, I want to be able to provide HTML and CSS to this widget and have it render it in a GUI window.
The real rub is that I want to be able to access and manipulate the DOM from outside the widget, but have the widget respond to my manipulations by updating the display appropriately. The ideal widget would have a pluggable DOM interface that can be easily "bound" to a variety of languages. But the one I really want to use is Python, so that's the highest priority. So I want to be able to write code in Python that can query the DOM, edit it, manipulate it, respond to events from it, etc. I don't care if the API I use to interact with the DOM is the official W3C DOM API, and in fact that API is convoluted enough that it might be better to have something higher-level.
The big difference between what I'm asking for here and things like QtWebEngine is that, as far as I can tell, those are essentially embedded browsers. I don't want a browser. I want a widget that takes HTML and CSS, renders it, keeps track of the DOM, and exposes the DOM to an external app (the app that the widget is running inside) so that that app (and not the browser engine) can interact with the DOM.
In short, I want something that allows me to treat individual DOM elements the same way I would treat individual widgets in a GUI toolkit like Qt: as objects that can be addressed, manipulated, queried, and responded to from arbitrary code in a language with bindings for the HTML "toolkit".
Oh, and I want it to be free. After everything else, that's not so much to ask, is it?