Re: [css4-images] element() syntax (was: First draft of css4-images, feedback requested)

On Thu, Aug 9, 2012 at 9:00 AM, Simon Fraser <smfr@me.com> wrote:

> It also means that the appearance of descendants of the element() target
> may change when rendering for element(), because of z-order. Consider:
>
> <div id="box" style="position: absolute; background-color: blue;">
>     <div style="background-color: green; position: absolute; z-index:
> -1"></div>
> </div>
>
> <div style="background: element('#box')"></div>
>
> The original #box will look like a blue square, but when rendered for
> element()
> it will show green.
>

That's true, but the alternatives are worse IMHO.

If it is really impossible for you to handle cases where the target is not
a stacking context, I think the next best solution would be to say that for
element() only renders elements in a document if they meet certain criteria
that guarantee they'll be visually atomic. E.g., we could require that the
target element is either a replaced element or positioned with z-index not
'auto'. (I think that's more confusing for authors than what's currently
specced though.)

Another questions about element(); does clipping via overflow or clip
> on the target element or any ancestor affect the element() rendering? I
> could imagine
> a use case where the original element has overflow:hidden, but when
> rendered via
> element() it displays unclipped.
>

I think clipping on the target element should take effect, but clipping on
ancestors should not.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]

Received on Wednesday, 8 August 2012 23:01:24 UTC