Skip to content

Latest commit

 

History

History
133 lines (91 loc) · 4.89 KB

File metadata and controls

133 lines (91 loc) · 4.89 KB

Feature list

Gost-DOM is still in version 0.x and not all features are supported.

Don't hesitate to Start a discussion or Submit an issue if you need any of the features missing.

User feedback helps setting the direction and prioritising development.

Missing features described here may have been implemented. Check the linked issue if applicable.

General browser behaviour

Opening windows with isolated script context, sharing a cookie store.

Script support

The browser supports plain JavaScript, either as content in a <script> element, or <script src="">.

  • async is ignored. defer will delay script execution until the DOM has parsed.
  • <script type="module"> imports an ES module. Import maps are not supported, so any import statement in the script must be a valid href.
  • WASM is not supported.

Script runtime

  • Time does not advance by itself, e.g., for setTimeout/setCallback to execute. Test code controls the passing of time.
  • The Date object does not reflect passing of simulated time.

Supported APIs

The web specifications are grouped into different Web APIs. Of these, the following are partially implemented:

So no location API, no session storage, cookies API, etc. (Cookies work, but not exposed to JavaScript)

Note that an modular approach is envisioned for these APIs, allowing implementations to be build independently.

DOM API

  • Only supports HTML documents. No support for XML or XHTML documents, as well as namespaces.
  • Element.outerHTML and innerHTML output is not properly escaped.
  • No support for shadow DOM.
  • MutationObserver - In progress

HTML API

  • Opening a window returns an error if the server response with a non-200 status code.
  • All HTML elements have the correct class in JavaScript, but only a few have element-specific behaviour is implemented..

Note: The result can still be used when there is a bad HTTP status code. But there is no differentiation between a network error, and an HTTP status error.

Supported element types

Specific HTML elements have specific behaviour.

  • <a> Click will navigate to the resource. Fragments are not handled (i.e., a fragment link generates an HTTP request, but shouldn't)
  • <form>
    • <input>
    • <button>/<input type="submit"> When clicked inside a form, submits.
      • Overriding method and action is not implemented. #10
    • Reset behaviour is not implemented (either as a call to .reset() or clicking a reset button/input element
    • Missing validation. #30
  • <template> exposes its HTML children as children of the content attribute.

User interaction

The list of supported user interaction is quite limited.

  • HTMLElemet.click()

However, you can set value content attributes on input fields until proper keyboard typing is simulated.

URL API

  • Doesn't support object URLs #69
  • Iterating URLSearchParams doesn't iteraiting the values in the order they appear in the query string. #86

XHR API

  • XMLHttpRequest
    • Only text response is supported.
    • Not all events are emitted, e.g. progress on file upload, but file upload isn't supported at all, so ...
  • FormData
    • Doesn't support file/blob objects

Console

  • Console functions exist, but they are just the ones V8 provides. Logging can be directed back to Go code, see Getting started

History

  • Setting attributes on window.history has no effect, i.e., it doesn't navigate.

Fetch, Encoding, and Streams

This is so far very limited in capabilities. Only enough has been implemented to support some basic Datastar cases.

  • Fetch options method, headers, body, and signal are supported.

  • Only basic ReadableStream support, and no BYOB reader.