Re: [csswg-drafts] [selectors][css-values] Hide "sensitive" attributes from CSS (#5136)

> @mikewest, in https://groups.google.com/a/chromium.org/d/msg/blink-dev/FGCgsKmylhw/A1vw2xREAgAJ, suggests hiding "sensitive" attributes from CSS entirely: `nonce`, `value` on a form control, possibly others. They wouldn't be matchable with attribute selectors, or allow their value to be extracted with `attr()`.
> 
> This seems completely reasonable to me; there's no reasonable use-case for `nonce` to be usable in CSS, and the use-cases for extracting `value` (displaying in an error message displayed in a `::before`?) are weak enough that I'm happy to remove that.

I would be very unhappy about such a change that breaks old website functionality. For instance, I have used CSS access to the ``value`` attribute of checkboxes a lot for multiple-choice test like quizzes. Here's a real life example:

```HTML
<style>
input[value="x"]:checked + label {color:green}
input[value="x"]:checked + label::after {content: " … is correct! ☺"}
input[value=""]:checked + label {color:red}
input[value=""]:checked + label::after {content: " … is wrong."}
</style>

<fieldset>
<legend>Labradors are passionate:</legend>
<input type="checkbox" id="_37" value=""> <label for="_37">mathematicians</label>
<br><input type="checkbox" id="_38" value=""> <label for="_38">guardians</label>
<br><input type="checkbox" id="_39" value=""> <label for="_39">dancers</label>
<br><input type="checkbox" id="_40" value="x"> <label for="_40">swimmers</label>
</fieldset>
```

-- 
GitHub Notification of comment by prlbr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5136#issuecomment-713802716 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 21 October 2020 18:54:36 UTC