type
にまつわる余談
①新しいtype
属性が提案されていた・いる
type="share"
(未採択)
Web Share API
のボタン
type="selectlist"
(未採択)
要素内でリストボックスを開くためのボタンのため
type="press"
(提案中)
押下されている状態を表現
Slide 31
Slide 31 text
type
にまつわる余談
②type
属性のデフォルト値を変えたい!
Investigate making the invalid state of not submit · Issue #10462 · whatwg/html
type
が無効値のときにsubmit
扱いになる現在仕様を見直す提案が議論されている
互換性リスクや既存サイトへの影響が大きく、仕様変更には慎重な検討が必要とさ
れている
代替案として、仕様の明確化やlint
的な警告など、破壊的変更を避ける方向性も示さ
れている
ARIA Authoring Practices Guide
Button
"A button is a widget that enables users to trigger an action or event, such as submitting a form,
opening a dialog, canceling an action, or performing a delete operation."
(ボタンは、フォーム送信、ダイアログを開く、アクションのキャンセル、削除操作など、アク
ションやイベントをトリガーするウィジェットです)
Link
"A link widget provides an interactive reference to a resource. The target resource can be either
external or local."
(リンクは、リソースへの対話的な参照を提供します。対象リソースは外部でもローカルでも構
いません)
キーボード操作
Button
Space : Activates the button.
Enter : Activates the button.
Link
Enter : Executes the link and moves focus to the link target.
Shift + F10 (Optional): Opens a context menu for the link.
2.1.1
キーボード (
レベル A)
達成基準
コンテンツのすべての機能は、個々のキーストロークに特定のタイミングを要することなく、キ
ーボードインタフェースを通じて操作可能である。
他にも
Enter
や
Space
でアクションさせる挙動も必要
Enter
はkeydown
で発火し、押しっぱなしだと連続で発火する
Space
はkeyup
で発火するが、押しっぱなしのまま
Tab
でフォーカス移動すると発
火しない
ダイアログを開く
Slide 50
Slide 50 text
ガイドラインから学ぶ鉄則
Using ARIA
If you can use a native HTML element or attribute with the semantics and behavior you require
already built in, instead of re-purposing an element and adding an ARIA role, state or property to
make it accessible, then do so.
(必要なセマンティクスと振る舞いを持つネイティブHTML
要素が使えるなら、ARIA
で無理やり
作るのではなく、それを使ってください)
ARIA Authoring Practices Guide
No ARIA is better than Bad ARIA
(悪いARIA
より、ARIA
を使わない方がマシである)