WICG / webcomponents

Web Components specifications
Other
4.37k stars 371 forks source link

Supporting `<noscript>` when FACE is in play #1004

Open bennypowers opened 1 year ago

bennypowers commented 1 year ago

Say I have a set of FACEs

<form>
  <label>B? <b-input mood="saucy"></b-input></label>
  <b-button type="yeet">Bounce!</b-button>
  <b-button>Submit</b-button>
</form>

Currently, I believe that supporting <noscript> essentially requires the page author to include some

<noscript>
  <form>
    <label>B? <input></label>
    <button type="reset">Bounce!</button>
    <button>Submit</button>
  </form>
  <style>
   form:has(+ noscript form) { display: none; }
  </style>
</noscript>

The DSD templates for the b-* elements may or may not contain their built-in counterparts, but for the sake of this discussion, they might as well be totally custom, with contenteditable, or whatever.

I'd like to be able to 'fall back' to native behaviour for a FACE, so that it could participate in a form even with JS turned off. I have no strong opinions about how to accomplish this, it could be a bucket of attrs on the DSD template, or some global atts on the host, or some other solution.

keithamus commented 1 year ago

WCCG had their spring F2F in which this was discussed. You can read the full notes of the discussion (https://github.com/WICG/webcomponents/issues/978#issuecomment-1516897276) in which this was discussed, heading entitled "ARIA Mixin & Cross Root ARIA" as well as "ElementInternals/FACE lack of declarative / noscript" - where this issue was opened.

In the meeting, present members of WCCG reached a consensus to discuss further in breakout sessions. I'd like to call out that https://github.com/WICG/webcomponents/issues/1005 is the tracking issue for that breakout, in which this will likely be discussed.