Skip to content

Commit

Permalink
LibWeb: Change printElement() to not output unnecessary space
Browse files Browse the repository at this point in the history
No functional changes.
  • Loading branch information
gmta committed Jan 25, 2025
1 parent d5a8204 commit 119de3c
Show file tree
Hide file tree
Showing 23 changed files with 74 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 7 additions & 7 deletions Tests/LibWeb/Text/expected/DOM/Document-named-properties.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Tests/LibWeb/Text/expected/DOM/Element-closest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<DIV id="target" >
<DIV id="target">
2 changes: 1 addition & 1 deletion Tests/LibWeb/Text/expected/DOM/Element-from-point-2.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<DIV id="c" >
<DIV id="c">
6 changes: 3 additions & 3 deletions Tests/LibWeb/Text/expected/DOM/Element-from-point.txt
Original file line number Diff line number Diff line change
@@ -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">
8 changes: 4 additions & 4 deletions Tests/LibWeb/Text/expected/DOM/Elements-from-point-2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<DIV id="c" >
<DIV id="b" >
<DIV id="a" >
<HTML >
<DIV id="c">
<DIV id="b">
<DIV id="a">
<HTML>
14 changes: 7 additions & 7 deletions Tests/LibWeb/Text/expected/DOM/Elements-from-point.txt
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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">
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1
<H2 >
<H2>
2
<H2 >
<H2>
2
4 changes: 2 additions & 2 deletions Tests/LibWeb/Text/expected/HTML/HTMLOptionElement-form.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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">
4 changes: 2 additions & 2 deletions Tests/LibWeb/Text/expected/UIEvents/KeyEvent-tab.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
input1 keydown Tab
<INPUT id="input2" >
<INPUT id="input2">
input2 keydown Tab
<INPUT id="input1" >
<INPUT id="input1">
2 changes: 1 addition & 1 deletion Tests/LibWeb/Text/expected/form-requestSubmit.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Submitter is null
<INPUT id="form-associated-button" >
<INPUT id="form-associated-button">
Exception: NotFoundError
Exception: TypeError
Original file line number Diff line number Diff line change
@@ -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">
---
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<HTML >
<HTML>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<HTML >
<HTML>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<SPAN id="name" >
<SPAN id="value" >
<SPAN id="name">
<SPAN id="value">
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<DIV id="box" >
<DIV id="box">
4 changes: 2 additions & 2 deletions Tests/LibWeb/Text/expected/hit_testing/overflow-scroll.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<P id="line-6" >
<SPAN id="line-8" >
<P id="line-6">
<SPAN id="line-8">
16 changes: 8 additions & 8 deletions Tests/LibWeb/Text/expected/hit_testing/pointer-events.txt
Original file line number Diff line number Diff line change
@@ -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">
---
Original file line number Diff line number Diff line change
@@ -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">
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<DIV id="scroll-space-filler" >
<DIV id="scroll-space-filler">
6 changes: 3 additions & 3 deletions Tests/LibWeb/Text/input/include.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function println(s) {
}

function printElement(e) {
let element_string = `<${e.nodeName} `;
if (e.id) element_string += `id="${e.id}" `;
element_string += ">";
let element_string = `<${e.nodeName}`;
if (e.id) element_string += ` id="${e.id}"`;
element_string += '>';
println(element_string);
}

Expand Down

0 comments on commit 119de3c

Please sign in to comment.