From 851114e4624f2d3d958ece837a206495ae31a713 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 1 Apr 2024 08:46:40 +0200 Subject: [PATCH] LibWeb/Tests: Add a basic set of tests for document.all --- .../expected/HTML/HTMLAllCollection-basic.txt | 33 ++++++++++++ .../input/HTML/HTMLAllCollection-basic.html | 54 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/HTML/HTMLAllCollection-basic.txt create mode 100644 Tests/LibWeb/Text/input/HTML/HTMLAllCollection-basic.html diff --git a/Tests/LibWeb/Text/expected/HTML/HTMLAllCollection-basic.txt b/Tests/LibWeb/Text/expected/HTML/HTMLAllCollection-basic.txt new file mode 100644 index 00000000000..60acae0fc20 --- /dev/null +++ b/Tests/LibWeb/Text/expected/HTML/HTMLAllCollection-basic.txt @@ -0,0 +1,33 @@ + HTMLAllCollection +typeof document.all = undefined +equal to undefined = true +equal to null = true +strictly equal to undefined = false +strictly equal to null = false +is an html collection = true +length = 9 +out of range (9) = undefined +out of range (-1) = undefined +item #0 = [object HTMLHtmlElement], id = '', name = 'undefined' +item #1 = [object HTMLHeadElement], id = '', name = 'undefined' +item #2 = [object HTMLBodyElement], id = '', name = 'undefined' +item #3 = [object HTMLFormElement], id = '', name = '' +item #4 = [object HTMLInputElement], id = 'formcontrol', name = 'one' +item #5 = [object HTMLInputElement], id = 'formcontrol', name = 'two' +item #6 = [object HTMLScriptElement], id = '', name = 'undefined' +item #7 = [object HTMLScriptElement], id = '', name = 'undefined' +item #8 = [object HTMLPreElement], id = 'out', name = 'undefined' +From good string index = [object HTMLInputElement], name = one +From bad string index = undefined +[object HTMLInputElement], name one +[object HTMLInputElement], name two +undefined +[object HTMLCollection], length = 2 +first = [object HTMLInputElement] +second = [object HTMLInputElement] +namedItem('one') = [object HTMLInputElement] +namedItem('1') = null +namedItem('not in list') = null +item() = null +item('1') = [object HTMLHeadElement] +namedItem(2) = [object HTMLBodyElement] diff --git a/Tests/LibWeb/Text/input/HTML/HTMLAllCollection-basic.html b/Tests/LibWeb/Text/input/HTML/HTMLAllCollection-basic.html new file mode 100644 index 00000000000..bf1b7c77c0c --- /dev/null +++ b/Tests/LibWeb/Text/input/HTML/HTMLAllCollection-basic.html @@ -0,0 +1,54 @@ +
+ + +
+ + +