[css-ruby] Autohiding text comparison and display: none
elements
#3972
Labels
css-ruby-1
Current Work
display: none
elements
#3972
@dholbert filed a Gecko bug (about a wpt failure due to our autohiding implementation) which brought my attention to an early discussion about autohiding and out-of-flows.
In that thread, @fantasai mentioned that the comparison currently should also include
display: none
elements, but it's open to change based on implementation feedback.After looking into Gecko's implementation as well as the spec, I think
display: none
element should be excluded from the text comparison of autohiding.The reason is that ruby boxes can be generated from other boxes, and the generated boxes can involve in autohiding. At the ruby box generation time,
display: none
elements are already dropped. In this sense, I don't think the generated boxes includedisplay: none
elements conceptually.Currently, Gecko get the text to compare via traversing the rendering tree (frame tree in Gecko's term) and collecting text from text nodes mapped from there. It has several implications:
display: none
nodes since they are not in the rendering tree,Although it is theoretically possible to find the complete corresponding content of a generated box, it could be more work to do especially considering
display: none
elements on the boundary of the boxes (There would be a spec question for this: are they included? If so we need to try find them somehow since they have been excluded from box generation. If not, why? Withdisplay: none
s in the middle being included, that would feel inconsistent.)So, I think it would be easier both conceptually and implementation-wise to exclude
display: none
elements.That brings another question, what should we do with out-of-flows? Gecko currently ignores them in text comparison but hides them with autohiding (which feels rather unfortunate to be honest), but it can be trivially fixed. However, if we use the text based on rendering tree, then are out-of-flows still considered boxes from the ruby boxes?
If there is nothing conceptually wrong to continue including out-of-flows, I'm happy to have Gecko fixed for this case. But it is less trivial to handle
display: none
s so I suggest we exclude them.The text was updated successfully, but these errors were encountered: