Element and CharData both have a before & after function.
Also, changed the existing functions that took a Node but should take
a Node or Text, i.e append, prepend and replaceChildren. These functions, along
with the new before/after all take a new NodeOrText union.
It has more context than the env about when this should be called. Specifically
it can be called once per session, whereas, in the env, we can only call it
once per context - which could be too often.
This is driven by dom/nodes/ParentNode-querySelector-escapes.html
It seems like invalid unicode and null terminating characters should be replaced
with the replacement character (i.e. �).
Also, allow escape sequence to be at the end of the string.
For the functions I changed, I added:
```zig
const sel = p.s;
const sel_len = sel.len
```
To improve readability (`selector` can't be used because it shadows the import).
Tests went from 39/68 -> 66/68.
- Add dummy MediaQueryList and window.matchMedia
- Execute deferred scripts after non-deferred
I realize this doesn't change much, given how we currently load all scripts
after the document is parsed, but scripts _could_ depend on execution order.
- Add support for executing the `onload` attribute of <scripts>
I also cleaned up some of the Script code, i.e. removimg `unknown` kind and
simply returning a null script, and removing the EmptyBody error and returning
a null body string.
Finally, I re-enabled the microtask loop which I must have previously disabled.
A loop interval will no longer stop the loop from returning from `run`, and
no longer requires mutating event_nb on each iteration.
Re-enable microtask loop, which I accidentally stopped in a previous commit.
NamedFunction is important for displaying good error messages when there's
something wrong with the Zig structs we're trying to bind to JS. By making it
a normal struct, it's easier and cheaper to pass wherever an @compileError
might be needed.