This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9493 - NAME attribute value rules need clarifying
Summary: NAME attribute value rules need clarifying
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.w3.org/TR/html5/forms.html...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-12 06:00 UTC by T.J. Crowder
Modified: 2010-10-04 13:58 UTC (History)
4 users (show)

See Also:


Attachments

Description T.J. Crowder 2010-04-12 06:00:56 UTC
In section 4.10.19.1[1], the rules for the contents of the NAME attribute are not sufficiently clear. The attribute table[2] says "Text*" (with the * meaning "...the actual rules are more complicated than indicated in the table..."), but then all section 4.10.19.1 says is that it can't be blank if given, without saying the value is "Text" otherwise, and without indicating that this is the only complication.

Recommend replacing "If the attribute is specified, its value must not be the empty string." with "Valid values are [Text], with the restriction that if the attribute is specified, its value must not be the empty string." where [Text] is a link to the syntax definition of text[3].

(Will separately open an issue for the HTML4<->HTLM5 diffs document, as it doesn't seem to mention[4] this change[5] to the NAME rules.)

[1] http://www.w3.org/TR/html5/forms.html#attr-fe-name
[2] http://www.w3.org/TR/html5/index.html#attributes-0
[3] http://www.w3.org/TR/html5/syntax.html#syntax-text
[4] http://dev.w3.org/html5/html4-differences/#changed-attributes
[5] http://www.w3.org/TR/html401/types.html#type-name
Comment 1 T.J. Crowder 2010-04-12 07:37:26 UTC
Re

> (Will separately open an issue for the HTML4<->HTLM5 diffs document, as it
> doesn't seem to mention[4] this change[5] to the NAME rules.)

Ignore that, Simon Pieters points out[1] that the NAME attribute is a cdata token in the HTML4 spec, not a NAME token. The remainder of this issue remains, just ignore that parenthetical.

[1] http://lists.w3.org/Archives/Public/public-html-comments/2010Apr/0050.html
Comment 2 Ian 'Hixie' Hickson 2010-04-13 09:02:35 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Linking to the syntax section is wrong, since the attribute can be used without any serialisation (just from script), or in XML (where the HTML syntax is irrelevant and different). I don't know what else to link to.
Comment 3 T.J. Crowder 2010-04-13 09:40:45 UTC
Apologies, I managed to miss that the syntax link I gave as to the HTML-specific section.

I've reopened this because "text" really needs defining for clarity. "Text" is a very generic word. The section as it reads now leaves one looking around for the rules somewhere; it's not clear that these _are_ the rules (the only rules) and one can stop looking.

If there's no appropriate section to link to to define it, I'd say one is needed, as the NAME attribute isn't the only place where this is going to come up. Even if all it says is that text is unrestricted, that tells the user of the spec they can stop looking.

Revised recommended wording:

<< "text" consists of any sequence of characters without any restriction imposed by this specification, although specific attributes et. al. may document limits on their content (for instance, by requiring that they not be blank). Specific serializations may impose restrictions in their syntaxes (HTML[1], XHTML[2]). >>

...with the links indicated, followed by this in a non-normative block:

<< For example, an attribute value in the XHTML serialization cannot include a double quote, as the double quote is used to delimit the attribute value. Instead the &quot; entity would be used. >>

[1] http://www.w3.org/TR/html5/syntax.html#syntax-text
[2] http://www.w3.org/TR/html5/the-xhtml-syntax.html#writing-xhtml-documents
Comment 4 Ian 'Hixie' Hickson 2010-04-13 09:51:59 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: see diff given below
Rationale: I'm not sure I really agree, but I've tried to satisfy the request by adding a section that basically says anything goes and then linking to it from the table.
Comment 5 contributor 2010-04-13 09:53:48 UTC
Checked in as WHATWG revision r5035.
Check-in comment: Try to explain what 'text' means in the attribute table.
http://html5.org/tools/web-apps-tracker?from=5034&to=5035
Comment 6 Ian 'Hixie' Hickson 2010-04-13 09:54:48 UTC
(I didn't add a link to it from the many attributes that don't have restrictions, because that seems like it would require a lot of awkward text wrangling to make things flow, and I'm not convinced that would be really result in an improved spec.)