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

> I obviously don't understand enough about the internals of the engines. Though I am wondering why engines e.g. have a consistent registry for CSS properties but not for HTML elements and attributes they can handle.

This is because the HTML parser allows arbitrary name / value pairs of attributes, unlike CSS where invalid props won't actually parse.

WebKit has:
1. a list of attributes it handles: https://searchfox.org/wubkat/source/Source/WebCore/html/HTMLAttributeNames.in
2. a list of tagnames it handles: https://searchfox.org/wubkat/source/Source/WebCore/html/HTMLTagNames.in

(These can go stale if one gets removed, but accidentally stay in the list)

Potentially a mix of 2 + IDL lookup could work, but then any attributes that don't have an IDL equivalent might not work (and sometimes the IDL name doesn't match the attribute name too).

> And a way to test for those features would pave the way for WPTs to test for them. And by having tests for all the different HTML features, we avoid the issue of implementations becoming outdated and push them towards introducing proper registries, so they don't have to manually maintain them.

I wouldn't fully rely on WPT to ensure this is up to date. It would really have to be something that's mandatory to update when you add a new feature.


-- 
GitHub Notification of comment by nt1m
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9746#issuecomment-1869139926 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:40:57 UTC