1. 序論
◎非規範的各~UAは、 長い間,~form~controlの~style法として標準でない仕方を供していた。 しかしながら、 これらすべての~controlは,各~UAにまたがって一貫するよう実装されていないため、 作者にとって不必要な対立を~~招いていた。 ◎ User agents have long provided non-standard ways of styling form controls. However, all of these controls are implemented inconsistently across user agents, creating unnecessary friction for authors.
この~moduleは: ◎ This module\
- ~form~controlを成す各部を相互運用可能に利用できるまでに十分~詳細に定義することを目指す。 ◎ aims to define a set of form control parts in enough detail that they can be used interoperably.
- ~form~controlを~custom化する新たな仕方も定義する。 それは、 共通的な利用事例 — 以前は,~custom~controlを一から実装することでしかアリでなかった、 たくさんの作業を要し, 的確に実装することが難しく, [ ~accessibility/~platform規約 ]を非互換化することが多かった利用事例 — を受持つ。 ◎ It also defines some new ways of customizing form controls, covering common use cases that were previously only possible by implementing custom controls from scratch, which was a lot of work, hard to get right, and often broke either accessibility or platform conventions.
2. `基本的な外観$を~~任意で入れる `appearance^p 用の値
`appearance$p の定義をここへ移動する。 ◎ Move definition of appearance here.
◎名 `appearance$p ◎新値 `base^v ◎表終`base@v は、 ~form~controlに適用されたときは,当の~controlの状態を `基本的な外観@ を有するようになる。 ◎ When applied on a form control, base puts that control in the basic appearance state.
`基本的な外観$を有する~controlは、[ 標準な~CSS, 以下に定義される疑似要素 ]を利用して一貫して~style可能になり, 各~UAにまたがって一貫するかつ上書き可能な既定の~styleが適用される。 ~UAは、 この状態にある~controlに対しては, `§ 基本的な外観~用の~UA~stylesheet@#basic-appearance-stylesheet$ からの~styleを適用する。 ◎ A control that has basic appearance is consistently styleable using standard CSS and the pseudo-elements defined below, and applies overridable default styles that are consistent across UAs. When a control is in that state, the user agent applies styles from the Appendix A: Basic Appearance User Agent Stylesheet to that control.
~UAは、
`§ 疑似要素@#pseudo-elements$
により定義される各種~疑似要素も可能化するモノトスル。
これらの疑似要素( `picker()$pe は除外する)は、
常に,その`出自の要素$から `appearance$p を継承する。
~UAは、
宣言
`appearance^p: `inherit^v !important
を利用して,これを実装してもヨイ。
◎
The user agent must also enable the pseudo-elements defined by § 4 Pseudo-Elements. These pseudo-elements (excluding ::picker()) always inherit appearance from their originating element. The user agent may implement this using an appearance: inherit !important declaration.
注記: この継承は、 作者が同じ~control用に[ ~nativeな各部, ~nativeでない各部 ]を混合することを防止する。 ◎ NOTE: The inheritance prevents authors from mixing native and non-native parts for the same control.
2.1. `基本的な外観$用の設計-原則
~form~control用の`基本的な外観$を与える~stylesheetの設計には、 概ね重要度が高いものから順に,次に挙げる設計-原則が適用される: ◎ The following design principles apply to the design of the basic appearance stylesheet for form controls, in approximate order of descending importance:
- 各~UAにわたって,それらの~styleは一致する。 ◎ The styles are identical in every user agent.
- 各種~controlは、 追加的な~styleを要することなく,それ自体で認識-可能かつ利用-可能である。 ◎ The controls are recognizable and usable on their own without additional styles.
- 各種~controlは、 `WCAG 2.2 AA 標準@~TR/WCAG22/$ に全部的に合格する。 ◎ The controls pass 100% of WCAG 2.2 AA standards.
-
各~controlにまたがって,~styleは次において一貫する: ◎ The styles are consistent across controls…
- 見かけと感触 ◎ …in look & feel.
- それらが~code内でどう定義されるか ◎ …in how they are defined in code.
- ~sizingとヤリトリ ◎ …in sizing and interaction.
-
~styleは、 複階的な再設定~stylesheetを必要とせずに, ~web~siteの~brand法に容易に順応する — それらは: ◎ The styles are easily adapted to the website’s branding, without needing complex reset stylesheets:
- 最小限な~codeを利用し,容易に上書きできる。 ◎ They use minimal code and are easy to override.
- 自前の強い~~独自性( `voice & tone^en )を有さず,アリな限り視覚的に単純である。 ◎ They do not have a strong voice & tone of their own, and are visually as simple as possible.
- アリなときは、 新たな~styleを定義することなく,~pageの~styleを継承する。 ◎ They inherit page styles rather than define new styles whenever possible.
- [ 自身/それが置かれる文脈 ]が変化することによる調整に対し,~~耐性がある( `resilient^en である)。 (前者の例: 自身の[ ~font/~border/~layout ]が変化したとき) (後者の例:[ `~flex容器$や`格子~容器$ ]における子として準備済みである) ◎ They are resilient to adjustments… • …when changed themselves (e.g. changing font, border, layout). • …when put in context (e.g. ready to be flex or grid children).
-
包括的である: ◎ They are comprehensive:
- 各~control用のすべての状態を受持っている。 ◎ Covering all states for each control.
- すべての`書字~mode$を~supportしている。 ◎ Supporting all writing modes\
- すべての`色~scheme$を~supportしている。 ◎ and color schemes.
特定的に,~HTML~form~control用には、 これらの原則は,要求される~UA~stylesheet — `§ 基本的な外観~用の~UA~stylesheet@#basic-appearance-stylesheet$ にて定義されるそれ — を通して適用される。 ◎ For HTML form controls specifically, these principles are applied through the required user agent stylesheet defined in Appendix A: Basic Appearance User Agent Stylesheet.
2.2. 例
これらの例を~UA~stylesheetに対する[ 実装, 試験結果, 意見交換, 改善 ]を通して精緻化する。 ◎ Refine these examples through implementation, experimentation, bikeshedding and improvements to the user agent stylesheet.
これらの例の主な目的は、 実施において, `基本的な外観$用の設計-原則がどう適用されるかを示すことにある。 ◎ The main purpose of these examples is to show how the design principles for the basic appearance apply in practice.
個々の~controlに対し,`基本的な外観$を適用するためには、 次の~codeが利用される: ◎ To apply the basic appearance on individual controls, the following code is used:
input, textarea, meter, progress, button, select { appearance: base; }
注記: 以下に挙げる例により利用される~form~layoutは、 詳細なものでない。 ◎ NOTE: The form layout used by the following examples is not detailed.
2.2.1. 既定の~UA色
`基本的な外観$が根~要素から継承する既定の[ 明な~mode, 暗な~mode ]の色は、 順に: ◎ Here are the basic appearance colors inheriting respectively the default light and dark mode colors from the root element:
明な色~schemeの下での基本的な外観が成す~screenshot ◎ Screenshot of the basic appearance with a light color scheme
暗な色~schemeの下での基本的な外観が成す~screenshot ◎ Screenshot of the basic appearance with a dark color scheme
2.2.2. 色や~fontの~custom化
`基本的な外観$の上層にて行われる~custom化を次の例に示す: ◎ Here are some examples of customization being done on top of the basic appearance:
form { font-family: "American Typewriter"; background-color: rgb(254, 252, 221); color: rgb(131, 17, 0); } input, textarea, meter, progress, button, select { appearance: base; }
[ ~brownな~text, 淡い~yellowな背景 ]で~custom化された基本的な外観の~screenshot ◎ Screenshot of a customized basic appearance with brown text and a pale yellow background
form { font-family: "Courier New"; font-size: 14px; background-color: rgb(0, 0, 0); color: rgb(0, 249, 0); } input, textarea, meter, progress, button, select { appearance: base; }
[ ~greenな~text, ~blackな背景 ]で~custom化された基本的な外観の~screenshot ◎ Screenshot of a customized basic appearance with green text and a black background
3. ~pickerの~style法
3.1. `picker()^pe 疑似要素
`picker()@pe 疑似要素は、 ~form~controlを成す[ ~pageから飛び出る部分 ]を表現する。 ◎ The ::picker() pseudo-element represents the part of the form control that pops out of the page.
::picker() = ::picker( `form-control-identifier$t+ ) `form-control-identifier@t = select
`picker()$pe 疑似要素は、 その`出自の要素$が ~AND↓ を満たすときに限り,合致するモノトスル: ◎ The ::picker() pseudo-element only matches when\
- `基本的な外観$を~supportする ◎ the originating element supports basic appearance\
- ~popupする~pickerを有する ◎ and has a popup picker.\
- その `一意な~picker名@ は、 指定された `form-control-identifier$t に合致する。 例えば、 `select$e 要素~用の`一意な~picker名$は `select^v になる。 ◎ The specified <form-control-identifier> must also match the unique picker name of the originating element. For example, the unique picker name for the select element is select.
`picker()$pe 疑似要素は、 次が満たされる場合に限り, 具現化するモノトスル ⇒ [ 自身, その`出自の要素$ ]の `appearance$p の`算出d値$は、 どちらも `base$v になる。 ◎ In order for the ::picker() pseudo-element to be rendered, it and its originating element must both have a computed appearance of base.
次の~styleは、 `select$e および `select^v 【を`一意な~picker名$に伴う】~picker ]に対し`基本的な外観$を適用することに加え, 後者の~pickerに追加的な~style付けを追加する: ◎ The following styles apply the basic appearance to the select picker and the select and add some additional styling to the picker:
select, select::picker(select) { appearance: base; } select::picker(select) { border: 5px solid red; background-color: blue; }
注記: `picker()$pe の関数形でない形 `picker^pe は、[ 新たな~pickerが~supportされるに伴い,それらに意図されない~styleが適用される ]ことを防止するため,現時点では働かない。 すべての~form~controlに対する~picker用の~style付けが完結したなら、 関数形でない形は,すべての~picker用に働くことになる。 ◎ NOTE: The non-functional form of ::picker() currently doesn’t work to prevent unintended styling of pickers as new pickers become supported. Once styling for all form control pickers is finalized, this non-functional form will work for all pickers.
4. 疑似要素
~form~controlは, 多くの部分から構成され、 作者は,それらを別々に~styleするよう求めることもある。 よって、 ~UAは,個々の~form~control用に疑似要素たちを供する必要がある。 ◎ Form controls are composed of many parts that authors may want to style separately, hence the need for user agents to provide pseudo-elements for individual form controls.
以下の各節で導入する一群の疑似要素は、 ほとんどの共通的な利用事例を — 各~UAにわたって一貫する方式で取組めるよう — 受持つことを試みる。 ◎ The section below introduces a set of pseudo-elements that attempts to cover the most common use cases, so they can be addressed in a consistent manner across user agents.
~control | 疑似要素 |
---|---|
`progress$e |
【† `switch^a 属性を伴う~checkboxは、 `まだ仕様~化されてない@~HTMLissue/4180$。 】 |
`meter$e | |
`input type=checkbox switch^e† | |
`input type=range@~HEinput#range-state-(type=range)$e | |
`input type=checkbox@~HEinput#checkbox-state-(type=checkbox)$e | `checkmark$pe |
`input type=radio@~HEinput#radio-button-state-(type=radio)$e | |
`input type=file@~HEinput#file-upload-state-(type=file)$e | `file-selector-button$pe |
`input type=date@~HEinput#date-state-(type=date)$e |
次に挙げるもの(正確な構造は~localeに依存する):
`§ 日時~入力~field用の各部の~style法@#date-time-pseudos$ を見よ。 |
`input type=datetime-local@~HEinput#local-date-and-time-state-(type=datetime-local)$e | |
`input type=time@~HEinput#time-state-(type=time)$e | |
`input type=month@~HEinput#month-state-(type=month)$e | |
`input type=week@~HEinput#week-state-(type=week)$e | |
`input@~HEinput#text-(type=text)-state-and-search-state-(type=search)$e ( `type^a 属性なし) | `§ ~text~field用の各部の~style法@#field-pseudos$ を見よ。 |
`input type=text@~HEinput#text-(type=text)-state-and-search-state-(type=search)$e | |
`input type=search@~HEinput#text-(type=text)-state-and-search-state-(type=search)$e | |
`input type=email@~HEinput#email-state-(type=email)$e | |
`input type=password@~HEinput#password-state-(type=password)$e | |
`input type=tel@~HEinput#telephone-state-(type=tel)$e | |
`input type=url@~HEinput#url-state-(type=url)$e | |
`input type=number@~HEinput#number-state-(type=number)$e | `§ 数値~field用の各部の~style法@#number-pseudos$ を見よ。 |
`input type=color@~HEinput#color-state-(type=color)$e | `color-swatch$pe |
`textarea$e | § `textarea^e 用の各部の~style法を見よ |
`select$e | `picker-icon$pe |
`option$e | `checkmark$pe |
`button$e | 【ここには述べられていない。】 |
`input type=submit@~HEinput#submit-button-state-(type=submit)$e | |
`input type=reset@~HEinput#reset-button-state-(type=reset)$e | |
`input type=button@~HEinput#button-state-(type=button)$e | |
`input type=image@~HEinput#image-button-state-(type=image)$e |
説明図を追加する。 ◎ Add illustrations.
4.1. ~picker【!~opener】~icon: `picker-icon^pe 疑似要素
`picker-icon@pe 疑似要素は、 当の~controlを成す[ ~pickerが在ることを表す~iconが占める部分 ]を表現する。 この疑似要素は: ◎ The ::picker-icon pseudo-element represents the part of the control that represents the icon denoting the presence of the picker.\
-
次が満たされるときに限り,生成される ⇒ [ その`出自の要素$は`基本的な外観$を有する ]~AND[ それ†は,ある~pickerを開く ]
【† 当の疑似要素, 出自の要素どちらなのか,はっきりしない (~iconは、 単に “~pickerが在ることを表す” だけで,~pickerを開くものは他の何かかもしれない)。 】
◎ It is only generated when the originating element has basic appearance and if it opens a picker.\ - `全部的に~style可能な疑似要素$であり, `出自の要素$から~styleを継承する。 ◎ It is a fully styleable pseudo-element and inherits from its originating element.
- その`出自の要素$の子であったかのように~boxを生成する — 【`出自の要素$の】 `after$pe 疑似要素が生成する~boxより後に。 ◎ ::picker-icon generates a box as if it was an child of its originating element, after any boxes generated by the ::after pseudo-element,\
- `content$p ~propにより指定されたとおりの内容を伴う。 ◎ with content as specified by content.
4.3. ~checkmarkの~style法: `checkmark^pe 疑似要素
`checkmark@pe 疑似要素は: ◎ The ::checkmark pseudo-element\
- [ 当の~itemは~checkされたか否か ]を表す指示子を表現する。 ◎ represents an indicator of whether the item is checked,\
-
その`出自の要素$ — 以下 %要素 — が ~AND↓ を満たすときに限り生成される:
-
`checked$ps 疑似類を~supportする
特に、 次に挙げるものは,該当する ⇒# ~checkbox, ~radio, `option$e 【!option】要素
- 自身または ある先祖は`基本的な外観$を有する
-
- `全部的に~style可能な疑似要素$であり, %要素 から【~styleを】継承する。 ◎ It is a fully styleable pseudo-element and inherits from its originating element.
- `content$p ~propにより指定されたとおりの内容を伴う。 ◎ ↓
-
%要素 の子であったかのように~boxを生成する — この~boxは:
- %要素 は[ ~checkbox, ~radio ]である場合、 【 %要素 の】[ `before$pe, `after$pe ]疑似要素が生成する~boxの合間にある
- %要素 は `option$e 【!~option】要素である場合、 【 %要素 の】 `before$pe 疑似要素が生成する~boxに先行する。
次の例は、 ~checkmarkの背景~画像を変更する: ◎ The following example changes the background image of a checkmark:
::checkmark { background-image: url(...) }
`indeterminate$ps と組合せて利用すれば、 不定~状態にある~checkmarkも~styleできる: ◎ It may also be used in combination with :indeterminate to style the indeterminate checkmark:
:indeterminate::checkmark { background-image: url(...) }
4.4. ~sliderの様な~controlを成す各部の~style法: `slider-thumb^pe, `slider-track^pe, `slider-fill^pe 疑似要素
`~sliderの様な~control@ とは、 利用者【または作者†】が調整-可能な進捗を表現する~form~controlである。 ◎ Slider-like controls are form controls that represent progress. That progress may be adjustable by the user.
【† 該当するものとして以下に挙げられる[ `progress$e, `meter$e ]要素においては、 “利用者” とは,作者(~scriptの利用者)を指すであろう。 】
それを成す各部には、 次に挙げる疑似要素が供される: ◎ The following pseudo-elements are provided to style their different parts:
- `slider-thumb@pe
- この疑似要素は、[ 当の~controlの進捗を調整する ]ことを[ 利用者に許容する部位 ]を表現する。 ◎ The ::slider-thumb pseudo-element represents the portion that allows the user to adjust the progress of the control.
- 注記: ほとんどの~UAにおいては、 概して,~nativeには円として具現化される。 ◎ NOTE: It is typically natively rendered as a circle in most user agents.
- `slider-track@pe
- この疑似要素は、 当の~controlを成す[ 進捗-済みな部位, 進捗-済みでない部位 ]【!を包含している部位】を表現する。 ◎ The ::slider-track pseudo-element represents the portion containing both the progressed and unprogressed portions of the control.
- `slider-fill@pe
- この疑似要素は、 当の~controlを成す進捗-済みな部位【!を包含している部位】を表現する。 ◎ The ::slider-fill pseudo-element represents the portion containing the progressed portion of the control.
- 当の~controlの進捗は不定である場合 (例: 【 `value^a 属性が省略された】 `progress$e 要素)、 ~UAは,この部位の`行内~size$を 0 にするモノトスル。 ◎ When the progress of control is indeterminate (like with <progress>), the user agent must give this portion an inline-size of zero.
これらの疑似要素は、 `全部的に~style可能な疑似要素$である — その構造は: ◎ These pseudo-elements are fully styleable pseudo-elements and their structure is the following:
- `slider-track^pe
- `slider-fill^pe
- `slider-thumb^pe
何が`~sliderの様な~control$を成すかは、 ~host言語に依存する。 ~HTMLにおいては、 次に挙げる要素に対応する: ◎ The list of slider-like controls depends on the host language. For HTML, this corresponds to:
- `progress$e ◎ progress
- `meter$e ◎ meter
- `input$e 要素のうち `type="range"^a を伴うもの ◎ input elements with type="range"
- `input$e 要素のうち `type="checkbox" switch^a を伴うもの ◎ input elements with type="checkbox" switch
4.5. ~text~field用の各部の~style法: `field-text^pe, `clear-icon^pe 疑似要素
`input$e 要素においては: ◎ ↓
- `placeholder@pe
- この疑似要素は、 当の要素を成す[ 仮入力~textを包含する部位 ]を表現する。 ◎ The ::placeholder pseudo-element represents the portion of the input that contains the placeholder text.
- `field-text@pe
- この疑似要素は、 当の要素を成す[ 編集-可能な~textを包含する部位 ]を表現する。 ◎ The ::field-text pseudo-element represents the portion of the input that contains the editable text.
- `clear-icon@pe
- この疑似要素は、 当の要素を成す[ ~clickされたとき,当の要素の値を~clearすることを利用者に許容する部位 ]を表現する — ~UAが,そのような部位を供するならば。 ◎ The ::clear-icon pseudo-element represents the portion of the input that allows the user to clear the input when clicked if provided by the user agent.
- `appearance$p が `textfield^v をとる下では、 ~UAは,この部分を生成しないモノトスル。 ◎ With appearance: textfield, the user agent must not generate this part.
[ `field-text$pe, `clear-icon$pe ]は、 互いに同胞になるモノトスル。 ◎ ::field-text and ::clear-icon must be siblings.
~autofillにより利用される各部†を収集する。 ◎ Collect parts used by autofill.
【† おそらく、 `HTML$r の`~autofill~keyword@~HTMLautofill#autofill-field$にて述べられる “下位~部分” に対応する各部を指す。 】
`input type=password^e の可視性を~toggleするための何かを,それを実装している~UA用に定義するか? `11845$issue ◎ Define something for the password visibility toggle for user agents implementing it? [Issue #11845]
`placeholder^pe と `field-text^pe がどう相互作用するかを定義する。 `11844$issue ◎ Define how ::placeholder interacts with ::field-text. [Issue #11844]
4.6. `textarea^e 用の各部の~style法: `placeholder^pe, `field-text^pe 疑似要素
`textarea$e 要素においては: ◎ ↓
- `placeholder$pe
- この疑似要素は、 当の要素を成す[ 仮入力~textを包含する部位 ]を表現する。 ◎ The ::placeholder pseudo-element represents the portion of the textarea that contains the placeholder text.
- `field-text$pe
- この疑似要素は、 当の要素を成す[ 編集-可能な~textを包含する部位 ]を表現する。 ◎ The ::field-text pseudo-element represents the portion of the textarea that contains the editable text.
~resize器~用の何かを定義する。 `11850$issue ◎ Define something for the resizer. [Issue #11850]
`placeholder^pe と `field-text^pe がどう相互作用するか定義する。 `11844$issue ◎ Define how ::placeholder interacts with ::field-text. [Issue #11844]
4.7. 数値~field用の各部の~style法: `step-control^pe, `step-up^pe, `step-down^pe 疑似要素
次に挙げる疑似要素は、 数値~入力~用に供される。 いずれも,`全部的に~style可能な疑似要素$である。 ◎ These pseudo-elements are provided for number inputs. They are fully styleable pseudo-elements.
- `step-control@pe
- この疑似要素は、 数値~入力を成す[ 増~button, 減~buttonを包含する部位 ]を表現する。 ◎ The ::step-control pseudo-element represents the portion of a number input that contains the up and down buttons.
- `step-up@pe
- この疑似要素は、[ 作動化されたとき,数値~入力の内側にある値を増分する~button ]を表現する。 ◎ The ::step-up pseudo-element represents the button that increments the value inside a number input when activated.
- `step-down@pe
- この疑似要素は、[ 作動化されたとき,数値~入力の内側にある値を減分する~button ]を表現する。 ◎ The ::step-down pseudo-element represents the button that decrements the value inside a number input when activated.
その構造は、 次に従うものと定義される: ◎ Their structure is defined as follows:
- `field-text^pe
- `step-control^pe
- `step-up^pe
- `step-down^pe
次の~controlは: ◎ The following control:
<input type="number">
次の様に~styleし直せる: ◎ can be re-styled like this:
+ %現在の値 - ◎ [ + 2 - ]
本物の画像を挿入する。 ◎ Insert real image.
— 次の~styleを利用して: ◎ using the following styles:
input[type=number] { appearance: base; &::step-control { display: contents; } &::step-up { order: 1; content: "+"; } &::field-text { order: 2; } &::step-down { order: 3; content: "-"; } }
`appearance$p が `textfield^v をとる場合、 ~UAは,この部分を生成しないモノトスル。 ◎ With appearance: textfield, the user agent must not generate this part.
4.8. 日時~入力~field用の各部の~style法: `field-component^pe, `field-separator^pe 疑似要素
- `field-component@pe
- この疑似要素は、 当の~controlを成す[ 日時を成す各~成分の値を包含する部位 ]を表現する。 ◎ The ::field-component pseudo-element represents the portions of the control that contain the date/time component values.
- `field-separator@pe
- この疑似要素は、 当の~controlを成す[ 日時を成す各~成分どうしを分離する部位 ]を表現する — ~UAが,そのような部位を供するならば。 ◎ The ::field-separator pseudo-element represents the portions of the control that separate the date/time component values if the user agent provides those portions.
これらの疑似要素は、 互いに同胞である。 当の~controlを成す正確な構造は、[ 国際-化, ~host言語 ]により決定されるが, 各~UAにまたがって一貫するモノトスル。 ◎ Those pseudo-elements are siblings. The exact structure of the control is determined by internationalization and by the host language, but must be consistent across user-agents.
次の~controlは: ◎ The following control:
<input type="date">
~US~localeにおいては、 次の様に具現化され得る: ◎ may render like this in US locales:
08 / 22 / 2024 [v] ◎ [ 08 / 22 / 2024 [v]]
本物の画像を挿入する。 ◎ Insert real image.
結果の~treeは: ◎ The resulting tree is:
- `field-component^pe (08)
- `field-separator^pe (/)
- `field-component^pe (22)
- `field-separator^pe (/)
- `field-component^pe (2024)
4.9. 色見本: `color-swatch^pe 疑似要素
`color-swatch@pe 疑似要素は、 当の~controlを成す[ 選ばれた色~値を表示する部位 ]を表現する。 ◎ The ::color-swatch pseudo-element represents the portion of the control that displays the chosen color value.
例えば,次の~style【!例】は、 当の入力と その色見本を丸くするべきである: ◎ For example, the following example should make the input and its color swatch rounded:
input[type=color], ::color-swatch { border-radius: 100%; }
4.10. ~vendor疑似要素~拡張との互換性
~UAは、 標準でない疑似要素を: ◎ ↓
- アリなときは、 別名-法を利用して実装するベキである。 ◎ When possible, the user agent should use aliasing to implement any non-standard pseudo-elements.
- アリでないときは、 `appearance$p の値に応じて ⇒# `base^v 用には標準な疑似要素を予約するモノトスル。 `none^v 用には標準でない疑似要素を利用するモノトスル。 ◎ When not possible, the user agent must reserve the standard pseudo-elements for appearance: base and use any non-standard ones for appearance: none.
5. 疑似類
5.1. 各種 `meter^e 状態の~target法: `low-value^ps, `high-value^ps, `optimal-value^ps 疑似類
これが~UA~logicを~~再現可能になることを~~確保する。 `11336$issue ◎ Make sure this is able to replicate UA logic. [Issue #11336]
これらを~HTMLの定義へ~linkする。 ◎ Link these to the HTML definitions.
`low-value@ps 疑似類は、 次を満たす `meter$e 要素に合致する ⇒ その値は `low$a 内容~属性に指定された値を下回る ◎ The :low-value pseudo-class matches on a meter element when its value is under the value specified by the low HTML attribute.
`high-value@ps 疑似類は、 次を満たす `meter$e 要素に合致する ⇒ その値は `high$a 内容~属性に指定された値を上回る ◎ The :high-value pseudo-class matches on a meter element when its value is over the value specified by the high HTML attribute.
`optimal-value@ps 疑似類は、 次を満たす `meter$e 要素に合致する ⇒ その値は[ `optimum$a, `low$a, `high$a ]内容~属性により決定される範囲【~HTMLにて述べられる “最適~域” 】内にある ◎ The :optimal-value pseudo-class matches on a meter element when its value is in the range determined by the optimum / low / high HTML attributes.
5.2. ~listboxである `select^e の~target法
何かを定義する。 `7422$issue ◎ Define something. [Issue #7422]
6. `control-value^f 関数
これは、 実装~用には準備済みでない — これに関する課題を申請する。 ◎ This is not ready for implementation, file an issue regarding this.
~data漏出に関する~privacyの含意を考慮する。 `11860$issue ◎ Consider privacy implications, regarding data exfiltration. [Issue #11860]
もっと型【 `type$t を成す値】を追加することを考慮する。 `11842$issue ◎ Consider adding more types. [Issue #11842]
`control-value@f 関数は、 それを利用した~styleが適用される~form~controlの現在の値に算出される。 ~form~controlではない要素に利用された場合、 空~文字列を返す。 ◎ The control-value() function computes to the current value of the form control it is on. If it is used on an element that is not a form control, it returns an empty string.
`control-value()^t = control-value( `type$t? ) `type@t = '<' [ `number^v | `string^v ] '>'
疑似要素に利用された場合、 その`出自の要素$に対し評価される。 ◎ If used on a pseudo-element, it is evaluated against its originating element.
例えば,次は、 範囲~入力の隣に現在の値を示す: ◎ For example, to show on the value of a range input next to it:
input[type=range]::after { content: control-value(); }
7. ~widgetの~style法
7.1. ~widgetの~accent色: `accent-color^p ~prop
`accent-color$p ~propは、 `CSS-UI-4$r にて定義される。 ◎ The accent-color property is defined in [CSS-UI-4].
7.2. ~form~controlの~sizingの切替法: `field-sizing^p ~prop
この仕様の目的において、 要素が `既定の選好d~sizeを伴う要素@ であるとは, 要素の`内在的~size$は,要素の内容の~sizeに関わらず固定的であることをいう。 どの要素に適用-可能になるかは、 ~host言語が定義する。 例えば,~HTMLにおいては、 `textarea$e が`既定の選好d~sizeを伴う要素$であるとされる†。 ◎ For the purpose of this specification, an element with default preferred size is an element whose intrinsic size is fixed regardless of the size of its content. The host language defines which elements are applicable to it. For example, in HTML textarea is an element with default preferred size.
【† `textarea^e 要素の事例では、 “既定の選好d~size” は,要素の[ `cols^a, `rows^a ]属性に基づいて決定される。 】
- `fixed@v
-
~UAは、 次に従うモノトスル: ◎ ↓
- 当の要素が`既定の選好d~sizeを伴う要素$である場合、 その`内在的~size$を[ ~host言語により当の要素~用に定義された既定の選好d~size ]に設定する。 ◎ For element with default preferred size, the UA must set the intrinsic size to the default preferred size defined by the host language for that element.\
- 他の場合、 `content$v と同じに挙動する。 ◎ Otherwise, the UA must behave the same as content.
- `content@v
-
~UAは、 次に従うモノトスル: ◎ ↓
- 当の要素の`内在的~size$を要素の内容に基づいて決定する — ~host言語が当の要素~用に既定の選好d~sizeを定義していても,無視する。 ◎ The UA must determine the element’s intrinsic size based on its content, and must ignore any default preferred size defined by the host language for that element.\
- 当の要素が`既定の選好d~sizeを伴う要素$であって, `CSS-SIZING-3$r `§ 圧縮-可能な置換される要素@~SIZING#min-content-zero$ に挙げられたものである場合、 要素を[ `最小-内容 供与$用には`置換d要素$として扱うこと ]を止める。 ◎ If the element is an element with default preferred size and is listed in compressible replaced elements, the UA must stop treating the element as a replaced element for min-content contribution.
一例として, `textarea$e の~sizeは、 既定では,その内容に関わらず固定的になる ⇒ ⎸ The quick brown fox jumps over the lazy dog. ◎ For instance, textarea has a fixed size regardless of its content by default: ◎ ⎸ The quick brown fox jumps over the lazy dog.
`field-sizing$p: `content$v
が適用された場合:
- 前者の~sizeは,~text~caretが収まる~sizeになるべきである ⇒ ⎸ ◎ If field-sizing: content is applied, the size of the former should fit to a text caret. ⎸
-
さらに,要素の横幅が
`width$p: `10em^v
の様な固定的な値である場合、 要素の縦幅は,要素の内容を成す行l~数に依存するようになる ⇒ The quick brown fox jumps over the lazy dog.⎸ ◎ If field-sizing: content is applied and its width property has a fixed value like width: 10em, the element height depends on the number of the content lines: ◎ The quick brown fox jumps over the lazy dog.⎸
7.3. `~sliderの様な~control$の方位の変更-法: `slider-orientation^p
この~propを作業し直す。 ◎ Rework this property.
`~sliderの様な~control$は、 この~propの値に応じて:
- `auto@v
- その方位は、 `書字~mode$と書字~方向により定義される。 ◎ The slider-like control orientation is defined by the writing mode and direction.
- `left-to-right@v
- 横方向に具現化され, `slider-fill$pe は当の~controlの中で左端へ整列される。 ◎ The slider-like control is rendered horizontally and ::slider-fill is left-aligned within the control.
- `right-to-left@v
- 横方向に具現化され, `slider-fill$pe は当の~controlの中で右端へ整列される。 ◎ The slider-like control is rendered horizontally and ::slider-fill is right-aligned within the control.
- `top-to-bottom@v
- 縦方向に具現化され, `slider-fill$pe は当の~controlの中は上端へ整列される。 ◎ The slider-like control is rendered vertically and ::slider-fill is top-aligned within the control.
- `bottom-to-top@v
- 縦方向に具現化され, `slider-fill$pe は当の~controlの中で下端へ整列される。 ◎ The slider-like control is rendered vertically and ::slider-fill is bottom-aligned within the control.
7.4. 敏感な入力の隠蔽: `input-security^p ~prop
~CSS~WGは、[ この機能性を利用者に供することは重要である ]と予見するが,~CSSと~JSを介してそれを行うことは間違った~approachであり、 代わりに,~UAの中に組込まれるべきであることに合意した。 これは、[ 利用者が発見-可能かつ理解-可能になるよう,各~siteにて一貫して働く ]必要があり, [ ~JSが切られていようが働く ]必要があり, [ 一貫して確固たる~accessibilityを備える ]必要があり, 等々。 したがって、 これは,仕様から除去されることが意図される — その挙動は、 代わりに[ ~password~fieldのヤリトリ~modelの一部として,~HTML仕様にて指定される ]ものと~~期待されている。 ~HTMLが明確化される状況まで、 削除するのは保留されるが。 `6788$issue, `~HTML課題 #7293@~HTMLissue/7293$ を見よ。 ◎ The CSSWG has agreed that while we believe that providing this piece of functionality to users is important, doing it via CSS+JS is the wrong approach, and that instead it should be built into user agents: this needs to work consistently from site to site for it to be discoverable and understandable by users, this needs to work even when JS is turned off, and this needs to have consistently solid accessibility… We therefore intend to remove this from the specification, and instead, we would like to see this behavior specified in the HTML specification as part of the interaction model of password fields. Holding off deleting until the situation with HTML is clarified. See https://github.com/w3c/csswg-drafts/issues/6788 and https://github.com/whatwg/html/issues/7293.
この仕様の目的における `敏感な~text入力@ とは、 ~text入力のうち[ ~host言語により,敏感な入力を受容することが目的であると定義されたもの ]である。 例えば,~HTMLにおける `input type=password@~HEinput#attr-input-type-password-keyword$e は、 `敏感な~text入力$である。 ◎ For the purpose of this specification, a sensitive text input is a text input whose purpose is to accept sensitive input, as defined by the host language. For example, in HTML <input type=password> is a sensitive text input.
~UAは、 既定では,覗き見を防止するために`敏感な~text入力$の内容を隠蔽する。 利用者は、 敏感な情報を自身が正しく打込んだか確認するために, この隠蔽を一時的に不能化したいと望むこともある。 作者は、 この隠蔽を[ 可能化する/不能化する ]ために `input-security$p ~propを利用してもヨイ。 ◎ By default, user agents obscure the contents of sensitive text inputs in order to prevent onlookers from seeing it. Users may wish to temporarily disable this obscuring in order to confirm that they’ve typed their sensitive information correctly. The input-security property may be used by authors to enable or disable this obscuring.
- `none@v
- ~UAは、 当の~control内の~textを[ 利用者が読取れるよう,隠蔽しない ]モノトスル。 ◎ The UA must not obscure the text in the control, so that it can be read by the user.
- `~auto0@v
- ~UAは、 当の~control内の~textを[ 利用者が読取れないよう,隠蔽する ]ベキである。 ◎ The UA should obscure the text in the control, so that it cannot be read by the user.
~UAが~control内の~textを隠蔽する正確な仕組みは未定義であるが、 ~UAは概して,`敏感な~text入力$を[ それを成す各~文字を相応しい何か — `002A^U `ASTERISK^cn (*) や `25CF^U `BLACK CIRCLE^cn (●) など — に置換する ]ことにより隠蔽する。 ◎ While the exact mechanism by which user agents obscure the text in the control is undefined, user agents typically obscure sensitive text inputs by replacing each character with some suitable replacement such as U+002A ASTERISK (*) or U+25CF BLACK CIRCLE (●).
一例として,次の~stylesheet, ~HTMLが与えられたなら: ◎ For instance, given this style sheet
input[type=password] { input-security: auto; }
◎ and this HTML
<input type=password value=MySecret794>
~UAは、 `input type=password@~HEinput#attr-input-type-password-keyword$e を次の様に描画することもあろう ⇒ ◎ a user agent might render the <input type=password> like so: ●●●●●●●●●●●
付録 A. 基本的な外観~用の~UA~stylesheet
この節を~HTMLへ移動する。 ◎ Move to HTML.
この節は、 実装と伴に精緻化する必要がある。 ◎ This section needs refining with implementation.
色~入力~styleを精緻化する必要がある。 `11837$issue ◎ Color input styles need refining. [Issue #11837]
基本的なもの
input, textarea, button, ::file-selector-button, select, meter, progress { `color$p: inherit; `font$p: inherit; `box-sizing$p: border-box; `background-color$p: transparent; }
~layout
input:not([type=file], [type=range]), textarea, button, ::file-selector-button, ::slider-track, select, meter, progress { `border$p: 1px solid currentColor; `background-color$p: transparent; }
~slider
次に挙げるものの~style法を精緻化する ⇒# `meter$e, `progress$e, `input type=checkbox switch^e, `input type=range^e ◎ Refine meter, progress, switch and range input styling.
::slider-track { `height$p: 1em; } ::slider-fill { `height$p: 100%; `background-color$p: currentColor; } ::slider-thumb { `border-radius$p: 0; `border$p: none; `background-color$p: currentColor; `appearance$p: none; `width$p: 1em; `height$p: 100%; }
~checkboxと~radio
input:is([type=checkbox]:not([switch]), [type=radio]) { `width$p: 1em; `height$p: 1em; `display$p: inline-flex; `align-items$p: center; `justify-content$p: center; `content$p: ''; } input[type=radio] { `border-radius$p: 100%; } input[type=checkbox]:not([switch]):checked::checkmark { `content$p: '\2713' / ''; } input[type=radio]:checked::checkmark { `background-color$p: currentColor; `display$p: inline-block; `border-radius$p: inherit; `height$p: 100%; `width$p: 100%; }
~privacy 考慮点
この仕様に対し報告された新たな~privacyの考慮点は、 無い。 ◎ No new privacy considerations have been reported on this specification.
~security 考慮点
この仕様に対し報告された新たな~securityの考慮点は、 無い。 ◎ No new security considerations have been reported on this specification.
謝辞
この提案に意見を寄せられた次に挙げる方々に ⇒ `Aditya Keerthi, Anne van Kesteren, Elika Etemad, Jen Simmons, Joey Arhar, Jon Davis, Simon Fraser and Theresa O’Connor^en ◎ Thanks to Aditya Keerthi, Anne van Kesteren, Elika Etemad, Jen Simmons, Joey Arhar, Jon Davis, Simon Fraser and Theresa O’Connor for their input on this proposal.
`input[type=range]^css の~style法について`詳細な分析@~CSSissue/4410#issuecomment-1087244943$ を寄せられた `Ana Tudor^en 氏に。 ◎ Thanks to Ana Tudor for her detailed analysis of input[type=range] styling.