Re: suggestion for tag set <sarcasm> </sarcasm> pair

2014-11-04 9:25, Steve Faulkner wrote:
>
> On 4 November 2014 07:07, Jukka K. Korpela 
> <jukka.k.korpela@kolumbus.fi <mailto:jukka.k.korpela@kolumbus.fi>> wrote:
>
>     What “semantics” is added for me by whom/what? 
>
>
> role and label for AT users, and visual symbols for other users.

They are added by the code you wrote, just like they can be added by an 
author directly to any element.


> I am not advocating one method over another, I have provided an 
> example of one possible solution,

If I understand you correctly, the benefit of your solution, as compared 
with a simple <span class=...> or custom tag solution is that having 
written the general code, you can use just <html5-sarcasm> and have the 
@aria-label and @note attributes implied for it. In styling, there is no 
such benefit, since CSS is expressive enough.

This would be a real benefit when <html5-sarcasm> is used several times 
in a document. In principle, it is a benefit even when just two 
occurrences exist, as it avoids duplication of code (though the amount 
of code is much bigger).

On the other hand, the code uses JavaScript, and the same result can be 
achieved with rather simple JavaScript code that traverses the document 
tree and sets some attributes to all <sarcasm> elements.

(I’m not sure whether role=note is an adequate example here. It 
indicates “A section whose content is parenthetic or ancillary to the 
main content of the resource.” I don’t think that’s accurate for a 
sarcastic remark in general, and I don’t see what it would benefit. 
Regarding @aria-label, as far as I can see, it is mainly intended for 
text that acts a label for a control-like element that otherwise lacks a 
textual label. The @title attribute is more widely supported, but using 
it is somewhat illogical too. And if you really want that everyone 
surely gets the idea that a remark is sarcastic, you should precede it 
with “Sarcasm:” in the real—not generated—content, or maybe follow it 
with “(The preceding remark was sarcastic.)”.)

> you have provided in a round about way another solution, suggest it 
> would be helpful if you write up your solution in a form that can 
> easily be used by others.
>

The solution of just using custom tags (and the document.createElement 
backup) is probably described on many pages. The idea of using 
JavaScript to add attributes just popped into my mind, but quite 
possibly it is described somewhere, too, and I’m not convinced of its 
general usefulness. The idea of adding the @custom attribute could be 
written in the form of an extension proposal, but the question is 
whether it would have sufficient support and what group should work on it.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Tuesday, 4 November 2014 08:16:30 UTC