Windows and documents
Platform handles platform initialization and the event loop. Window owns the target window, while Document holds the DOM, styles and interface managers. Loading new HTML rebuilds document state; pointers into the old DOM must not be reused.
Work performed in a frame
Window::processFrame() enters Renderer::renderFrame(). Document::updateIfNeeded() updates scripts, timers, styles and layout. Painter builds a DisplayList for RenderBackend to execute. Document drives style and layout work and owns their lifecycle.
How changes propagate
Style, layout and paint have separate dirty flags. A color change usually requires paint, while geometry or box-tree changes may require layout. Distinguish elapsed time, work counts, submitted frames and idle state when measuring performance.
Rendering boundary
Skia stays behind the rendering boundary. Applications should use KUI public APIs and extension ABIs, rather than internal layout objects or Skia types. The native C++ ABI still involves STL and CRT compatibility; the C ABI has a separate contract.
Where application code belongs
HTML/CSS owns structure and appearance; the native model owns application state, storage and tasks. Events connect user actions to that model. Lua fits local UI logic. Show “saved” after the business operation succeeds, rather than treating a message as the state itself.
Reloading differs from rebuilding
loadHTML/loadFile replace the document; look up nodes again afterward. The lessons embed pages in generated headers, so HTML/CSS edits require rebuilding. Use DevTools style edits to experiment, then write them back to source and restart.
Something unclear?
Report an issue on this page →