mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibWeb: Test fetchPriority attribute on all elements
This commit is contained in:
parent
2fed064791
commit
1dda129fe1
Notes:
sideshowbarker
2024-07-16 22:54:10 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/1dda129fe1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/99
21
Tests/LibWeb/Text/expected/HTML/fetchPriority-attribute.txt
Normal file
21
Tests/LibWeb/Text/expected/HTML/fetchPriority-attribute.txt
Normal file
@ -0,0 +1,21 @@
|
||||
link fetchPriority initial value: auto
|
||||
link fetchPriority value after setting to "invalid": auto
|
||||
link fetchPriority value after setting to "high": high
|
||||
link fetchPriority value after setting to null: auto
|
||||
link fetchPriority value after setting to "HIGH": high
|
||||
link fetchPriority value after setting to "": auto
|
||||
link fetchPriority value after calling removeAttribute: auto
|
||||
img fetchPriority initial value: auto
|
||||
img fetchPriority value after setting to "invalid": auto
|
||||
img fetchPriority value after setting to "high": high
|
||||
img fetchPriority value after setting to null: auto
|
||||
img fetchPriority value after setting to "HIGH": high
|
||||
img fetchPriority value after setting to "": auto
|
||||
img fetchPriority value after calling removeAttribute: auto
|
||||
script fetchPriority initial value: auto
|
||||
script fetchPriority value after setting to "invalid": auto
|
||||
script fetchPriority value after setting to "high": high
|
||||
script fetchPriority value after setting to null: auto
|
||||
script fetchPriority value after setting to "HIGH": high
|
||||
script fetchPriority value after setting to "": auto
|
||||
script fetchPriority value after calling removeAttribute: auto
|
@ -1,5 +0,0 @@
|
||||
fetchPriority = auto
|
||||
|
||||
fetchPriority = high
|
||||
|
||||
fetchPriority = auto
|
22
Tests/LibWeb/Text/input/HTML/fetchPriority-attribute.html
Normal file
22
Tests/LibWeb/Text/input/HTML/fetchPriority-attribute.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
for (const elementName of ["link", "img", "script"]) {
|
||||
const element = document.createElement(elementName);
|
||||
println(`${elementName} fetchPriority initial value: ${element.fetchPriority}`);
|
||||
element.fetchPriority = "invalid";
|
||||
println(`${elementName} fetchPriority value after setting to "invalid": ${element.fetchPriority}`);
|
||||
element.fetchPriority = "high";
|
||||
println(`${elementName} fetchPriority value after setting to "high": ${element.fetchPriority}`);
|
||||
element.fetchPriority = null;
|
||||
println(`${elementName} fetchPriority value after setting to null: ${element.fetchPriority}`);
|
||||
element.fetchPriority = "HIGH";
|
||||
println(`${elementName} fetchPriority value after setting to "HIGH": ${element.fetchPriority}`);
|
||||
element.fetchPriority = "";
|
||||
println(`${elementName} fetchPriority value after setting to "": ${element.fetchPriority}`);
|
||||
element.removeAttribute("fetchPriority");
|
||||
println(`${elementName} fetchPriority value after calling removeAttribute: ${element.fetchPriority}`);
|
||||
}
|
||||
});
|
||||
</script>
|
@ -1,18 +0,0 @@
|
||||
<img id="testImg">
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const img = document.getElementById('testImg');
|
||||
|
||||
println(`fetchPriority = ${img.fetchPriority}`);
|
||||
println('');
|
||||
|
||||
img.fetchPriority = 'high';
|
||||
|
||||
println(`fetchPriority = ${img.fetchPriority}`);
|
||||
println('');
|
||||
|
||||
img.fetchPriority = 'invalid-value';
|
||||
println(`fetchPriority = ${img.fetchPriority}`);
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user