# Scene format type model

[Canonical page](https://nothing.graphics/docs/format/spec/type-model) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/spec/type-model.md)

Structural declarations for XML elements, properties, inheritance and child slots.



The [WebIDL model](https://github.com/gridaco/nothing/blob/main/ncf/spec/scene.webidl) describes the structure of all 32 Level 1
elements and the separate perspective trial. The generated [reference](https://nothing.graphics/docs/format/reference)
shows legal owners, child slots, exact spellings, defaults, and keyability.
The specification chapters define evaluation, including timing and rendering.
The [vocabulary inventory](https://github.com/gridaco/nothing/blob/main/ncf/spec/vocabulary.tsv) remains the input to existing
format validators.

The standalone preview and N4 exercise the proposed perspective syntax
alongside Level 1's 2D cameras. The trial includes the `plane` element, the
camera's perspective fields and the scene's metric scale. The
[perspective optics decision](https://nothing.graphics/docs/format/spec/perspective-camera-optics) defines ratified
focus behavior. The [spatial camera proposal](https://github.com/gridaco/nothing/blob/main/ncf/rfcs/spatial-cameras.md)
describes source syntax under review and discusses further projections.

## Find the governing rule [#find-the-governing-rule]

| Authoring question                                                            | Reference                                                                                                                                                                                                                                              | Governing rule                                                                                                                                                                                                                                                      | Evidence                                                                                                                                                                                                         |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| How does a document resolve its viewport, clock and sources?                  | [Scene](https://nothing.graphics/docs/format/reference/scene)                                                                                                                                                                                          | [Canvas and clock](https://nothing.graphics/docs/format/spec#canvas-and-clock), [source-preserving editing](https://nothing.graphics/docs/format/spec#source-preserving-editing), [diagnostics](https://nothing.graphics/docs/format/spec#diagnostics-and-evidence) | [Document and patch cases](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#ownership-and-source-edits)                                                                                    |
| What can paint inside a shape and how does it stack?                          | [Shape](https://nothing.graphics/docs/format/reference/shape), [Fill](https://nothing.graphics/docs/format/reference/fill), [Paint](https://nothing.graphics/docs/format/reference/paint), [Mask](https://nothing.graphics/docs/format/reference/mask) | [Graphics and coverage](https://nothing.graphics/docs/format/spec/graphics)                                                                                                                                                                                         | [Paint stacks, strokes and masks](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#paint-stacks-strokes-and-mask-coverage)                                                                 |
| Which point stays fixed while geometry resizes?                               | [Registration](https://nothing.graphics/docs/format/reference/registration)                                                                                                                                                                            | [Size, registration and offset](https://nothing.graphics/docs/format/spec/boxed-geometry#size-registration-and-offset)                                                                                                                                              | [Boxed geometry cases](https://github.com/gridaco/nothing/blob/main/ncf/conformance/boxed-geometry/README.md)                                                                                                    |
| Does blur read the drawable or earlier paint?                                 | [Filter](https://nothing.graphics/docs/format/reference/filter), [Backdrop filter](https://nothing.graphics/docs/format/reference/backdrop-filter)                                                                                                     | [Filters and shadows](https://nothing.graphics/docs/format/spec/filters)                                                                                                                                                                                            | [Layer effects](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#layer-effects)                                                                                                            |
| Which element owns a track, and how do its addresses resolve?                 | [Animate](https://nothing.graphics/docs/format/reference/animate), [Key](https://nothing.graphics/docs/format/reference/key)                                                                                                                           | [Property animation](https://nothing.graphics/docs/format/spec/animation)                                                                                                                                                                                           | [Property animation cases](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#property-animation-cases)                                                                                      |
| Which clock controls a sequence and which clock controls its source?          | [Sequence](https://nothing.graphics/docs/format/reference/sequence)                                                                                                                                                                                    | [Resolving a composition](https://nothing.graphics/docs/format/spec/sequences#resolving-a-composition-at-time-t)                                                                                                                                                    | [Moving card](https://github.com/gridaco/nothing/blob/main/ncf/conformance/composition-card.md)                                                                                                                  |
| How does a child stay attached to a changing contour?                         | [Locator](https://nothing.graphics/docs/format/reference/locator)                                                                                                                                                                                      | [Attachment hosts and locators](https://nothing.graphics/docs/format/spec/attached-drawables#hosts)                                                                                                                                                                 | [Attachment conformance](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#running-the-wider-conformance-cases)                                                                             |
| How do groups, transform pivots and cameras affect coordinates?               | [Group](https://nothing.graphics/docs/format/reference/group), [Transform](https://nothing.graphics/docs/format/reference/transform), [Camera](https://nothing.graphics/docs/format/reference/camera)                                                  | [Spatial composition](https://nothing.graphics/docs/format/spec/spatial)                                                                                                                                                                                            | [Camera cuts](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#camera-cuts), [drawable blending](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#drawable-blending) |
| Which fonts and resources do I bind to reproduce the layout?                  | [Text font fields](https://nothing.graphics/docs/format/reference/text#font-family)                                                                                                                                                                    | [Font matching and resources](https://nothing.graphics/docs/format/spec/fonts#reproducing-a-layout)                                                                                                                                                                 | [Font resolution cases](https://github.com/gridaco/nothing/blob/main/ncf/conformance/fonts/README.md)                                                                                                            |
| How do I replace a word and preserve its style through reflow?                | [Text](https://nothing.graphics/docs/format/reference/text), [Span](https://nothing.graphics/docs/format/reference/span), [Text copy](https://nothing.graphics/docs/format/reference/text-copy)                                                        | [Text content and ownership](https://nothing.graphics/docs/format/spec/text#content-and-ownership)                                                                                                                                                                  | [Editable caption and moving card](https://github.com/gridaco/nothing/blob/main/ncf/conformance/composition-card.md)                                                                                             |
| How do I reveal just one stroke along its contour?                            | [Trim](https://nothing.graphics/docs/format/reference/trim)                                                                                                                                                                                            | [Contour distance and coverage](https://nothing.graphics/docs/format/spec/contour-trim)                                                                                                                                                                             | [Trim acceptance checks](https://nothing.graphics/docs/format/spec/contour-trim#checks-for-implementation-and-review)                                                                                            |
| Which perspective rules are ratified and which authoring fields are in trial? | [Camera](https://nothing.graphics/docs/format/reference/camera), [Plane](https://nothing.graphics/docs/format/reference/plane)                                                                                                                         | [Perspective optics](https://nothing.graphics/docs/format/spec/perspective-camera-optics), [spatial camera proposal](https://github.com/gridaco/nothing/blob/main/ncf/rfcs/spatial-cameras.md)                                                                      | [Perspective focus pull](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#perspective-focus-pull)                                                                                          |

Use the [standalone preview coverage](https://github.com/gridaco/nothing/blob/main/ncf/tools/ncf-preview/README.md#preview-coverage)
and the [authoring readiness record](https://nothing.graphics/docs/format/implementation-support) to distinguish
recognized source, sampled results, and verified editing operations.

## XML annotations [#xml-annotations]

Each concrete interface declares its case-sensitive XML tag with
`[Xml="…"]`. An `[Abstract]` interface names shared structure or an element
family. WebIDL inheritance and `includes` carry members to each concrete
owner. Abstract interfaces and mixins have their own reference pages.

* Writable members describe XML attributes. The member name gives the
  spelling unless it has an `[Xml="…"]` annotation. `double` uses the finite
  decimal grammar. Enums supply exact legal named values. `DOMString`
  represents a lexical form described by `[Grammar="…"]`. `[Unit="…"]`
  records units.
* `[Required]` means the concrete owner needs an authored attribute.
  `[Default="…"]` records an omitted value or resolution rule.
  `sampled <attribute>` refers to another field's sampled value.
  `[DefaultOverride="member=value"]` changes an inherited default.
  `[ValuesOverride="member=a,b"]` narrows an inherited enum for one owner.
  Both use the WebIDL member name. `[Constraint="…"]` records conditional
  requirements such as paired fields, type-specific geometry and leaf copy.
* `[Keys=Scalar]`, `[Keys=Color]`, `[Keys=PointList]`, and `[Keys=Path]`
  use the corresponding continuous interpolation rules. `[Keys=Hold]`
  permits held changes. The trial's `[Keys=Focus]` uses scalar interpolation
  between positive f-numbers and holds when crossing between zero and a
  positive value. Attributes without a key annotation are static.
  `[Target]` gives an animation-only property its own heading and removes
  it from the XML attribute set. An owner with a keyable attribute or
  logical target admits `animate` children. [Property animation](https://nothing.graphics/docs/format/spec/animation)
* Readonly members denote child slots. An interface type gives one child, a
  nullable type gives zero or one, and `FrozenArray<T>` gives zero or more.
  `[Min="1"]` or `[Min="2"]` raises the minimum for a repeated slot. A union
  or abstract type supplies alternatives in the same slot. `[Order="…"]`
  records how source order affects evaluation.
* `[Parents="…"]` lists allowed XML parents, or `document` for the root and
  `property` for an animation. An animation's actual parents follow from
  the keyable properties. `[TrialParents="…"]` records additional parents
  in the spatial trial. `[Status=Trial]` marks trial elements, members and
  child slots. Members declared on a trial element inherit that status.
* `[Title="…"]` names an entry. Concrete reference headings use the XML
  tag. `[Summary="…"]` supplies a short page description.
  `[Meaning="…"]` and `[Constraint="…"]` explain the role and restrictions.
  `[Spec="chapter.md#section"]` links to the governing rule. When a member
  gives no rule of its own, it uses its declaring interface or mixin's link.

## Keeping the reference current [#keeping-the-reference-current]

The generated reference keeps existing element and owner heading links
stable. A page's ID is the XML spelling for an element and the kebab-case
type or mixin name for a shared definition.

From [the format reference tool](https://github.com/gridaco/nothing/tree/main/ncf/tools/reference/), run `npm ci`,
`npm run generate`, `npm run check`, and `npm test`. Parity compares every
expanded element context, attribute owner and enum value set, and
animation-only target with the vocabulary. It requires matching
incoming and outgoing child slots. The freshness check reports missing,
stale, and orphan pages. Cardinality, conditional rules, and interpolation
live in the type model and the linked chapters.
