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