<model>
element
The `<model>` element allows embedding 3D graphical content inline within an [[HTML]] document to be managed declaratively, and rendered directly by the user agent. The `HTMLModelElement` interface then provides a simple API for controlling the presentation, animation, interaction, fetching, and UI affordances of a `<model>`.
This is a work in progress.
The HTML <model> element allows a website to embed interactive 3D models as conveniently as any other visual media. Models are served as a standalone resource. The <model> element also has support for interaction and animation playback while presented within the page, and supports more spatial experiences, such as the stereoscopic display of 3D content where available.
As <model> is rendered directly by the user agent, it has the ability to utilize privileged information, such as the user's head and eye position or the lighting of the user's environment, without exposing that information to JavaScript. Additionally, the use of accessibility information and controls can be engaged in a privacy-preserving manner.
As <model> is [=embedded content=], the user agent can present 3D content in a privacy-preserving, interactive, and accessible manner.
There are a number of specified non-goals for this initial incubation; some are beyond the long-term scope of this proposal, and others are deferred for the benefit of reaching consensus on an initial specification, which can hopefully serve the needs of users and authors sooner.
While the use cases for inspecting and manipulating the contents of a given model asset are clear, the initial scope of this proposal is intentionally limited to a reduced complexity, hopefully making the initial specification one that has broad consensus amongst the web community.
While many popular model formats include the ability to encode, play and mix multiple animations in an animation mixing system, This initial specification considers only a single animation timeline, both for simplicity and for having a minimal viable specification on which the web community can build on.
While many popular model formats support tapping on a 3D button inside their contents to show or hide additional contents like a title, play an animation or undertake some other stateful action. Because there is no current intention to provide a JavaScript-facing mechanism to be aware of such actions, stateful interactions should be considered out of scope.
While many popular model formats support the use of external asset requests for better re-use and consistency, this initial specification will only allow assets that are self-contained.
model
element
The [^model^] element is used for embedding 3D models into a document.
Content may be provided inside the [^model^] element. User agents should not show this content to the user; it is intended for web browsers which do not support [^model^], to be shown as fallback content.
autoplay
attribute
interactive
attribute
controls
attribute
crossorigin
attribute
height
attribute
loading
attribute
loop
attribute
muted
attribute
poster
attribute
The [^model/poster^] attribute gives the URL of an image file that the user agent can show while 3D content is unavailable. The attribute, if present, must contain a valid non-empty URL potentially surrounded by spaces.
src
attribute
width
attribute
[Exposed=Window] interface HTMLModelElement : HTMLElement { };
Whether a [^model^] element is exposing a user interface is not expected to affect the size of the rendering; controls are expected to be overlaid above the page content without causing any layout changes, and may disappear when the user does not need them.
When a [^model^] element represents a poster frame, the poster frame is expected to be rendered at the largest size that maintains the aspect ratio of that poster frame without being taller or wider than the [^model^] element itself, and is expected to be centered in the [^model^] element.
Additional integrations into HTML:
HTML element | Implicit ARIA semantics | ARIA roles, states and properties which MAY be used |
---|---|---|
[^model^] | TBD | TBD |
[[wai-aria-1.2]] | No corresponding role |
---|---|
MSAA + IAccessible2 |
Not mapped
|
UIA |
Not mapped
|
ATK |
Not mapped
|
AX |
Not mapped
|
Comments |
The following are some significant changes that were made since the initial proposal: