Skip to content
Ooidget

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:

  1. Set env from A and the host.
  2. Let root's box be A, scaled from the component's size according to its fit.
  3. Build the instance tree from the root: for each instance, compute its view, then its children (expanding each, dropping those whose when is false), then place them by layout.
  4. Advance motions to the frame's time.
  5. Draw the tree depth-first: for each instance, its layers in order (each whose when holds, at its box, with its opacity), then its children in order; clip to the instance's box if its clip is true.
  6. Give the host the boxes of slots shown this frame.

Handling an event

To deliver an input event, run these steps:

  1. Find the target by hit-testing (for pointer events) or take the focused instance (for keys and rotary input).
  2. Walk from the target towards the root to the first instance whose handler object has a handler for the event.
  3. Call the handler with the arguments of its event.
  4. If it returned an object: remove and pass on any command; write the rest.
  5. 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).