3 ms·
> The most glaring is the ability to measure things (including text) in order to lay them out ... This has nothing with the DOM (or HTML or CSS for that matter
by c-smile 6y ago
> The most glaring is the ability to measure things (including text) in order to lay them out ...
This has nothing with the DOM (or HTML or CSS for that matter).
Yes, sometimes in desktop UI you will need to know exact element position/dimensions. That's why in Sciter I've added:
1. element.update(); method, it will force dimensions to be calculated at this moment.
2. element.onSize = function() {...} called when dimensions of the element change.
3. element.paintContent = function(graphics) {} called to paint the element on graphics. Dimensions and position of the element is known at this moment.
4. There is a Graphics.Text object that allows to calculate (not just render) text and glyph positions.
My main point with all this: it is a matter of API provided and has nothing with HTML/CSS per se.
For that matter, Flutter also uses DOM (tree of widgets, etc.). It is just that its style system is not declarative and misses cascading - for some reasons they decided to use WPF/XAML way of doing business. But we've already sang "Sic transit gloria mundi" to WPF ...
For the text editing... check html-notepad : https://html-notepad.com/ https://html-notepad.com/ . Left sidebar (structure outline) is computed and painted in immediate rendering painting mode - when paintContent of the document is invoked.
- Sophistifunk 6y agoWhen I wrote "DOM" I meant the DOM as in the W3C one you're looking at right now, not Sciter, which I haven't used. Nothing wrong with the concept of trees of objects, other than the fact the tree usually forms part of the objects.