Closed
Bug 1236306
Opened 10 years ago
Closed 10 years ago
ruby <rtc> and <rt> is not correctly interpreted
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: hakatasiloving, Unassigned)
References
()
Details
Attachments
(1 file)
|
7.37 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
Steps to reproduce:
1. Open HTML with the following snnipet.
<p>
<ruby>
<rb>月</rb><rb>光</rb><rtc>Moonlight</rtc>
</ruby>
</p>
<p>
<ruby>
<rb>月</rb><rb>光</rb><rt>Moonlight</rt>
</ruby>
</p>
<p>
<ruby>
<rb>月</rb><rb>光</rb><rtc><rt>Moonlight</rt></rtc>
</ruby>
</p>
Actual results:
Rendered as attached screenshot
Expected results:
At first, all these three <ruby> should be interpreted the same according to the spec [1], which states that "Text that is a direct child of the rtc element implicitly produces a ruby text segment as if it were contained in an rt element." and "rt children of ruby are implicitly contained in an rtc container."
[1]: http://www.w3.org/TR/html5/text-level-semantics.html#the-rtc-element
Additionally, <rtc> element should be interpreted as a total annotation of <ruby>, not a part, then the phrase "Moonlight" should be rendered as the first paragraph of the screenshot.
Thanks.
Comment 1•10 years ago
|
||
Note that the spec that controls ruby layout is https://drafts.csswg.org/css-ruby/ not HTML, and in particular see https://drafts.csswg.org/css-ruby/#box-fixup for how the cases you have here should be handled.
That said, afaict you're right that at least the first and third examples from comment 0 should look identical. It's not clear to me why they don't....
Flags: needinfo?(quanxunzhen)
Comment 2•10 years ago
|
||
This is the expected behavior. The spec states [1]:
> If a ruby annotation container contains only a single, anonymous ruby
> annotation, then that ruby annotation is paired with (i.e. spans across)
> all of the ruby bases in its ruby segment.
It means <rtc>XXX</rtc> and <rtc><rt>XXX</rt></rtc> are different by design.
The is the simplest way to fulfill the spanning annotation use case. Discussion and decision about this can be find in the archive of www-style [2].
[1] https://drafts.csswg.org/css-ruby/#base-annotation-pairing
[2] https://lists.w3.org/Archives/Public/www-style/2014Nov/0275.html
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(quanxunzhen)
Resolution: --- → INVALID
Comment 3•10 years ago
|
||
But I guess this is probably worth a bit more documentation in MDN or something.
Note that the last example in my Mozilla Hacks article introducing ruby support [1] actually used this behavior.
[1] https://hacks.mozilla.org/2015/03/ruby-support-in-firefox-developer-edition-38/
You need to log in
before you can comment on or make changes to this bug.
Description
•