Ooidget Component Format 0.1Editor's Draft
Processing model
This section defines a frame and an event as algorithms. A runtime MAY implement them in any way that gives the same result; in particular it MAY skip recomputing parts whose inputs have not changed.
Producing a frame
To produce a frame of a root instance shown in an area A, run these steps:
- Set
envfrom A and the host. - Let root's box be A, scaled from the component's
sizeaccording to itsfit. - Build the instance tree from the root: for each instance, compute its view, then its children (expanding
each, dropping those whosewhenis false), then place them by layout. - Advance motions to the frame's time.
- Draw the tree depth-first: for each instance, its layers in order (each whose
whenholds, at its box, with its opacity), then its children in order; clip to the instance's box if itsclipis true. - Give the host the boxes of slots shown this frame.
Handling an event
To deliver an input event, run these steps:
- Find the target by hit-testing (for pointer events) or take the focused instance (for keys and rotary input).
- Walk from the target towards the root to the first instance whose handler object has a handler for the event.
- Call the handler with the arguments of its event.
- If it returned an object: remove and pass on any command; write the rest.
- Request a frame.
Reference rendering
The reference rendering of a document is the rendering of the reference web runtime in a browser conforming to the referenced CSS and SVG specifications. Conformance tests compare a runtime’s output with reference renderings within a stated tolerance (Conformance).