RE: [css-selectors] Selecting non-element nodes

> Can you explain why you want to hide text but not remove it from the DOM?

In the context of a [css-regions] polyfill, you've to hide content extracted into a flow but it still has to be there in the DOM for the case where the css changes and cancel the flow binding.

Same story for the content already in a css region, it has to stay in place in the DOM but cannot be displayed. It happens that sometimes the only content of a region is a "Loading" or another placeholder text.



>> It's not the first time this issue comes on the table,
>
> Do you have a pointer? I believe that the use cases would be very
> different in stylesheets vs. APIs, maybe the solutions should be as well.

A quick search yielded:

http://lists.w3.org/Archives/Public/www-style/2013Jul/0031.html
http://lists.w3.org/Archives/Public/www-style/2010Dec/0439.html
http://lists.w3.org/Archives/Public/www-style/2006Jun/0023.html



> Exactly what types of nodes would this apply to?
> How do you define a node? Eg. is this more than one node? Foobar
> What are the semantics when used in a stylesheet? In selector APIs?

It's up to the DOM to define that. If the DOM had one text node per letter, so let it be. CSS only define hooks for the DOM spec. At least, if you have a comment, you necessarily have two text nodes since text nodes cannot have children.

However, what it means from the layout perspective is that you can target an annonymous box that wraps the text nodes or comments node. By default text nodes are display-inline and comments display-none. You could obviously change that to fit your needs. 

We could by-design restrict the amount of properties you can tweak for those nodes if it can help to ease implementation pain. At least, as you noted, it is certainly useful for selectors API (ie: complete profile). 		 	   		  

Received on Friday, 26 July 2013 17:02:10 UTC