[whatwg] rp is a styling tag and has no semantic function

Nikita Popov privat at ni-po.com
Sat Oct 31 03:27:26 PDT 2009


Futomi Hatano schrieb:
> On Fri, 30 Oct 2009 15:00:10 +0100
> Nikita Popov <privat at ni-po.com> wrote:
>
>   
>> I am not sure whether it is as easy. Please consider this one:
>> <ruby>
>> char <rt>pron 1</rt>
>> another char <rt>pron 2 pron 3</rt>
>> and some other text without a ruby annotation.
>> </ruby>
>> If a screen-reader now only would read the ruby-annotations, it would
>> sound like this: "pron 1 pron 2 pron 3" and the rest of the text
>> wouldn't be read.
>>     
>
> The text without a ruby annotation should not be in <ruby>.
> It should be marked up like this:
>
> <ruby>
> char <rt>pron 1</rt>
> another char <rt>pron 2 pron 3</rt>
> </ruby>
> and some other text without a ruby annotation.
>   
Yes, that's right. But there are always people not as strict. I think
some ninety-nine percent of websites aren't valid an even less semantic.
HTML5 mustn't be planed only for the exemplary developers but for the
standard-user, too.
>> is much better. But I still think that
>>
>> <ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>
>>
>> is not the right way to mark this up. Much better would be:
>>
>> <ruby>漢字<rt>かんじ</rt></ruby>
>>     
>
> If all browsers support <ruby> like IE, I think so.
> Then, the CSS that you mentioned blow would be not necessary.
>   
Yes, that would be perfect. But for now that's not how it is.
> Now, we are talking about non-IE borwsers which don't support <ruby>,
> For such browses, we have to show "(" and ")" in a phrase for a ruby annotations.
> If "(" and ")" appear in a phrase, these are part of the phrase semantically.
> So, I think that "(" and ")" should be marked up in HTML.
>
>   
>> An these two CSS-definitions:
>> rt:after {
>> content: ')';
>> }
>> rt:before {
>> content: '(';
>> }
>> This would add '(' before and ')' after all ruby-annotations. The only
>> problem is: Browsers being able to render ruby, will render the
>> parentheses too. So there must be another CSS-property, something like:
>> rt:after {
>> content: ')';
>> display: ruby-parenthese;
>> }
>> rt:before {
>> content: '(';
>> display: ruby-parenthese;
>> }
>> Browsers not knowing this value for ruby will fall back to display:
>> inline; and so display the parenthese. Browsers knowing ruby and this
>> property would not show the parentheses.
>> I think this is a much cleaner solution for the parentheses and the code
>> gets more readable.
>>     
>
> It is a solution presentationally, but it is not a solution semantically, I think.
> Your solution is useless for UAs which don't support CSS, because parentheses would not be displayed.
>   
Screen-readers are yet another problem: I'm not sure, what's better:
"ka-n-ka-n-ji-ji" or
"ka-n-bracketopen-ka-n-bracketclose-ji-bracketopen-ji-bracketclose". I
think the first one is even better, because the text is only duplicated
and the reader mustn't read the brackets, too. (This is for
screen-readers not supporting ruby. The ones that support it can then
handle it by only reading out the rt, as you proposed. [Though you need
to consider the problem above.])

So, what do we get using the CSS and this markup:
<ruby>char <rt>pron</rt></ruby>
Browser, no ruby implementation: char (pron)
Browser, ruby implementation: correct rendering of ruby, without brackets.
Screen-reader, no ruby: char pron
Screen-reader, ruby: pron (If using your proposition)

Using the rp-tag using this markup:
<ruby>char <rp>(</rp><rt>pron</rt><rp>)</rp></ruby>
Browser, no ruby implementation: char (pron)
Browser, ruby implementation: correct rendering of ruby, without brackets.
Screen-reader, no ruby: char bracketopen pron bracketclose
Screen-reader, ruby: pron (If using your proposition)

Both variants are the same, only differing in the point "screen-reader,
no ruby". (And this is discussed above.)
> Parentheses for a ruby is not for decoration.
> It is a part of phrase.
> Please consider this phrase:
>
> <p>This interest was borne from the realization that XML's deployment as a Web technology was limited to entirely new technologies (like RSS and later Atom), rather than as a replacement for existing deployed technologies (like HTML).</p>
>
> Do you use CSS for "(like RSS and later Atom)" or "(like HTML)" ?
> I hope that you say no.
> I think that parentheses for a ruby is same as this case.
>   
No, I do think it is an absolutely different situation. In the above
example the parentheses are part of the content. If it is convenient in
the English language to use parentheses to mark examples, then they are
part of the language and so of the content.
With ruby, it's something different. If they would really belong to the
content, why should you make them invisible? In my eyes they are only
used to indicate the reader, that the text between them isn't really at
the right place. This could be also done by giving them a color: grey;.
The parentheses are only one of many *stylistical* variants to show that
the characters are a ruby not being able to be displayed. And so, for
me, it's a problem of CSS.

Nikita Popov




More information about the whatwg mailing list