Skip to content

web components: add support for custom elements manifest #109

Description

@kristoff-it

Currently SuperHTML has lax validation for web components: if a - is found in an element name, then it's considered to be good and all extra validation is skipped (e.g. attribute validation).

https://github.com/webcomponents/custom-elements-manifest

The custom elements manifest is a json file that describes properties of a web component, including:

  • custom attributes allowed (if any)
  • inheritance (in case the element extends, say, a div vs p (flow vs phrasing))

This would allow us to validate both nesting and attributes for web components.

Solving this issue requires solving the following:

  • web components: implement parsing logic for the custom elements manifest file format #110
  • Change src/html/Ast.zig (and related files) to have a new dedicated Kind for web components distinct from .___. In the implementation of this new Element both attribute validation and content validation must be customized to dispatch to the right manifest file rule set based on the concrete element name (as the Kind is going to be the same for all web components).

This second task is probably best left to me, while the first one can be considered contributor friendly.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions