Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upForm-associated custom element behavior issues #25015
Comments
|
I'm going to map out how big the necessary changes are for this. It seems like the real-world use case of form-associated elements depends on shadow DOM somewhat, but the code needed to implement their semantics probably doesn't have any dependence on the code for shadow DOM. |
|
I see no inherent semantic connection to shadow DOM at all. ElementInternals is an essential piece, however, since it's the main API by which an element's form value is accessed. The spec defines the value as conceptually existing on the element itself, separately from having attached internals, but the API about the value lives almost entirely in ElementInternals. Here's what seems to be required, based on some spec-reading and my current understanding of Servo.
None of this seems especially hard, and if ElementInternals and the other aspects are taken as a single unit, I don't think that unit depends on any other functionality Servo is missing. Deciding where to actually store the new form-associated values is an architectural decision that might have performance consequences. There seems to be one confusing pitfall in the spec language, and anyone working on this should be alerted to it: when "the form owner" of an element "is reset", this is AFAICT a completely different concept from "reset the form owner" steps. The former is when the form is reset in the form-UI sense, and the latter is when the element becomes a child of an HTMLFormElement. |
Most of the WPT custom-elements/form-associated tests fail for lack of ElementInternals. The few that don't look questionable by https://wpt.fyi/results/custom-elements/form-associated?label=master&label=experimental&aligned ; Servo's failures are consistent with Firefox and Safari's.