Go-dom is still in a very early stage. This is a brief list of supported features (which may be outdated because I forgot to update it)
Overall, the browser can parse the DOM and execute scripts, but has a very limited DOM
Do NOT expect a feature to work if not explicitly mentioned here
Go-dom supports blocking script execution; both inline, and downloaded. There is
no support for async
and defer
attributes; such scripts are still blocking.
ES modules are NOT supported yet.
See also: Script engines
Scripts are executed while during DOM construction, so only already constructed
elements are accessible. But the entire response body has already been
processed, so implementing document.write
wouldn't be possible without a
complete rewrite of the HTML parser.
Note
If you create a Window
directly, you need to pass a script engine for
scripts to execute. If you create a Browser
, a default script host will be
created.
Cookies should be supported, but is untested (there is no API to access the cookie jar)
The browser errors if the server does not respond with a 200 (window loading, not XHR requests). Redirects are not followed.
Element.outerHTML
andinnerHTML
- works, but output is not escaped.
There is no support for namespaces. While the document has a CreateElementNS
,
that is so far only implemented to prevent SVG elements from being constructed
as HTML elements. Other ...NS
functions do not exist, neither the ability to
query namespaces.
All elements have the correct class in JavaScript code, but not all element
behaviours are implemented. In general, if a type exists for an element in the
html
package, some behaviour specific to that element is implemented.
There is simple form support,
- Calling
click()
on an<input type="submit">
or<button type="submit">
submits the form. - Form submits trigger a
formdata
event, but notrequestsubmit
event. - Attributes on the submitter does not override the form's method/action
- Forms have a
submit
method, but notrequestsubmit
(requestsubmit is in dev, so maybe it exisst, but I didn't update this doc)
Clever input mechanisms are not supported, you must set the value
attribute on
the field.
Reset behaviour is not implemented!
<a>
navigates to a new pages when callingclick()
.<template>
has acontent
attribute containing a fragment where the HTML child nodes are found.
There is an XHR implementation. It doesn't support all events yet. send(body)
only accepts a FormBody
.
Fetch is not supported but you can add a polyfill to your project if you need fetch, or you could make a PR: