To support looking at form associated labels we'll need to update nativeTextAlternative to look for the internals.label or the internals.formAssociated properties along with the element spec. If we detect the property we then call labelText manually. Then we also update the getExplicitLabels function labelText uses to use the element from the internals.label directly if present, otherwise we continue to find it in the dom by id. This should be all that is required to allow the accessible text algorithm to handle form associated labels.
Any rules that define checks to look at implictLabel or explictLabel that affect custom input elements will not need to be updated since they already define looking at the labels to begin with. At the moment I don't think we have any such rules, but when converting rules to look at internal roles, the label rule (as well as other input like rules such as select-name) may fall under this case.
To support looking at form associated labels we'll need to update
nativeTextAlternativeto look for theinternals.labelor theinternals.formAssociatedproperties along with the element spec. If we detect the property we then calllabelTextmanually. Then we also update thegetExplicitLabelsfunctionlabelTextuses to use the element from theinternals.labeldirectly if present, otherwise we continue to find it in the dom by id. This should be all that is required to allow the accessible text algorithm to handle form associated labels.Any rules that define checks to look at
implictLabelorexplictLabelthat affect custom input elements will not need to be updated since they already define looking at the labels to begin with. At the moment I don't think we have any such rules, but when converting rules to look at internal roles, the label rule (as well as other input like rules such as select-name) may fall under this case.