LibWeb: Change printElement() to not output unnecessary space

No functional changes.
This commit is contained in:
Jelle Raaijmakers 2025-01-25 13:40:06 +01:00 committed by Sam Atkins
commit 956d4c381b
Notes: github-actions[bot] 2025-01-25 13:17:13 +00:00
23 changed files with 73 additions and 73 deletions

View file

@ -1,5 +1,5 @@
<DIV id="one" >
<DIV id="two" >
<DIV id="two" >
<DIV id="one" >
<DIV id="one">
<DIV id="two">
<DIV id="two">
<DIV id="one">
PASS (didn't crash)

View file

@ -1,5 +1,5 @@
<DIV id="one" >
<DIV id="two" >
<DIV id="two" >
<DIV id="one" >
<DIV id="one">
<DIV id="two">
<DIV id="two">
<DIV id="one">
PASS (didn't crash)

View file

@ -1,17 +1,17 @@
<FORM >
<FORM>
document.bob === document.forms[0]: true
<BUTTON id="fred" >
<BUTTON id="fred">
img element with name 'foo' and id 'bar':
<IMG id="bar" >
<IMG id="bar">
img element with id 'baz', but no name:
baz === undefined: true
Multiple elements with name 'foo':
foos.length = 2
<IMG id="bar" >
<FORM >
<IMG id="bar">
<FORM>
obj element with name 'greg' and id 'banana':
<OBJECT id="banana" >
<OBJECT id="banana" >
<OBJECT id="banana">
<OBJECT id="banana">
goodbye greg/banana
no more greg or banana: true, true
meta tag does not match: true

View file

@ -1 +1 @@
<DIV id="target" >
<DIV id="target">

View file

@ -1 +1 @@
<DIV id="c" >
<DIV id="c">

View file

@ -1,5 +1,5 @@
Negative coordinates return null: true
Coordinates outside the viewport return null: true
<HTML id="root-element" >
<DIV id="large-box" >
<DIV id="small-box" >
<HTML id="root-element">
<DIV id="large-box">
<DIV id="small-box">

View file

@ -1,4 +1,4 @@
<DIV id="c" >
<DIV id="b" >
<DIV id="a" >
<HTML >
<DIV id="c">
<DIV id="b">
<DIV id="a">
<HTML>

View file

@ -1,11 +1,11 @@
Negative coordinates return empty array: true
Coordinates outside the viewport return empty array: true
== Elements at (500, 10) ==
<DIV id="large-box" >
<HTML >
<DIV id="large-box">
<HTML>
== Elements at (550, 60) ==
<DIV id="small-box" >
<DIV id="large-box" >
<PRE id="out" >
<BODY >
<HTML >
<DIV id="small-box">
<DIV id="large-box">
<PRE id="out">
<BODY>
<HTML>

View file

@ -1,4 +1,4 @@
document.getElementsByClassName("te st").length: 3
<DIV id="1" >
<DIV id="2" >
<DIV id="3" >
<DIV id="1">
<DIV id="2">
<DIV id="3">

View file

@ -1,5 +1,5 @@
1
<H2 >
<H2>
2
<H2 >
<H2>
2

View file

@ -2,5 +2,5 @@ Option element with no parent select returns null: true
Option element with no parent form returns null: true
Option element with no parent select returns null: true
Option element within optgroup with no parent select returns null: true
<FORM id="form3" >
<FORM id="form4" >
<FORM id="form3">
<FORM id="form4">

View file

@ -1,4 +1,4 @@
input1 keydown Tab
<INPUT id="input2" >
<INPUT id="input2">
input2 keydown Tab
<INPUT id="input1" >
<INPUT id="input1">

View file

@ -1,4 +1,4 @@
Submitter is null
<INPUT id="form-associated-button" >
<INPUT id="form-associated-button">
Exception: NotFoundError
Exception: TypeError

View file

@ -1,16 +1,16 @@
<#text >
<#text>
index: 1
<BODY >
<BODY>
---
<#text >
<#text>
index: 1
<B id="b1" >
<B id="b1">
---
<#text >
<#text>
index: 1
<DIV id="d1" >
<DIV id="d1">
---
<#text >
<#text>
index: 3
<B id="b1" >
<B id="b1">
---

View file

@ -1,2 +1,2 @@
<SPAN id="name" >
<SPAN id="value" >
<SPAN id="name">
<SPAN id="value">

View file

@ -1 +1 @@
<DIV id="box" >
<DIV id="box">

View file

@ -1,2 +1,2 @@
<P id="line-6" >
<SPAN id="line-8" >
<P id="line-6">
<SPAN id="line-8">

View file

@ -1,12 +1,12 @@
<DIV id="a1" >
<BODY >
<DIV id="a1">
<BODY>
---
<DIV id="b3" >
<DIV id="b2" >
<DIV id="b3">
<DIV id="b2">
---
<A id="c1" >
<BODY >
<A id="c1">
<BODY>
---
<I id="d2" >
<B id="d1" >
<I id="d2">
<B id="d1">
---

View file

@ -1,6 +1,6 @@
<DIV id="aa" >
<DIV id="a" >
<DIV id="bb" >
<DIV id="b" >
<DIV id="d" >
<DIV id="container" >
<DIV id="aa">
<DIV id="a">
<DIV id="bb">
<DIV id="b">
<DIV id="d">
<DIV id="container">

View file

@ -1 +1 @@
<DIV id="scroll-space-filler" >
<DIV id="scroll-space-filler">

View file

@ -34,8 +34,8 @@ function println(s) {
}
function printElement(e) {
let element_string = `<${e.nodeName} `;
if (e.id) element_string += `id="${e.id}" `;
let element_string = `<${e.nodeName}`;
if (e.id) element_string += ` id="${e.id}"`;
element_string += ">";
println(element_string);
}