Open MatsPalmgren opened 3 years ago
This was added in https://github.com/w3c/csswg-drafts/issues/2495#issuecomment-380397331
It could be used on to obscure the text there, but if there's a need for that then that's a strong indication the author should have used an in the first place.
No it cannot, the property is only defined to apply to <input type=password>
and similar sensitive text input as defined by the host language, that obscure the content by default.
The rest of your point stands.
The CSS Working Group just discussed input-security considered harmful
.
The minutes missed this part:
RESOLVED: Put an issue in the draft saying we'd like to remove
See the recent discussion in whatwg/html#7293. I think it would be best to retain input-security
and to mandate that "IF the UA exposes its own UI for this, that UI MUST be implemented by setting the input-security property on the element." That way we could at least ensure browser-provided UI and page-provided UI didn't fight each other.
See the recent discussion in whatwg/html#7293. I think it would be best to retain
input-security
and to mandate that "IF the UA exposes its own UI for this, that UI MUST be implemented by setting the input-security property on the element." That way we could at least ensure browser-provided UI and page-provided UI didn't fight each other.
How do you mean "don't fight each other" here. Because this would still lead to page UI getting out of sync with the browser UI.
User clicks browser UI to show password. Author toggle would still think the input is set to "hidden". and Is now out of sync with reality.
This as a mechanism also relies on password inputs to use input security and not the current technique of flipping between type="password" and type="text".
https://github.com/whatwg/html/issues/7293#issuecomment-1635680465 linking my comment on the html issue here because it's probably more relevant here. TLDR should ::-ms-reveal be standardised as an effective (and back compatible) form of feature detection for password reveal buttons.
The css-ui spec says:
https://drafts.csswg.org/css-ui-4/#input-security
I agree with the use case -- users need a way to temporarily disable the obscuring -- but I think the spec authors arrive at the wrong solution. I'm guessing their intent is that the page author should add a separate button to the page which sets the
input-security
property on the password control to do the unmasking. I think this is a bad solution to the problem. This feature is much better implemented in the UA by supporting it directly in the password field. E.g.(I believe Edge and some other UAs already do this.)
That way the user only need to learn one way of doing the unmasking, the same way for all sites, and it will always be available for all password controls. A UA is much more likely to implement a good solution in terms of usability/discoverability/accessibility, keyboard shortcuts consistent with the platform etc.. Having the unmasking button directly inside the password field itself also makes it obvious what it's for.
I don't really see a use case for
input-security
on other form controls either. It could be used on<input type=text>
to obscure the text there, but if there's a need for that then that's a strong indication the author should have used an<input type=password>
in the first place.We've already seen that relying on page authors to implement custom form control behavior leads to problems. It will undoubtedly lead to numerous incompatible implementations, some of which completely fail to work in some UAs. Typically such implementations will also require JavaScript, so they will not work for NoScript users. They usually also fail to have proper support for keyboard navigation, accessibility, high-contrast themes etc...
input-security
could also be abused, e.g.* { input-security: none; }
I request that
input-security
is removed from the spec.