3 ms·
The DOM element arrival detection is based on animation events in Sentinel. Sentinel adds global style rules that cause newly born elements to start animation a
by c-smile 9y ago
The DOM element arrival detection is based on animation events in Sentinel. Sentinel adds global style rules that cause newly born elements to start animation and so generate "animationstart" event that the library catches.
That appears if not hacky then a bit heavyweight - 2 passes of layout needed at least.
But I do understand the need for this. In sciter I've added special CSS property aspect that takes name of the function to execute when element gets mounted into the DOM and before any layout on it:
my-component {
aspect: MyComponent url(script/my-components.js);
color:blue;
}
and script:
function MyComponent() {
this // is the element just added to the DOM.
}