<selectedcontent>要素
Technical Summary
selectedcontentは、selectの先頭子button内に置き、選択中のoptionの子ノードを表示するHTML要素です。記述時の内容モデルは空で、ブラウザーが選択状態に応じて子ノードを複製・置換します。
複製対象はoptionの子ノードであり、optionのlabel属性やvalueではありません。multiple属性があるselectでは更新アルゴリズムが早期returnします。
Definition / Categories
| 項目 | 仕様上の整理 | 確認点 |
|---|---|---|
| 意味 | selectで現在選択されているoptionの内容を、selectの先頭button内に示す | 選択肢、選択状態、表示場所を別の要素・状態として扱う |
| Categories | なし | flow / phrasing / interactive contentなどのcategoryには属さない |
| Context | selectの先頭子button内 | buttonはdrop-down selectの先頭子として許可される分岐 |
| Content model | 記述時は空。ブラウザーが選択中optionの子ノードを複製する | 著者がselectedcontent内へ重複する表示内容を手書きしない |
| DOM Interface | HTMLSelectedContentElement | Element interfaceはあるが、専用のroleや表示用IDL属性を追加しない |
使用コンテキスト
customizable selectでは、selectが選択モデル・フォーム値を保持し、先頭のbuttonが閉じた状態の表示を受け持ちます。selectedcontentはそのbutton内で選択中optionの内容を表示する場所です。buttonとselectedcontentは、通常ページ上に置かれた独立した操作ボタンとして扱いません。
<label for="plan">プラン</label>
<select id="plan" name="plan">
<button>
<selectedcontent></selectedcontent>
</button>
<div>
<option value="basic"><span>基本</span></option>
<option value="pro" selected>
<span>プロ</span> <small>推奨</small>
</option>
</div>
</select>
appearance: base-selectはCSS Basic User Interface Module Level 4のスタイリング用機能です。HTMLの内容モデルとCSSの対応状況は別に評価し、実装されたブラウザー・版で表示、picker、操作を測定します。
複製と更新
HTML Standardの更新手順は、selectに複数選択のmultiple属性がある場合に何もせず戻ります。それ以外では、disabledでない子孫selectedcontentごとに、選択状態がtrueの最初のoptionを探します。該当optionがなければ内容を空にし、あればoptionの子ノードをdeep cloneして既存の子ノードと置き換えます。
| きっかけ | 仕様上の処理 | 測定上の注意 |
|---|---|---|
| 初期markupの接続 | 適切なselect内に接続された後、現在の選択から内容を更新する | HTMLパーサーの途中状態と接続後の状態を混同しない |
| 選択状態の変更 | select update notificationがdescendant selectedcontentを更新する | ユーザー操作とDOM APIによる選択変更を記録する |
| selected optionの子ノード変更 | selection更新のたびにoptionの子ノードを複製する | 子ノード編集それ自体による即時同期を仕様から推定しない |
| selectedcontentの移動 | 接続条件を再評価し、条件を満たす場合にmicrotaskで更新する | 移動・挿入・切断の個別条件と結果を測定する |
multiple select | select配下の更新処理はreturnする | validなcustomizable select構造と、WPT内の境界fixtureを区別する |
label・valueとの境界
selectedcontentはoptionの表示用labelアルゴリズムやフォーム値を複製する機能ではありません。複製アルゴリズムが読むのは、選択中optionの子ノードです。
| 情報 | 定義される場所 | selectedcontentとの関係 |
|---|---|---|
| 選択肢の表示名 | optionのlabel属性、またはoption text | label属性の文字列をselectedcontentへコピーしない |
| 表示markup | optionの子ノード | 現在の選択に応じて子ノードを複製する |
| フォーム値 | optionのvalue属性、またはoption value規則 | 複製対象ではない。フォーム送信はselect側で扱う |
| 元optionのDOM | selectのoption list内 | 複製であり移動ではないため、元の選択肢は残る |
rich optionのcontent model、label・valueの解決、datalist内optionのtext-only制約はoptionページを参照してください。
DOM Interface / disabledness
仕様のDOM interfaceはHTMLSelectedContentElementで、constructorを定義します。element自体に専用のcontent attributeやフォーム送信APIはありません。仕様内部には更新対象を制御するbooleanのdisabled stateがあり、optionまたは別のselectedcontentの子孫に入った場合などに更新を止めます。この内部stateを著者向けのdisabled属性やIDL propertyと混同しないでください。
const selectedcontent = document.querySelector('selectedcontent');
const select = selectedcontent.closest('select');
const selectedOption = select.selectedOptions[0];
selectedcontent instanceof HTMLSelectedContentElement;
selectedcontent.innerHTML;
select.value;
selectedcontent.innerHTMLはブラウザーが表示用に作った子ノードを読み取ります。アプリケーションの送信値はselect.valueから読み、表示markupを値として扱いません。
Fact / Evidence(主張 / 根拠)
仕様上の主張と実装観測を分けて記録します。WPTの版を特定できない実行結果はpartialとして扱い、ブラウザーAccessibility Treeの結果をplatform APIや支援技術の読み上げへ一般化しません。
| 種別 | Fact / 主張 | 条件・範囲 | 状態 | 根拠 |
|---|---|---|---|---|
| SPEC | selectedcontentはselectの現在選択中optionの内容を、selectの先頭button内へ表示するための要素です。 | select内のcustomizable drop-down構造。 | 確認済み | HTML Standard: selectedcontent element |
| SPEC | 更新時に選択中optionの子ノードをdeep cloneし、selectedcontentの既存内容と置き換えます。 | disabledでないselectedcontentと選択中optionがある場合。 | 確認済み | HTML Standard: update / clone algorithms |
| SPEC | optionのlabel属性はselectedcontentの複製内容に使われず、multiple selectではdescendant更新処理がreturnします。 | 選択内容表示アルゴリズム。option label/value解決は別の処理。 | 確認済み | HTML Standard: selectedcontent update |
Evidence
- HTML Standard: The selectedcontent element — definition, interface, disabledness, copying, insertion, connection, movement, and update rules
- HTML Standard: The select element — customizable select content model, option list, selection, picker, and form relationships
- HTML Standard: The option element — option content model, label, value, and selectedness
- HTML Accessibility API Mappings — platform mappings for HTML elements and attributes; it has no dedicated selectedcontent entry
- Web Platform Tests: customizable select — selectedcontent selection, mutation, nesting, insertion, and removal cases
Implementation Evidence
実装Evidenceは、確認環境、テストファイル、結果、未実施範囲を記録します。日英ページのImplementation Evidence表はdocs/atlas/evidence-registry.jsonから生成します。
| 種別 | 再現確認の範囲 | 記録する条件 | 状態 |
|---|---|---|---|
| IMPL | HTMLSelectedContentElement interface、選択中optionの子ノード複製、複製元との独立、更新とlabel境界 |
2026-10-21 / Chrome UA 155.0.0.0 / Windows NT 10.0 (Win32) / 日本語 / viewport 1280×720 / DPR 1.25。ローカルfixture build-config/yugien/research-results/selectedcontent-v1/で10/10 checks passed。interface、子ノード複製、複製元編集後の非再反映、選択変更後の反映、label属性とフォーム値の境界を確認。CSS.supports("appearance", "base-select")はtrue。記録時刻 2026-10-20T15:40:42.127Z。生成後の確認: docs/atlas/selectedcontent-evidence-2026-10-21.md Yugien / Atlasのja・en各ページがローカルHTTPで読み込め、langとh1を確認。Atlasの2ページはevidence rowを各3件表示。 |
部分観測(Chrome 155 / 1環境) |
| WPT | selectedcontent更新・入れ子・挿入・削除の選定WPT4ファイル / 24 subtests |
2026-10-21 / Chrome UA 155.0.0.0 / Windows NT 10.0 (Win32) / wpt.live。selectedcontent.html: 4 pass, 2 fail, 1 timeout, 4 not run。selectedcontent-mutations.html: 6 pass, 2 fail。selectedcontent-nested.html: 1/1 pass。selectedcontent-insertion-removal.html: 4/4 pass。計15 pass、4 fail、1 timeout、4 not run。失敗はform reset / selected再代入時の更新とparser mutation test6・test8。初回promise testはinteraction prompt後にtimeout。wpt.liveのテストcommitは取得できずrevision不明。詳細: docs/atlas/selectedcontent-evidence-2026-10-21.md実測時のテスト版は未記録です。リンク先の内容は変わることがあり、当時と同じテストで再確認できるとは限りません。 |
部分実測(4ファイル / revision不明) |
| AAM | HTML-AAM記載の有無、Chrome accessibility treeでのselect button値・picker item・selectedcontent個別node | 2026-10-21 / Chrome UA 155.0.0.0 / Windows NT 10.0 (Win32)。HTML-AAM Editor’s Draftにはselectedcontent固有のentryなし。閉じたcontrolは選択中optionのテキストをvalueに含むcollapsed pop-up buttonとして公開。pickerを開くとexpanded pop-up button、selected item、他のoptionを観測し、selectedcontent個別nodeはなし。Windows UI Automationとscreen reader読み上げは未実測。docs/atlas/selectedcontent-evidence-2026-10-21.md |
部分観測(Chrome accessibility tree) |
仕様の確認範囲と、ブラウザー、WPT、Accessibility Treeの実測範囲は別に扱います。
Coverage / Open Issues
- 仕様確認済み要素の意味、context、DOM interface、option子ノードの複製、label/value境界、multiple selectの更新境界
- 未完了複数ブラウザー・OSの挙動、複雑なoption markup、DOM mutationと移動の全条件、CSS appearanceとpicker表示
- 未完了HTML-AAMに専用mappingがない場合のplatform accessibility API、スクリーンリーダーの読み上げ・操作、WPT全範囲
このページは初期Coverageです。記録された結果は対象環境と選定テストに限られ、selectedcontent全体やすべての実装の検証完了を示しません。
Related surface
初心者向けの使い方はYugienのselectedcontentページを参照してください。選択モデルとcustomizable select全体はselectページ、表示markupとoptionのlabel/valueはoptionページ、先頭buttonのフォーム処理はbuttonページで確認できます。