Ladybird: Implement `past-names-map`
Minimal repro:
<form name="the_form"><input id="bar"></form>
<script>
alert(the_form.bar);
</script>
https://html.spec.whatwg.org/multipage/forms.html#past-names-map
See: https://discord.com/channels/830522505605283862/830525031720943627/1183758058426478632 ff
After #17970 was fixed, the login process is now able to start on https://world-of-dungeons.net/
But errors out directly without even sending a request with the following error:
HTMLScriptElement: Refusing to run script because the element's result is null.
Unhandled JavaScript exception: [TypeError] ToObject on null or undefined
at submit
at <unknown>
at <unknown>
No valid credentials are needed to reproduce the error.
I have minimized the problem to this:
<html>
<script>
function do_login(world) {
console.log(world)
return false
}
</script>
<form name="the_form" method="post" onsubmit="return do_login(the_form.bar.value)">
<input id="bar" type="text" name="bar">
<input type="submit" value="Log in">
</form>
It should just log your input to the console, but it does:
Unhandled JavaScript exception: [TypeError] ToObject on null or undefined
at submit
at <unknown>
at <unknown>
Failed to submit form: Unknown scheme: file
Just to be sure, using the window named property the_form works, right? and it's just the property access on the form element that fails?
Just to be sure, using the window named property
the_formworks, right? and it's just the property access on the form element that fails?
Yes.
In order for the live website to work, we also need to implement named property access on the document.
https://html.spec.whatwg.org/multipage/dom.html#dom-document-namedItem-which
This is because the website uses constructs like this:
var have_post_id = typeof document.the_form.wod_post_id != 'undefined'
to access named properties of the document.