Open zcorpan opened 7 years ago
From the spec:
An rp element that is a child of a ruby element represents nothing. An rp element whose parent element is not a ruby element represents its children.
In the absence of style-layer rules to the contrary (e.g. author style sheets), user agents are expected to render an element so that it conveys to the user the meaning that the element represents, as described by this specification.
[hidden], area, base, basefont, datalist, head, link, menu[type=context i], meta, noembed, noframes, param, rp, script, source, style, template, track, title { display: none; }
This is not internally consistent, so that should be fixed (regardless of which UA style we decide on).
I'm fine with Edge or Gecko. Thank you for your investigations.
I'd prefer Gecko's current behavior, but I don't have strong opinion against Edge's, so if the webcompat impact is reasonable, I'm fine with Edge's behavior.
I have one concern that, per CSS Ruby spec, <rb>
, <rt>
, and <rtc>
can appear outside <ruby>
, and anonymous boxes would be built up automatically. In that case, only hiding <rp>
in <ruby>
may lead to some <rp>
s stop working while they are expected to. That kind of automatic box-building is only supported in Firefox, so it is probably not a serious issue. <rt>
outside <ruby>
doesn't work in other browsers at all currently.
Another edge case would be using inline-blocks inside ruby, then its descendant <rp>
s would suddently disappear with Edge's behavior. But that doesn't seem to be a sensible usecase.
The anonymous box case sounds reasonable. @zcorpan do we know someone to ask the opinion from Edge on this topic?
Using rp
(or rt
etc) outside ruby
is invalid HTML. There is no use case for it.
Using the CSS ruby model with anonymous boxes is fine, but that has nothing to do with using the rp
element not in a ruby
element. span
or something should be used.
While it is reasonable to think that it is expected that an rp
not in ruby
should still be hidden, I have not found any real-world page where that expectation holds. I have only found one page that is affected, and it had the opposite expectation.
Another edge case would be using inline-blocks inside ruby, then its descendant
<rp>
s would suddently disappear with Edge's behavior. But that doesn't seem to be a sensible usecase.
If the author explicitly sets display
on rp
, then that would be honored. Testing with http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4714 shows that it is honored in Edge 13, but still hidden in IE 8..11. I can update the OP with this test case.
cc @gregwhitworth for opinions from Edge.
I propose closing this issue as no change. We currently have interop across Gecko and Blink, I can't think of a use case for anything more complicated, and it's the simplest and most performant of the options presented.
Ah, so Blink changed something since https://github.com/whatwg/html/issues/2134#issue-193437288? Sounds good. Does Safari need a bug?
Ah, so Blink changed something since #2134 (comment)?
Yes, crbug.com/859416 in 2018.
cc @rniwa
This test covers this (through innerText
, I don't know if there's a more direct test currently):
Lone <rp> ("<div><rp>abc</rp>")
https://wpt.fyi/results/html/dom/elements/the-innertext-idl-attribute/getter.html?label=experimental&label=master&aligned
It seems we don't have interop on the default style of
rp
.Tests: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4711 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4714
'display' is...
<p><ruby><rp>
<p><ruby><rtc><rp>
<p><ruby><span><rp>
<p><rp>
<p><ruby><rp style="display: inline-block">
That is, we have these UA stylesheets:
ruby rp { display: none; }
ruby > rp { display: none; }
rp { display: none; }
ruby rp { display: none !important; }
rp { display: none !important; }
Currently the spec says Gecko, IE 10..11 are correct.
In httparchive, looking for pages that have
<rp>
but no<ruby>
, I found a single page that is "broken" in Gecko but not in the others:http://www.kerala.com/ has
(The cufon thing inserts a
canvas
into therp
to render some glyph.)The Blink and WebKit default style seems incompatible with
rtc
(#121). Gecko is simplest, but it is the only engine now to hiderp
outsideruby
, and it breaks at least the page above. Should we switch to the behavior of Edge 13?cc @upsuper @yosinch @kojiishi @rniwa