mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibWeb: Change printElement()
to not output unnecessary space
No functional changes.
This commit is contained in:
parent
d5a82040e3
commit
956d4c381b
Notes:
github-actions[bot]
2025-01-25 13:17:13 +00:00
Author: https://github.com/gmta
Commit: 956d4c381b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3363
Reviewed-by: https://github.com/AtkinsSJ ✅
23 changed files with 73 additions and 73 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1 +1 @@
|
|||
<DIV id="target" >
|
||||
<DIV id="target">
|
||||
|
|
|
@ -1 +1 @@
|
|||
<DIV id="c" >
|
||||
<DIV id="c">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<DIV id="c" >
|
||||
<DIV id="b" >
|
||||
<DIV id="a" >
|
||||
<HTML >
|
||||
<DIV id="c">
|
||||
<DIV id="b">
|
||||
<DIV id="a">
|
||||
<HTML>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
1
|
||||
<H2 >
|
||||
<H2>
|
||||
2
|
||||
<H2 >
|
||||
<H2>
|
||||
2
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
input1 keydown Tab
|
||||
<INPUT id="input2" >
|
||||
<INPUT id="input2">
|
||||
input2 keydown Tab
|
||||
<INPUT id="input1" >
|
||||
<INPUT id="input1">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Submitter is null
|
||||
<INPUT id="form-associated-button" >
|
||||
<INPUT id="form-associated-button">
|
||||
Exception: NotFoundError
|
||||
Exception: TypeError
|
||||
|
|
|
@ -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">
|
||||
---
|
||||
|
|
|
@ -1 +1 @@
|
|||
<HTML >
|
||||
<HTML>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<HTML >
|
||||
<HTML>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<SPAN id="name" >
|
||||
<SPAN id="value" >
|
||||
<SPAN id="name">
|
||||
<SPAN id="value">
|
||||
|
|
|
@ -1 +1 @@
|
|||
<DIV id="box" >
|
||||
<DIV id="box">
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<P id="line-6" >
|
||||
<SPAN id="line-8" >
|
||||
<P id="line-6">
|
||||
<SPAN id="line-8">
|
||||
|
|
|
@ -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">
|
||||
---
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -1 +1 @@
|
|||
<DIV id="scroll-space-filler" >
|
||||
<DIV id="scroll-space-filler">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue