Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat custom elements as labelable elements
This change causes the checker to consider all custom elements to be “labelable elements” per the definition of that term in the spec at https://html.spec.whatwg.org/multipage/forms.html#category-label. Without this change, the checker fails to recognize “form-associated custom elements” with valid id attributes as labelable elements, and so ends up reporting false positives for any “label” elements in a document that reference the id attribute of a custom element. This change isn’t completely conforming to the spec because it effectively doesn’t distinguish between custom elements that aren’t “form-associated custom elements” defined in the spec at https://html.spec.whatwg.org/custom-elements.html#form-associated-custom-element and custom elements that are true “form-associated custom elements”. The problem with trying to conform to that spec requirement to only treat form-associated custom elements as labelable — but not other custom elements — is that it necessitates executing the document’s JavaScript and using DOM APIs to examine the document. But in the checker architecture, that’s not possible — the checker doesn’t execute JavaScript and can’t use DOM APIs to inspect documents. Fixes #963
- Loading branch information
1 parent
ab3fcba
commit 325ab52
Showing
2 changed files
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters