Skip to content

Commit f417d13

Browse files
hobertabatkins
andauthored
[css-ui-4] Define the ''input-security'' property. Fixes #2495. (#6239)
Co-authored-by: Tab Atkins Jr. <jackalmage@gmail.com>
1 parent c78e58b commit f417d13

File tree

1 file changed

+69
-1
lines changed

1 file changed

+69
-1
lines changed

css-ui-4/Overview.bs

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,23 @@ spec:css-color-4; type:property; text:color
9393
spec:selectors-4; type:selector; text::focus
9494
spec:selectors-4; type:selector; text::focus-visible
9595
</pre>
96+
<pre class=anchors>
97+
urlPrefix: https://html.spec.whatwg.org/multipage/; spec:HTML
98+
text:password; type:attr-value; for:input/type; url: input.html#attr-input-type-password-keyword
99+
</pre>
96100

97101
<style>
98102
.awesome-table td {padding:5px}
99103
.awesome-table {color:#000;background:#fff;margin: auto;}
104+
105+
.fake-input-type-password {
106+
display: inline-block;
107+
border: 1px solid black;
108+
background: white;
109+
text: black;
110+
width: 20ch;
111+
padding: 0 2px;
112+
}
100113
</style>
101114

102115
<h2 id="intro">Introduction</h2>
@@ -1787,7 +1800,7 @@ so this specification allows flexibility.
17871800
<pre class=propdef>
17881801
Name: accent-color
17891802
Value: auto | <<color>>
1790-
Initial: ''auto''
1803+
Initial: ''accent-color/auto''
17911804
Applies to: all elements
17921805
Inherited: yes
17931806
Percentages: N/A
@@ -2199,6 +2212,61 @@ that are typical of the element whose appearance it acquires.
21992212
is also not changed by the 'appearance' property.
22002213
</div>
22012214

2215+
<h3 id="input-security">
2216+
Obscuring sensitive input: the 'input-security' property</h3>
2217+
2218+
<pre class=propdef>
2219+
Name: input-security
2220+
Value: auto | none
2221+
Initial: ''input-security/auto''
2222+
Applies to: [=sensitive text inputs=]
2223+
Inherited: no
2224+
Percentages: N/A
2225+
Computed Value: as specified
2226+
Canonical order: per grammar
2227+
Animation type: by computed value type
2228+
</pre>
2229+
2230+
For the purpose of this specification,
2231+
a <dfn export>sensitive text input</dfn> is
2232+
a text input whose purpose is to accept sensitive input,
2233+
as defined by the host language.
2234+
For example, in HTML <{input/type/password|&lt;input type=password&gt;}> is a [=sensitive text input=].
2235+
2236+
By default, user agents obscure the contents of [=sensitive text inputs=]
2237+
in order to prevent onlookers from seeing it.
2238+
Users may wish to temporarily disable this obscuring
2239+
in order to confirm that they've typed their sensitive information correctly.
2240+
The ''input-security'' property may be used by authors
2241+
to enable or disable this obscuring.
2242+
2243+
<dl dfn-type=value dfn-for=input-security>
2244+
<dt><dfn>none</dfn>
2245+
<dd>
2246+
The UA must not obscure the text in the control,
2247+
so that it can be read by the user.
2248+
<dt><dfn>auto</dfn>
2249+
<dd>
2250+
The UA should obscure the text in the control,
2251+
so that it cannot be read by the user.
2252+
</dl>
2253+
2254+
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 (●).
2255+
2256+
<div class="example">
2257+
For instance, given this style sheet
2258+
<pre><code class="lang-css">
2259+
input[type=password] {
2260+
input-security: auto;
2261+
}</code></pre>
2262+
and this HTML
2263+
<pre><code class="lang-html">
2264+
&lt;input type=password value=MySecret794>
2265+
</code></pre>
2266+
a user agent might render the <{input/type/password|&lt;input type=password&gt;}> like so:
2267+
<span class=fake-input-type-password>●●●●●●●●●●●</span>
2268+
</div>
2269+
22022270
<h3 id=control-specific-rules>
22032271
Control Specific Rules</h3>
22042272

0 commit comments

Comments
 (0)