-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
label:not([for]) is valid when has nested input field #20
Comments
It's a good point, that is valid, and currently marked not valid by Holmes. However, it can't be as simple as just adding
According to the spec, cases 1 and 2 should be valid, 3 and 4 should not. Holmes currently only shows case 1 as valid. If you make the change you suggest, cases 1, 2 and 3 will all appear valid. |
Here's the basic test case I worked up for this: http://danielgwood.com/lab/holmes/issue-20.html |
The problem is that case 2 can not be detected via css, because there is no selector for "label that contains an input as children", at least as far as I know. |
Indeed - I was unable to think of a CSS solution. I believe you're right, without a "has" or "contains" selector, you can't test case 2 without also hitting case 3. |
You indicate
label
without[for]
attribute as invalid at https://github.com/redroot/holmes/blob/master/holmes.css#L89.HTML4 spec (http://www.w3.org/TR/html401/interact/forms.html#h-17.9.1):
HTML5 spec (http://www.w3.org/TR/html5/forms.html#attr-label-for)):
E.g. this example is valid:
<label><textarea name="text"></textarea></label>
IMHO
.holmes-debug label:not([for])
can be changed to something more strict, e.g..holmes-debug label:not([for]):empty
The text was updated successfully, but these errors were encountered: