What Web Standards Does JSAR Comply With? A Complete Technical Reference

JSAR implements comprehensive web standards compliance including WebGL 1.0/2.0, WebXR Device API, WebAssembly, Web Workers, Web Audio API, HTML5 DOM, and Spatial CSS extensions, enabling browser-compatible code to run in headless AR environments.

The JSAR (JavaScript-based Spatial-AR Runtime) project from m-creativelab/jsar-runtime bridges standard web development practices with spatial computing platforms. Understanding what web standards JSAR complies with helps developers port existing browser applications or build new immersive experiences that run consistently across both traditional browsers and headless AR devices.

Graphics Rendering Standards

WebGL 1.0 and 2.0 Implementation

JSAR provides complete implementations of both WebGL 1.0 and WebGL 2.0 specifications through its native engine integration. The runtime exposes the full API surface including all core constants, texture formats, and WebGL 2.0-specific features such as transform feedback.

According to docs/manual/references/webgl.md, JSAR supports a curated set of Khronos extensions including EXT_color_buffer_float and OES_vertex_array_object. These extensions enable advanced rendering techniques required for high-performance spatial applications while maintaining compatibility with standard browser WebGL code.

Unified Graphics Pipeline

The runtime routes all WebGL 1.0 and 2.0 calls through a WebAssembly-compiled graphics backend. This architecture ensures deterministic performance on headless devices while maintaining the same shader programming model and API signatures that developers expect from browsers.

Immersive XR Standards

WebXR Device API Compliance

JSAR implements the complete WebXR Device API specification, enabling immersive VR and AR sessions through standardized JavaScript APIs. The runtime supports the full session lifecycle including navigator.xr.requestSession, reference space handling, and the frame loop through XRFrame callbacks.

As documented in docs/manual/references/webxr.md, JSAR provides XRWebGLLayer integration that plugs into the WebGL layer, allowing standard WebXR rendering code to function without modification. The implementation follows the exact specification sequence: requestSession → XRSession → XRFrame.

WebXR Input Sources

The runtime provides complete support for WebXR Input Sources, exposing controller and hand tracking data through XRInputSource objects. Developers can access standard events including select and squeeze, as well as hand joint data, using the same APIs available in modern browsers.

Web Platform and Compute Standards

WebAssembly Core Engine

JSAR's core engine is compiled to WebAssembly, providing a high-performance sandbox that maintains JavaScript interoperability. As detailed in docs/manual/features/webassembly.md, this implementation allows the runtime to execute computationally intensive spatial calculations while adhering to web-standard security boundaries.

Web Workers API

For off-main-thread execution, JSAR implements the standard Web Workers API. This enables heavy computation and asset loading without blocking the rendering thread, supporting dedicated workers and standard message passing patterns as documented in docs/manual/features/web-workers.md.

Web Audio API

JSAR provides the Web Audio API for audio playback and spatial audio processing. The implementation includes AudioContext, PannerNode, and spatial positioning features required for immersive AR experiences, as referenced in docs/manual/features/audio.md.

Document and Styling Standards

HTML5 DOM Implementation

JSAR implements a full DOM with HTML5 elements extended for spatial computing. The runtime supports custom elements such as <model> and <spatial> that map to the internal scene graph, allowing developers to use familiar DOM manipulation patterns while building 3D applications.

Spatial CSS Extensions

Beyond standard CSS, JSAR implements Spatial CSS extensions specifically designed for 3D and AR layouts. These extensions, documented in docs/manual/references/spatial-css.md, add properties for spatial positioning while maintaining compatibility with standard CSS syntax and the cascade.

Implementation Architecture

JSAR achieves standards compliance through a thin shim layer located in src/client/builtin_scene/ that mirrors browser globals including window, navigator, and document. This layer forwards API calls to the WebAssembly-compiled native engine while maintaining exact browser-compatible signatures.

The runtime-specific extensions, such as navigator.gl for exposing the native WebGL context, are implemented alongside standard APIs. This architecture ensures that code written for standard browsers executes identically in JSAR's headless, sandboxed environment.

Summary

  • JSAR implements WebGL 1.0 and 2.0 with full API coverage and Khronos extensions including EXT_color_buffer_float and OES_vertex_array_object, documented in docs/manual/references/webgl.md.
  • The runtime provides complete WebXR Device API support including session management, XRWebGLLayer integration, and input sources as specified in docs/manual/references/webxr.md.
  • WebAssembly, Web Workers, and Web Audio API implementations enable high-performance computing and spatial audio without blocking the main thread.
  • HTML5 DOM and Spatial CSS extensions allow developers to use standard web development patterns with custom elements like <model> and <spatial>.
  • All standards are implemented through a thin shim layer in src/client/builtin_scene/ that forwards browser-compatible APIs to a WebAssembly-compiled native engine.

Frequently Asked Questions

Does JSAR support both WebGL 1.0 and WebGL 2.0?

Yes. JSAR provides full implementations of both WebGL 1.0 and WebGL 2.0 specifications, including all core constants, texture formats, and WebGL 2.0-specific features like transform feedback. The runtime also includes a curated set of Khronos extensions such as EXT_color_buffer_float and OES_vertex_array_object that are documented in docs/manual/references/webgl.md.

Can I use standard WebXR code in JSAR without modification?

Yes. JSAR implements the WebXR Device API specification exactly, including navigator.xr.requestSession, reference spaces, XRFrame callbacks, and XRWebGLLayer integration. Code written for browsers that support WebXR will run in JSAR without changes, as the runtime mirrors the same session lifecycle and input source patterns documented in docs/manual/references/webxr.md.

How does JSAR handle Web Workers compared to browsers?

JSAR implements the standard Web Workers API for off-main-thread execution, allowing heavy computation and asset loading without blocking the rendering thread. The implementation supports dedicated workers and standard message passing patterns, operating within JSAR's headless, sandboxed environment while maintaining API compatibility with browser implementations as detailed in docs/manual/features/web-workers.md.

What CSS features does JSAR support for spatial layouts?

JSAR supports standard CSS cascading and styling plus Spatial CSS extensions specifically designed for 3D and AR layouts. These extensions, documented in docs/manual/references/spatial-css.md, add properties for spatial positioning while maintaining compatibility with standard CSS syntax. This allows developers to style custom elements like <model> and <spatial> using familiar CSS patterns adapted for immersive environments.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →