diff --git a/Tests/LibWeb/Text/expected/html-form-controls-collection.txt b/Tests/LibWeb/Text/expected/html-form-controls-collection.txt index 1fcbce521a..7440fc4ae8 100644 --- a/Tests/LibWeb/Text/expected/html-form-controls-collection.txt +++ b/Tests/LibWeb/Text/expected/html-form-controls-collection.txt @@ -1,8 +1,87 @@ HTMLFormControlsCollection +2 +------------------- +form.namedItem("formcontrol") +------------------- RadioNodeList 2 button text -null +------------------- +form.namedItem("one") +------------------- HTMLInputElement +formcontrol +button +------------------- +form.namedItem("two") +------------------- +HTMLInputElement +formcontrol text +------------------- +form.namedItem("nomatch") +------------------- +null +------------------- +form["formcontrol"] +------------------- +RadioNodeList +2 +button +text +------------------- +form["one"] +------------------- +HTMLInputElement +formcontrol +button +------------------- +form["two"] +------------------- +HTMLInputElement +formcontrol +text +------------------- +form["nomatch"] +------------------- +undefined +------------------- +form.formcontrol +------------------- +RadioNodeList +2 +button +text +------------------- +form.one +------------------- +HTMLInputElement +formcontrol +button +------------------- +form.two +------------------- +HTMLInputElement +formcontrol +text +------------------- +form.nomatch +------------------- +undefined +------------------- +form[0] +------------------- +HTMLInputElement +formcontrol +button +------------------- +form[1] +------------------- +HTMLInputElement +formcontrol +text +------------------- +form[2] +------------------- +undefined diff --git a/Tests/LibWeb/Text/input/html-form-controls-collection.html b/Tests/LibWeb/Text/input/html-form-controls-collection.html index 8e28c16c96..27d3fb0867 100644 --- a/Tests/LibWeb/Text/input/html-form-controls-collection.html +++ b/Tests/LibWeb/Text/input/html-form-controls-collection.html @@ -1,24 +1,57 @@
diff --git a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp index 42e4f2cf8e..afac7db0c6 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp @@ -77,4 +77,11 @@ Variant