Created attachment 70615 [details]
See attached test case, or try switching Furigana on at <http://kids.gakken.co.jp/kagaku/110ban/text/1480.html>.
I'm not sure whether this is really expected to work. The default style for rt is block, but the site sets it to inline when toggling ruby on. But then, CSS3 Ruby Module has a whole lot of custom display styles for ruby, see <http://www.w3.org/TR/css3-ruby/#display>. So, perhaps both block and inline need some custom translation when applied to this element.
I haven't checked whether this works in IE8.
I checked now, and this works in IE.
It could be argued that the current behavior is correct as the ruby text is displayed inline, rather than as ruby text, just as specified by the JS.
Toggling works if the code is changed to toggle between 'none' and empty string (i.e., not overwriting the browser default.
It doesn't work correctly if toggling between 'none' and 'ruby-text' - this is due to the fact that so far we avoided implementing the ruby-specific display types, because of questions of the state and direction of the ruby spec(s). IIRC the current code explicitly "aborts" ruby rendering if the user tampers with the display type.
If compatibility with IE is a goal, then one short term solution might be to just entirely ignore the display type on <rt> unless it's 'none', but I'm not sure that's a good idea. OTOH, even if we fully implement the ruby display-types, the example would still not work as intended, because it'd then need to specify 'ruby-text' rather than 'inline' (the latter would continue to be displayed as-is).
Any inputs or other suggestions?
From the very little data that I have (this single site), it appears that IE compatibility can be a reasonable goal, yes.
Ignoring the display type is probably ok actually. I imagine that's what IE is doing.
Ignoring the display type does, however, imply that you could never (e.g., in user style sheets, or using JS) change <rt> to be displayed inline rather than as ruby text, on any site or device.
Are you positive that sacrificing this functionality is a good exchange for the sake of IE compatibility?
Would it make sense to decide whether to display <rt> inline based on whether <rp> was forced to be anything but display:none?
I'm not sure about this suggestion - on one hand it could certainly serve as a heuristic.
On the other hand, not all ruby uses <rp>, and it would be a pretty opaque condition to describe to new developers.
See also: bug 44515.