On Tue, Nov 2, 2010 at 8:15 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 11/2/10 10:56 AM, Rob Crowther wrote:
>
>> The selector 'div:empty' only selects div one, because all the others
>> end up with an all whitespace text node as a child.
>>
>
> For what it's worth, this is why Gecko has a :-moz-only-whitespace (that we
> mostly use in our quirks-mode stylesheet)....
Another common use-case for this sort of thing is to keep empty block nodes
from collapsing in rich-text editing contexts. As it is now, libraries do
all sorts of hackery to make sure they always have at least a non-breaking
space. :empty doesn't work for the same reasons, but :-moz-only-whitespace
ought to.
Ojan