mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Implement the HTMLOptionElement.form attribute
This returns the parent form of a HTMLOptionElement or null if the element has no parent form.
This commit is contained in:
committed by
Andreas Kling
parent
fe7df98d7d
commit
763b7f0e0c
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/763b7f0e0c Pull-request: https://github.com/SerenityOS/serenity/pull/24340
36
Tests/LibWeb/Text/input/HTML/HTMLOptionElement-form.html
Normal file
36
Tests/LibWeb/Text/input/HTML/HTMLOptionElement-form.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<option id="option-no-select"></option>
|
||||
<select>
|
||||
<option id="option-no-form"></option>
|
||||
</select>
|
||||
<form id="form1">
|
||||
<option id="option-within-form-no-select"></option>
|
||||
</form>
|
||||
<form id="form2">
|
||||
<optgroup>
|
||||
<option id="option-within-optgroup-no-select"></option>
|
||||
</optgroup>
|
||||
</form>
|
||||
<form id="form3">
|
||||
<select>
|
||||
<option id="option-within-select"></option>
|
||||
</select>
|
||||
</form>
|
||||
<form id="form4">
|
||||
<select>
|
||||
<optgroup>
|
||||
<option id="option-within-optgroup"></option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</form>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println(`Option element with no parent select returns null: ${document.getElementById("option-no-select").form === null}`);
|
||||
println(`Option element with no parent form returns null: ${document.getElementById("option-no-form").form === null}`);
|
||||
println(`Option element with no parent select returns null: ${document.getElementById("option-within-form-no-select").form === null}`);
|
||||
println(`Option element within optgroup with no parent select returns null: ${document.getElementById("option-within-optgroup-no-select").form === null}`);
|
||||
printElement(document.getElementById("option-within-select").form);
|
||||
printElement(document.getElementById("option-within-optgroup").form);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user