LibWeb: Generate binding for the HTMLObjectElement.form
attribute
This only required adding the appropriate definition to the IDL file, as `FormAssociatedElement` already implements the logic that we need.
This commit is contained in:
parent
6bf22075ed
commit
acc1fa3c62
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/acc1fa3c62 Pull-request: https://github.com/SerenityOS/serenity/pull/24346 Reviewed-by: https://github.com/shannonbooth ✅
3 changed files with 19 additions and 1 deletions
Tests/LibWeb/Text
Userland/Libraries/LibWeb/HTML
|
@ -0,0 +1,3 @@
|
|||
objectElement.form initial value is null: true
|
||||
objectElement.form.id after appending to #form1: form1
|
||||
objectElement.form value after removing from #form1 is null: true
|
15
Tests/LibWeb/Text/input/HTML/HTMLObjectElement-form.html
Normal file
15
Tests/LibWeb/Text/input/HTML/HTMLObjectElement-form.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const objectElement = document.createElement("object");
|
||||
println(`objectElement.form initial value is null: ${objectElement.form === null}`);
|
||||
|
||||
const formElement = document.createElement("form");
|
||||
formElement.id = "form1";
|
||||
formElement.appendChild(objectElement);
|
||||
println(`objectElement.form.id after appending to #form1: ${objectElement.form.id}`);
|
||||
formElement.removeChild(objectElement);
|
||||
println(`objectElement.form value after removing from #form1 is null: ${objectElement.form === null}`);
|
||||
});
|
||||
</script>
|
|
@ -10,7 +10,7 @@ interface HTMLObjectElement : HTMLElement {
|
|||
[CEReactions] attribute DOMString data;
|
||||
[CEReactions, Reflect] attribute DOMString type;
|
||||
[CEReactions, Reflect] attribute DOMString name;
|
||||
// FIXME: readonly attribute HTMLFormElement? form;
|
||||
readonly attribute HTMLFormElement? form;
|
||||
[CEReactions, Reflect] attribute DOMString width;
|
||||
[CEReactions, Reflect] attribute DOMString height;
|
||||
readonly attribute Document? contentDocument;
|
||||
|
|
Loading…
Add table
Reference in a new issue