W3C home > Mailing lists > Public > public-forms@w3.org > March 2014

@label, @help, @hint, @alert

From: Steven Pemberton <Steven.Pemberton@cwi.nl>
Date: Wed, 05 Mar 2014 17:49:31 +0100
To: "Forms WG" <public-forms@w3.org>
Message-ID: <op.xb9c0tw5smjzpq@steven-ux21a>
It's probably too late for this draft, but here is my view of the label as  
attribute situation.

1. It would be easy to add @label, @help, @hint, @alert to the attribute  
set UICommon, which would mirror the content set of the UICommon elements.
2. Of the core controls  
(input|secret|textarea|output|upload|range|trigger|submit|select|select1),  
only <output> is the odd one out, where <label> is optional.
3. group, dialog and choices only have <label> (no help hint and alert)
4. switch and repeat have none of them

Now the special cases.

1. upload has a filename child element, which for consistency we might  
want to mirror in an attribute
	<upload ref="mail/attachment" accept="video/*,image/*,.txt,.pdf">
	  <label>Select attachment:</label>
	  <filename ref="@filename" />
	  <mediatype ref="@mediatype" />
	</upload>
=>
    <upload ref="mail/attachment" accept="video/*,image/*,.txt,.pdf"  
label="Select attachment:" filename="{@filename}" mediatype="{@mediatype}"  
/>

2. <item> has <label> and <value>. The problem here is that @value would  
operate differently from @value on other elements, where it is an  
expression, while here it would be a string/AVT. Not sure what to do.

	<output label="Total" value="total"/>

	<item label="New York" value="NY" />
	<item label="{@name}" value="{@code}" />
or
	<item label="New York" value="'NY'" />
	<item label="{@name}" value="@code" />

Difficult.

3. itemset label value|copy. Copy is empty, and you only use it for the  
ref, so do we make it an AVT or an expression?
	<select model="cone" ref="my:order">
	  <label>Flavors</label>
	  <itemset model="flavors" ref="my:flavor">
	    <label ref="my:description"/>
	    <copy ref="my:description"/>
	  </itemset>
	</select>
=>
	<select model="cone" ref="my:order" label="Flavors">
	    <itemset model="flavors" ref="my:flavor" label="{my:description}"  
copy="my:description"/>
	</select>
or
	<select model="cone" ref="my:order" label="Flavors">
	    <itemset model="flavors" ref="my:flavor" label="{my:description}"  
copy="{my:description}"/>
	</select>
?

Priority

I suggest a behaviour that if an element has both an attribute and its  
matching element, the attribute gets priority (offering backwards  
compatibility).

Styling

CSS styling is not a problem, but we might want to discuss it:

	*[label]:before {content: attr(label); ... other styling...}
	*[hint:hover:before {content: attr(hint); ... other styling...}
	*[alert]:invalid:before {content: attr(alert); ... other styling...}

Steven
Received on Wednesday, 5 March 2014 16:50:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:14:09 UTC