Skip to content
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

The empty string is not defined as a conforming value for the capture attribute #34

Closed
sideshowbarker opened this issue Mar 21, 2020 · 3 comments · Fixed by #35
Closed

Comments

@sideshowbarker
Copy link

At https://w3c.github.io/html-media-capture/#the-capture-attribute the spec states:

The attribute's keywords are user and environment, which map to the respective states user and environment.

…but the spec does not define the empty string as a conforming keyword.

Because the spec doesn’t define the empty string as a conforming keyword, the following example from the spec itself doesn’t conform to the actual requirements in the spec —

<form action="server.cgi" method="post" enctype="multipart/form-data">
  <input type="file" name="audio" accept="audio/*" capture>
  <input type="submit" value="Upload">
</form>
@sideshowbarker sideshowbarker changed the title The empty string is not defined as conforming value for the capture attribute The empty string is not defined as a conforming value for the capture attribute Mar 21, 2020
@anssiko
Copy link
Member

anssiko commented Mar 23, 2020

If the attribute value matches none of the given keywords, the invalid value default maps to an implementation-specific state that indicates to the implementation to act according to its default behavior. IIRC this design was for historical reasons.

@sideshowbarker
Copy link
Author

If the attribute value matches none of the given keywords, the invalid value default maps to an implementation-specific state that indicates to the implementation to act according to its default behavior.

That applies to the action of the implementation, which is orthogonal to the document-conformance requirements (authoring-conformance requirements). The issue is that the document-conformance requirements explicitly state that user and environment are valid keywords, but don’t explicitly state that the empty string is a valid keyword.

For the empty string to be considered a valid value that documents and authors are allowed to use, it must be explicitly included in the same spec sentence that begins with The attribute's keywords are user and environment.

Compare to https://html.spec.whatwg.org/multipage/interaction.html#contenteditable:

The contenteditable content attribute is an enumerated attribute whose keywords are the empty string, true, and false.

Or compare to https://html.spec.whatwg.org/multipage/media.html#attr-media-preload, which states that for thepreload attribute, The following table lists the keywords and states for the attribute, and then lists none, metadata, and auto, followed by this statement:

The empty string is also a valid keyword, and maps to the Automatic state.

@anssiko
Copy link
Member

anssiko commented Mar 24, 2020

@sideshowbarker thanks for the clarification, PTAL #35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants