Comments (4)
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 :empty
to the selector, because this makes a lot of invalid cases appear valid. Example:
<div>
<h3>1. Valid</h3>
<label for="foo">Label for foo</label>
<input type="text" id="foo" name="foo" />
</div>
<div>
<h3>2. Also valid</h3>
<label>
Label for bar
<input type="text" name="bar" />
</label>
</div>
<div>
<h3>3. Not valid</h3>
<label>Label "for" baz</label>
<input type="text" name="baz" />
</div>
<div>
<h3>4. Not valid</h3>
<label for="">Label "for" baz</label>
<input type="text" name="baz" />
</div>
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.
from holmes.
Here's the basic test case I worked up for this: http://danielgwood.com/lab/holmes/issue-20.html
from holmes.
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.
from holmes.
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.
from holmes.
Related Issues (18)
- clarify license HOT 2
- img with empty alt attribute shouldn't be an error HOT 2
- Is there a way to make holmes ignore validation on specific elements? HOT 2
- Replace border with outline HOT 3
- Non conforming features HOT 1
- Clear license statement HOT 4
- Table Summary HOT 4
- Bookmarklet on home page uses old/invalid URL HOT 1
- Link to project website not quite correct HOT 1
- Please add to Bower and NPM.
- title not needed in links HOT 2
- Unsure if javascript:void(0); or # is a problem HOT 2
- I can get the :not selector to work HOT 1
- W3C Validation HOT 5
- Table summary attribute is no longer supported in HTML5 HOT 2
- Titles on Links should be warning, not error HOT 1
- u is a valid part of the HTML spec HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from holmes.