This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26426 - rb causing a parser error if current node is not ruby could break old content
Summary: rb causing a parser error if current node is not ruby could break old content
Status: RESOLVED MOVED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P0 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: Robin Berjon
URL:
Whiteboard: whatwg-resolved
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 10:23 UTC by Koji Ishii
Modified: 2016-10-25 09:27 UTC (History)
8 users (show)

See Also:


Attachments

Description Koji Ishii 2014-07-24 10:23:07 UTC
Tree construction, The "in body" insertion mode <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody> states that:

A start tag whose tag name is one of: "rb", "rp", "rtc"
If the stack of open elements has a ruby element in scope, then generate implied end tags. If the current node is not then a ruby element, this is a parse error.

This rule could break existing HTML + XHTML Ruby annotation content because they could use rbc tags:
<ruby><rbc><rb>base</rb></rbc>...

Such content will be a parse error because rb is not a direct child of ruby.

Should we loosen the rule to require rb being the direct child of ruby?
Comment 1 fantasai 2014-07-24 11:02:41 UTC
I think
  * <rb> should only generate implied end tags for <rb>,<rt>,<rtc>,<rp>
  * <rt> should only generate implied end tags for <rb>,<rt>,<rtc>,<rp>
  * <rtc> should only generate implied end tags for <rb>,<rt>,<rtc>,<rp>
  * <rp> should not generate implied end tags for anything (bug 26424).
Comment 2 Koji Ishii 2014-07-26 12:40:45 UTC
Changing auto-closing rules doesn't help this. Because rbc is not defined in HTML5, we can't define its auto-closing rules.

In other words, I could say following fragments exist in the wild:

<ruby><any><rb>base</rb></any>...</ruby>

and the <any> is an undefined element. If this fragment is defined as a parser error, we're likely to break a lot of existing documents that follow XHTML Ruby Annotation spec.
Comment 3 Koji Ishii 2014-07-28 18:42:33 UTC
After some more tests, I confirmed that having <rbc> doesn't render as proper ruby even before the spec change, so I'd put lower priority.

Gecko, after the spec change was implemented, starts showing this as a parser error in Source view because <rb> is now defined, as discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1042885
Comment 4 Michael[tm] Smith 2015-06-16 10:10:33 UTC
Agree that it would be good to have a spec change here, and raising priority after reviewing implementer feedback.
Comment 5 Travis Leithead [MSFT] 2016-04-27 22:37:35 UTC
HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/291

To file additional issues please use the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new Thanks!