GithubHelp home page GithubHelp logo

Comments (4)

danielgwood avatar danielgwood commented on June 26, 2024

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.

danielgwood avatar danielgwood commented on June 26, 2024

Here's the basic test case I worked up for this: http://danielgwood.com/lab/holmes/issue-20.html

from holmes.

justmarkup avatar justmarkup commented on June 26, 2024

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.

danielgwood avatar danielgwood commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.