Bug 276590 - Make`form` (HTMLFormElement) nullable across HTML Interfaces consistently
Summary: Make`form` (HTMLFormElement) nullable across HTML Interfaces consistently
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-07-14 07:19 PDT by Ahmad Saleem
Modified: 2024-07-21 07:20 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2024-07-14 07:19:09 PDT
Hi Team,

While looking into `form` in IDL files used, it is not nullable across all.

> (HTMLTextAreaElement) https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLTextAreaElement.idl#29

Spec - https://html.spec.whatwg.org/multipage/form-elements.html#htmltextareaelement

> (HTMLOptionElement) https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLOptionElement.idl#28

Spec - https://html.spec.whatwg.org/multipage/form-elements.html#htmloptionelement

> (HTMLObjectElement) https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLObjectElement.idl#25

Spec - https://html.spec.whatwg.org/multipage/iframe-embed-object.html#htmlobjectelement

> (HTMLLegendElement) [HTMLLegendElement.idl](https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLLegendElement.idl#24)

Spec - https://html.spec.whatwg.org/multipage/form-elements.html#htmllegendelement

> (HTMLLabelElement) https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLLabelElement.idl#24

Spec - https://html.spec.whatwg.org/multipage/forms.html#htmllabelelement

> (HTMLInputElement) - https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLInputElement.idl#34

Spec - https://html.spec.whatwg.org/multipage/input.html#htmlinputelement

> (HTMLFieldsetElement) https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLFieldSetElement.idl#24

Spec - https://html.spec.whatwg.org/multipage/form-elements.html#htmlfieldsetelement

> (HTMLButtonElement) https://searchfox.org/wubkat/rev/4a199452e4f0918a290880f0698d151dee0b3009/Source/WebCore/html/HTMLInputElement.idl#34

Spec - https://html.spec.whatwg.org/multipage/form-elements.html#htmlbuttonelement

___

Just wanted to raise so we can track and fix it.

Thanks!
Comment 1 Anne van Kesteren 2024-07-15 09:38:16 PDT
So

> document.createElement("textarea").form == null

is true, so this already works well.

I suppose an ideal fix would be to fix the binding layer to not allow for returning nullptr when IDL does not allow for that. I.e., make the following in combination with HTMLTextAreaElement's current IDL not compile:

> HTMLFormElement* form() const { return m_form.get(); }
Comment 2 Radar WebKit Bug Importer 2024-07-21 07:20:15 PDT
<rdar://problem/132190558>