<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26424</bug_id>
          
          <creation_ts>2014-07-24 10:14:46 +0000</creation_ts>
          <short_desc>Tag omission rules for rp could break invalid-but-existing content</short_desc>
          <delta_ts>2016-04-27 22:05:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P0</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Koji Ishii">kojiishi</reporter>
          <assigned_to name="Robin Berjon">robin</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>travil</cc>
    
    <cc>wchen</cc>
    
    <cc>yuki.sekiguchi</cc>
    
    <cc>zefling</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>109242</commentid>
    <comment_count>0</comment_count>
    <who name="Koji Ishii">kojiishi</who>
    <bug_when>2014-07-24 10:14:46 +0000</bug_when>
    <thetext>When author puts rp inside rtc, rp auto-closes rtc, and it will produce an unexpected result.

Having rp inside rtc is invalid, so it&apos;s not strictly wrong to break. We found one such instance reported at &lt;https://bugzilla.mozilla.org/show_bug.cgi?id=1042885&gt;, but nothing else at this point.

But in this case, unlike rb, rt, or rtc, the benefits of rp to auto-close rtc is little to zero, so I&apos;d prioritize not to break invalid-but-existing content even if its actual usage is low.

One question remains; if we agree to change this behavior, should rp auto-close nothing, or should rp handle rtc as auto-close exception?

I&apos;m leaning to the latter, just because existing implementations used to auto-close rp, rt, and other implied end tags and therefore it can give better backward compatibility, but I&apos;m good with the former if other people prefers.

Example:
&lt;ruby&gt;
  &lt;rbc&gt;&lt;rb&gt;壱岐 &lt;/rb&gt;&lt;rb&gt;ひより&lt;/rb&gt;&lt;/rbc&gt;
  &lt;rtc&gt;&lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;いき &lt;/rt&gt;&lt;rt class=&quot;ruby_hide&quot;&gt;ひより&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;&lt;/rtc&gt;
  &lt;rtc&gt;&lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;IKI &lt;/rt&gt;&lt;rt&gt;Hiyori&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;&lt;/rtc&gt;
&lt;/ruby&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109245</commentid>
    <comment_count>1</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2014-07-24 10:58:58 +0000</bug_when>
    <thetext>I think &lt;rp&gt; should not auto-close anything. For complex cases, we don&apos;t know what the author will do to make them clear inline.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109292</commentid>
    <comment_count>2</comment_count>
    <who name="William Chen">wchen</who>
    <bug_when>2014-07-25 18:44:01 +0000</bug_when>
    <thetext>I took a quick look at some usages of &lt;rp&gt; on the web and it didn&apos;t take long to find a few pages that use &lt;rp&gt; inside of &lt;rt&gt; (it doesn&apos;t help that one of these was a ruby tutorial), and also a page that looks like it was written to take advantage of auto-closing because it didn&apos;t use close tags.

I didn&apos;t investigate to see how different things get rendered if we changed the parsing rules, but I suspect that making &lt;rp&gt; auto-close nothing will probably cause some comparability issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109311</commentid>
    <comment_count>3</comment_count>
    <who name="Koji Ishii">kojiishi</who>
    <bug_when>2014-07-26 12:55:33 +0000</bug_when>
    <thetext>I&apos;m still on the fence.

I think not breaking existing content is quite important. In that sense, rp should auto-close what it did before the spec was changed.

On the other hand, ideally, rp not auto-close anything looks the best spec.

Also, rp not being auto-closed is a big deal and I&apos;m opposed to change that, but rp not auto-closing shouldn&apos;t cause too much troubles, or any as far as I can think of.

Can anyone think of a case that rp not auto-closing can cause rendering behavior changes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109398</commentid>
    <comment_count>4</comment_count>
    <who name="William Chen">wchen</who>
    <bug_when>2014-07-28 18:18:00 +0000</bug_when>
    <thetext>I took a quick look for a style rule that would hide rp and found rules that looked like this in a few places:

ruby &gt; rp {
  display: none;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109404</commentid>
    <comment_count>5</comment_count>
    <who name="Koji Ishii">kojiishi</who>
    <bug_when>2014-07-28 18:53:19 +0000</bug_when>
    <thetext>(In reply to William Chen from comment #2)
&gt; I took a quick look at some usages of &lt;rp&gt; on the web and it didn&apos;t take
&gt; long to find a few pages that use &lt;rp&gt; inside of &lt;rt&gt; (it doesn&apos;t help that
&gt; one of these was a ruby tutorial), and also a page that looks like it was
&gt; written to take advantage of auto-closing because it didn&apos;t use close tags.
&gt; 
&gt; I didn&apos;t investigate to see how different things get rendered if we changed
&gt; the parsing rules, but I suspect that making &lt;rp&gt; auto-close nothing will
&gt; probably cause some comparability issues.

Can you paste the links you found?

The spec change caused rp to auto-close rtc, so the this bug is. But even before the new spec, rp used to auto-close rt, so I created a test at http://jsbin.com/bitohe that has:
  &lt;ruby&gt;base&lt;rt&gt;&lt;rp&gt;(&lt;/rp&gt;ruby&lt;rp&gt;)&lt;/rp&gt;&lt;/rt&gt;&lt;/ruby&gt;
and it does not render as ruby on Chrome, Safari, nor IE.

After looking at this test results, I started to wonder, maybe this isn&apos;t as critical as I originally thought.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109406</commentid>
    <comment_count>6</comment_count>
    <who name="Koji Ishii">kojiishi</who>
    <bug_when>2014-07-28 19:18:11 +0000</bug_when>
    <thetext>(In reply to Koji Ishii from comment #5)
&gt; After looking at this test results, I started to wonder, maybe this isn&apos;t as
&gt; critical as I originally thought.

I mean, changing rp not to auto-close anything will actually fix pages with rp inside rt.

See the test results at http://www.browserstack.com/screenshots/68cc77ec6804d2a6bbc7de29f55f99a14744977d
Browsers that render rp inside rt as ruby are: IE 6/7/8/9
Browsers that do not render rp inside rt as ruby are: IE 10/11, Chrome 35, Safari 7
Firefox not included in the above list because it does not render ruby anyway.

So, the changing will:
* Fix web pages written for IE 6/7/8/9 (real sites wchen found are probably in this category)
* Break web pages that rely on auto-closing behavior of rp for IE 10-, Chrome, Safari

But as long as rp inside rt is already broken, I can&apos;t think of single example where rp not auto-closing anything will break.

So, unless I miss something, I think compatibility concern is a needless fear, we can safely fix rp not to auto-close anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109434</commentid>
    <comment_count>7</comment_count>
    <who name="William Chen">wchen</who>
    <bug_when>2014-07-28 22:54:10 +0000</bug_when>
    <thetext>(In reply to Koji Ishii from comment #5)
&gt; Can you paste the links you found?

http://reference.sitepoint.com/html/rp
http://www.w3schools.com/TAgs/tag_rp.asp
http://html.eweb-design.com/0406_rub.html
https://github.com/search?q=%3Cruby%3E%3Crt%3E%3Crp%3E&amp;ref=searchresults&amp;type=Code

These are results from a text-based search engine and github code search. I don&apos;t have a good tool to search web markup so I don&apos;t know how often these things show up in the wild.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109456</commentid>
    <comment_count>8</comment_count>
    <who name="Koji Ishii">kojiishi</who>
    <bug_when>2014-07-29 00:46:41 +0000</bug_when>
    <thetext>Thanks!

(In reply to William Chen from comment #7)
&gt; (In reply to Koji Ishii from comment #5)
&gt; &gt; Can you paste the links you found?
&gt; 
&gt; http://reference.sitepoint.com/html/rp
&gt; http://www.w3schools.com/TAgs/tag_rp.asp

These two don&apos;t render as ruby with IE10-, Chrome, and Safari. So changing rp will fix these pages to IE 9 or before.

&gt; http://html.eweb-design.com/0406_rub.html

This one relies on auto-closing behavior, so the resulting DOM will be changed if we fix this bug. However, it will not make rendering worse at all.

&gt; https://github.com/
&gt; search?q=%3Cruby%3E%3Crt%3E%3Crp%3E&amp;ref=searchresults&amp;type=Code

I didn&apos;t know I can do this, thanks, this is quite nice!

I examined first 20; all of them are either:
a) fix broken ruby by the early HTML5 spec to IE9 or earlier (rp inside rt)
b) no changes in DOM (rp has nothing to auto-close)
c) changes DOM but rendering is not affected (rp auto-closes rb).

&gt; These are results from a text-based search engine and github code search. I
&gt; don&apos;t have a good tool to search web markup so I don&apos;t know how often these
&gt; things show up in the wild.

I understand that. I think this issue is now not about how common it is, but rather if there were any case where changing rp could break. These pages helped me to confirm that my assumption (changing rp auto-closing rule is safe) is still valid.

Note that the site who reported an issue [1] doesn&apos;t render as ruby either, and he uses display:table-cell technique to look like ruby. I don&apos;t think there are many sites that use the technique, but I might try to find rbc and rtc to double-check later.

[1] http://ikilote.net/fr/Collection/Personnalit%C3%A9.html?id=394</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110038</commentid>
    <comment_count>9</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2014-08-08 13:42:07 +0000</bug_when>
    <thetext>So, I fixed rp to not autoclose rtc (in c61397b). However I&apos;m confused about the rest of the discussion about having it not autoclose anything?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110042</commentid>
    <comment_count>10</comment_count>
    <who name="Koji Ishii">kojiishi</who>
    <bug_when>2014-08-08 18:35:43 +0000</bug_when>
    <thetext>(In reply to Robin Berjon from comment #9)
&gt; So, I fixed rp to not autoclose rtc (in c61397b). However I&apos;m confused about
&gt; the rest of the discussion about having it not autoclose anything?

rp to auto-close rtc is a change introduced early this year as you know, and broke at least one existing site though the site is not valid.

rp to auto-close rt is a change introduced years ago, in earlier HTML5 WD, and broke some existing sites. Again, though the sites are not valid, IE6-9 renders such HTML as ruby, and the number of sites the change broke is probably more than the above. Two examples of such sites are:
http://reference.sitepoint.com/html/rp
http://www.w3schools.com/TAgs/tag_rp.asp
but searching in github gives a lot more examples.

So if we change rp not to auto-close rt, it&apos;d be a breaking change against early and current HTML5, but is more compatible with IE6-9. The question here is which is more beneficial for existing contents and for future authors. My opinion is it&apos;s better to change not to auto-close rt. It&apos;s unlikely to break existing contents, it saves sites that were broken by early/current HTML5 spec, and shouldn&apos;t harm future authors almost at all.

Now we started to wonder, should rp auto-close rb or any other elements that have implied end tags.

Benefits for rp to auto-close rb/others:
* can&apos;t think much, little to zero

Downside for rp to auto-close rb/others:
* rp behaves differently from any other tags (if we change it not to auto-close rt), so it requires additional &quot;if&quot; statement in the spec and code.
* It will auto-close any new elements we may add in future.

Benefits for rp not to auto-close rb/others:
* Saves sites created for IE6-9.

Downsides for rp not to auto-close rb/others:
* Breaks sites created for HTML5 and relies on rp&apos;s auto-closing behavior. Sites that use &quot;rp { display: none; }&quot; are ok, but wchen found some sites use &quot;ruby &gt; rp { display: none; }&quot; so such sites may break if they omit closing tags.

By reviewing this, it looks to me that benefits to auto-close and downsides not to auto-close look much less than benefits not to auto-close and downsides to auto-close.

Does this clarify? Could you clarify what confused you if not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110059</commentid>
    <comment_count>11</comment_count>
    <who name="Zéfling">zefling</who>
    <bug_when>2014-08-11 11:42:13 +0000</bug_when>
    <thetext>&gt; Note that the site who reported an issue [1] doesn&apos;t render as ruby either,
&gt; and he uses display:table-cell technique to look like ruby. I don&apos;t think
&gt; there are many sites that use the technique, but I might try to find rbc and
&gt; rtc to double-check later.
&gt; 
&gt; [1] http://ikilote.net/fr/Collection/Personnalit%C3%A9.html?id=394

In fact, I took this technique to my website by taking example on other websites. (Besides, it also works for IE9 and superior, but not IE8 and earlier)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121034</commentid>
    <comment_count>12</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2015-06-16 10:09:57 +0000</bug_when>
    <thetext>Agree that it would be good to have a spec change here, and raising priority after reviewing implementer feedback.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126236</commentid>
    <comment_count>13</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2016-04-27 22:05:04 +0000</bug_when>
    <thetext>HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/288

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

    </bug>

</bugzilla>