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

Re: @label, @help, @hint, @alert

From: Steven Pemberton <Steven.Pemberton@cwi.nl>
Date: Wed, 12 Mar 2014 15:30:18 +0100
To: "Steven Pemberton" <Steven.Pemberton@cwi.nl>, "Erik Bruchez" <erik@bruchez.org>
Cc: "Forms WG" <public-forms@w3.org>
Message-ID: <op.xcl48swcsmjzpq@steven-ux21a>
On Wed, 05 Mar 2014 18:51:50 +0100, Erik Bruchez <erik@bruchez.org> wrote:

> Steven,
>
> Quick comments:
>
> 1. `filename="{@filename}"` and `mediatype="{@mediatype}"` won't work,
> because AVTs evaluate to a string value. What these two attributes
> specify is the ability to *write* to a node. So for these you would
> need something like `filename-ref` and `mediatype-ref`.

Ah. OK.

> 2. We could, as discussed in that older thread, say that item and
> itemset support constant values as text:
>
> <item label="New York">NY</value>
>
> And `@value` would remain an XPath expression.

That works for me (as long as you mean <item label="New  
York"><value>NY</value></item>)

> 3. xf:copy
>
> `@copy` could be an XPath expression. If `@value` is one, then at
> least we would have some consistency here.

OK.

> 4. Styling
>
> There was a suggestion to use pseudo-elements as well. So couldn't we  
> use:
>
>     xf|label, :xf|label { ... }

Well, these only match elements.

Steven

>
> -Erik
>
> On Wed, Mar 5, 2014 at 8:49 AM, Steven Pemberton
> <Steven.Pemberton@cwi.nl> wrote:
>> 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, 12 March 2014 14:30:54 UTC

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