まずその口火を切ったのが、Apple で WHATWG のAnne van Kesterenでした。その後の会話からすると、次の提案は Anne と Joey Arhar を含む colleagues の間で話し合われ、それを Anne が代表してここにまとめていることがわかります。
提案の内容は以下です。
Thank you for bringing this proposal to the WHATWG Joey! I thought this would be a good opportunity to outline how colleagues and I feel about extending HTML in this area. In particular, we feel that new and existing form controls:
Should look the same as the operating system controls by default.
Should be fully styleable by web developers.
Should generally attempt to follow existing HTML element patterns.
Should not be redundant with existing HTML form controls.
Should work on a wide variety of platforms, including those with very small screens, no mouse or touch, etc.
Should be fully accessible.
Should not have any l10n or i18n shortcomings.
We understand that the select element can’t address a variety of scenarios due to parser limitations, but the select element could address them in combination with the datalist element.One of our big worries with complete duplication is that we end up not solving the problems with the existing controls and that the duplicated controls will have a variety of shortcomings the older controls did not have. https://github.com/whatwg/html/issues/9799#issuecomment-1770254871
CSE の Explainer は、当初 MS 内で検討が始まりましたが、その過程の中で次のような議論が交されていました。
@mfreed7 pointed out that we’d need to deal with the fact that the custom attribute could be added/removed dynamically, which adds complexity. Parsing is particularly concerning here, since the attribute would change the parsing rules for the subtree of the <select>. Is there any scenario where a <select> could have script change it to custom when we’re in the middle of parsing its subtree?
const combobox = document.createElement("select");document.body.appendChild(combobox);combobox.addAttribute("newbehavior", "true"); // Opt in!combobox.innerHTML = '<option><img src="cat.jpg">Cat</option><option><img src="dog.jpg">Dog</option>';// Here, we have a fancy, new <select> with images of cats and dogs// https://github.com/whatwg/html/issues/5791#issuecomment-671477100
const combobox = document.createElement("select");document.body.appendChild(combobox);combobox.innerHTML = '<option><img src="cat.jpg">Cat</option><option><img src="dog.jpg">Dog</option>';combobox.addAttribute("newbehavior", "true"); // Opt in, but a little late// Boo! No images here, because we opted in after innerHTML, and the parser removed the <img> tags.// https://github.com/whatwg/html/issues/5791#issuecomment-671477100
the select element can’t address a variety of scenarios due to parser limitations, but the select element could address them in combination with the datalist element. One of our big worries with complete duplication is that we end up not solving the problems with the existing controls and that the duplicated controls will have a variety of shortcomings the older controls did not have.
Reusing the <select> element will work: <select>は CSE の実現に利用できる
We can change the parser for <select> to allow particular new child tags like <button> and <datalist>: <select>のパーサーを変更して(緩めて)、<button>や<datalist>などの新しい子要素を許可できる
We can work incrementally, first by making these parser changes in the spec etc.: まずは仕様などでパーサーの変更を行い、段階的に進めることができる
Using <datalist> as a child of <select> will work to replace the listbox with custom content: <select>の子要素として<datalist>を使用することで、listbox をカスタムコンテンツで置き換えることができる