mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 15:44:45 +00:00
LibWeb: Implement the HTMLOutputElement.htmlFor attribute
This returns a DOMTokenList that reflects the `for` attribute.
This commit is contained in:
committed by
Andreas Kling
parent
acc1fa3c62
commit
3dc86747f0
20
Tests/LibWeb/Text/input/HTML/HTMLOutputElement-htmlfor.html
Normal file
20
Tests/LibWeb/Text/input/HTML/HTMLOutputElement-htmlfor.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const outputElement = document.createElement("output");
|
||||
const htmlFor = outputElement.htmlFor;
|
||||
println(`output.htmlFor is initially empty: ${htmlFor.length === 0}`);
|
||||
println(`output.htmlFor always returns the same object: ${outputElement.htmlFor === htmlFor}`);
|
||||
outputElement.htmlFor = "a";
|
||||
println(`output.htmlFor after setting output.htmlFor to "a": ${outputElement.htmlFor}`);
|
||||
println(`for attribute value after setting output.htmlFor to "a": ${outputElement.getAttribute("for")}`);
|
||||
outputElement.setAttribute("for", "b");
|
||||
println(`output.htmlFor after calling output.setAttribute("for", "b"): ${outputElement.htmlFor}`);
|
||||
outputElement.htmlFor = "c d";
|
||||
println(`output.htmlFor after setting output.htmlFor to "c d": ${outputElement.htmlFor}`);
|
||||
println(`for attribute value after setting output.htmlFor to "c d": ${outputElement.getAttribute("for")}`);
|
||||
println(`output.htmlFor.contains("c"): ${outputElement.htmlFor.contains("c")}`);
|
||||
println(`output.htmlFor.contains("a"): ${outputElement.htmlFor.contains("a")}`);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user