On 21/05/2013 11:04, fantasai wrote:
> First thought: I don't think this belongs on 'overflow'. That
> says how to handle overflow, not how to style the visible content.
In the case of extending 'overflow', I'd imagine the fade would go on the
outside of the clip rect rather than on the inside. I.e.:
|<--- border-box width --->|
|<--- width of the content that's inside the element --->|
fade area --->| |<---
rather than:
|<--- border-box width --->|
|<--- width of the content that's inside the element --->|
fade area --->| |<---
Combined with a matching length for 'margin-right' that would seem to work, but
very possibly it's not what you'd want in general.
> 'text-overflow: fade <length>' seems to make sense to me. But
> I can also see cases where you'd want to fade other kinds of
> overflow, too, though.
Are you thinking specifically of the overflow controlled by the 'overflow'
property, or something else?
> I've also seen cases where you want to
> overlay a gray-transparent gradient, though, so it's not
> necessarily a fade that's wanted.
When would you want that rather than a gradient mask?
> Another consideration: do we want here a linear gradient or a
> Gaussian or some other curve?
I was thinking linear would be most widely useful and keep things simple, but
maybe it's just wishful thinking.
> Also, this should probably go to www-style. ;)
Indeed. I was just looking for some moz community thoughts and sanity checking
before we take anything to www-style.
> Wrt working around the SVG mask issues -- see the CSS Masking
> spec. It should handle what you want. The main issue is how
> to trigger it only when there's overflow.
Interesting. But without some sort of calc() support in linear-gradient(), I
don't think that linear-gradient() would solve the Australis theme use case. We
basically want to mask with a mask containing a gradient producing "maximum
luminosity from the start of the element to calc(width-2em), then fades to zero
from calc(width-2em) to width".
Allowing SVG gradients to be referenced from linear-gradient() doesn't seem to
provide the flexibility we need, since the way that objectBoundingBox is defined
prevents <length>s with units from being usable inside such a mask. That's
because objectBoundingBox is defined in terms of a transform that maps 1px to be
the width/height of the element's bbox. The only realistic way to allow the
content of a mask to have percentage lengths that are resolved against the size
of the element _and_ <length>s with units is to add a third value for
maskContentUnits, I think. ("objectBoundingBox2"?)
BTW, for the Australis theme, it may be acceptable to just have the right hand
side of the text fade regardless of whether it actually overflows or not.
Thanks,
Jonathan
>
https://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html
>
> ~fantasai
>