Re: [csswg-drafts] [css-conditional-4] Need a way in CSS to test for support of HTML features (#9746)

@SebastianZ There is no registry for the supported CSS properties, browsers just check whether the parser accepts that. There is no promise of functional support, e.g. `@supports (gap: 1px)` doesn't imply that flex layout will use it, and `@supports (content: "+")` doesn't imply that it will work on a `::marker`.

But in this case the HTML parser accepts arbitrary elements and attributes, so it's not as easy as checking whether the parser accepts it.

> While IDL is good in regard of requiring to be updated, not all elements have an IDL associated to them, like e.g. the `<ruby>` element.

Not a big deal, the interface is `HTMLElement`, "support" for elements could be defined as getting an interface different than `HTMLUnknownElement`. Attribute "support" is trickier, since validation typically happens on IDL attributes, not content attributes.

> Here, the check aligns with the idea of "Does it parse?"

The registry idea does not align with that. And `<input type="checkbox" switch>` parses perfectly fine even without support for `switch`.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9746#issuecomment-1869140001 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 25 December 2023 22:41:16 UTC