Skip to content

label:not([for]) is valid when has nested input field #20

@victor-homyakov

Description

@victor-homyakov

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):

When attribute is absent, the label being defined is associated with the element's contents.

HTML5 spec (http://www.w3.org/TR/html5/forms.html#attr-label-for)):

If the for attribute is not specified, but the label element has a labelable element descendant, then the first such descendant in tree order is the label element's labeled control.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions