Re: Text selector [was Re: breaking overflow]

On Mon, Jan 4, 2010 at 10:24 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 1/4/10 11:10 AM, Tab Atkins Jr. wrote:
>>>
>>> Hold on.  Why would we ever allow ::text to have a 'display' property
>>> set?
>>>  What are the use cases?  I have been assuming that ::text would have
>>> restrictions similar to first-letter and first-line.
>>
>> I guess we can assume similar restrictions.  Assume, then, that I
>> instead applied float:left;clear:left;.
>
> 'float' does not apply to first-line.  'clear' does not apply to either
> first-line or first-letter.
>
> Precisely for the reasons you describe, fwiw.

Ah, sorry.  I was looking at the ::first-letter restrictions, and
furthermore was looking at a w3schools page because it was first in
the search results.  It listed clear as applying, which is obviously
wrong now that I look at CSS2.

> Note that I'm OK with ::text not matching across element boundaries, at
> first glance, and not entirely convinced we want a ::text at all, but if we
> _do_ have it, I think it should have restrictions similar to first-line at
> least.

If we *don't* allow it to match across element boundaries, then is
there a good reason for the restrictions?  I don't believe there is.
I'm not seeing anything wrong with, say, turning an arbitrary span of
text into a display:table-cell as long as it can be wrapped in a
single pseudoelement box.  There is significant power to be gained by
allowing the full suite of properties on ::text, which is a very
strong argument for not allowing it to cross element boundaries.

I gave an example earlier of a site header with specially-formatted
text that I had to do with multiple meaningless spans.  Being able to
use ::text to select, size, and position those would be very helpful.
My company's main site, www.igofigure.com, has essentially the same
situation with its site header.  I really want to be able to position
these things, and can't do that if we apply ::first-line restrictions.

~TJ

Received on Monday, 4 January 2010 16:52:59 UTC