mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb: Use a single test for loading attribute
This commit is contained in:
parent
1dda129fe1
commit
fdb4e05d7f
Notes:
sideshowbarker
2024-07-17 17:38:29 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/fdb4e05d7f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/99
6 changed files with 36 additions and 46 deletions
|
@ -1,5 +0,0 @@
|
|||
loading = eager
|
||||
|
||||
loading = lazy
|
||||
|
||||
loading = eager
|
|
@ -1,5 +0,0 @@
|
|||
loading = eager
|
||||
|
||||
loading = lazy
|
||||
|
||||
loading = eager
|
14
Tests/LibWeb/Text/expected/HTML/loading-attribute.txt
Normal file
14
Tests/LibWeb/Text/expected/HTML/loading-attribute.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
img loading initial value: eager
|
||||
img loading value after setting to "invalid": eager
|
||||
img loading value after setting to "lazy": lazy
|
||||
img loading value after setting to null: eager
|
||||
img loading value after setting to "LAZY": lazy
|
||||
img loading value after setting to "": eager
|
||||
img loading value after calling removeAttribute: eager
|
||||
iframe loading initial value: eager
|
||||
iframe loading value after setting to "invalid": eager
|
||||
iframe loading value after setting to "lazy": lazy
|
||||
iframe loading value after setting to null: eager
|
||||
iframe loading value after setting to "LAZY": lazy
|
||||
iframe loading value after setting to "": eager
|
||||
iframe loading value after calling removeAttribute: eager
|
|
@ -1,18 +0,0 @@
|
|||
<iframe id="testFrame"></iframe>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const iframe = document.getElementById('testFrame');
|
||||
|
||||
println(`loading = ${iframe.loading}`);
|
||||
println('');
|
||||
|
||||
iframe.loading = 'lazy';
|
||||
|
||||
println(`loading = ${iframe.loading}`);
|
||||
println('');
|
||||
|
||||
iframe.loading = 'invalid-value';
|
||||
println(`loading = ${iframe.loading}`);
|
||||
});
|
||||
</script>
|
|
@ -1,18 +0,0 @@
|
|||
<img id="testImg">
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const img = document.getElementById('testImg');
|
||||
|
||||
println(`loading = ${img.loading}`);
|
||||
println('');
|
||||
|
||||
img.loading = 'lazy';
|
||||
|
||||
println(`loading = ${img.loading}`);
|
||||
println('');
|
||||
|
||||
img.loading = 'invalid-value';
|
||||
println(`loading = ${img.loading}`);
|
||||
});
|
||||
</script>
|
22
Tests/LibWeb/Text/input/HTML/loading-attribute.html
Normal file
22
Tests/LibWeb/Text/input/HTML/loading-attribute.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
for (const elementName of ["img", "iframe"]) {
|
||||
const element = document.createElement(elementName);
|
||||
println(`${elementName} loading initial value: ${element.loading}`);
|
||||
element.loading = "invalid";
|
||||
println(`${elementName} loading value after setting to "invalid": ${element.loading}`);
|
||||
element.loading = "lazy";
|
||||
println(`${elementName} loading value after setting to "lazy": ${element.loading}`);
|
||||
element.loading = null;
|
||||
println(`${elementName} loading value after setting to null: ${element.loading}`);
|
||||
element.loading = "LAZY";
|
||||
println(`${elementName} loading value after setting to "LAZY": ${element.loading}`);
|
||||
element.loading = "";
|
||||
println(`${elementName} loading value after setting to "": ${element.loading}`);
|
||||
element.removeAttribute("loading");
|
||||
println(`${elementName} loading value after calling removeAttribute: ${element.loading}`);
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Reference in a new issue