W3C home > Mailing lists > Public > www-style@w3.org > July 2011

Re: [css3-color] Definition of 'opacity' makes no sense for block-inside-inline situations

From: Anton Prowse <prowse@moonhenge.net>
Date: Sun, 03 Jul 2011 14:28:23 +0200
Message-ID: <4E106067.1030700@moonhenge.net>
To: www-style list <www-style@w3.org>
CC: Alan Gresley <alan@css-class.com>, robert@ocallahan.org, Boris Zbarsky <bzbarsky@mit.edu>
On 03/07/2011 13:41, Alan Gresley wrote:
> On 3/07/2011 7:58 PM, Anton Prowse wrote:
>> On 31/05/2011 05:52, Robert O'Callahan wrote:
>>> On Tue, May 31, 2011 at 3:32 PM, Boris Zbarsky<bzbarsky@mit.edu> wrote:
>>>
>>>> <http://www.w3.org/TR/2010/PR-css3-color-20101028/#transparency>Note
>>>> that
>>>> making the inline a generate a stacking context (which opacity does)
>>>> doesn't
>>>> help, since for inlines generating stacking contexts the painting
>>>> specified
>>>> in Appendix E.2 step 6 says to just paint the boxes of the inline
>>>> that are
>>>> in line boxes and does NOT say to paint the block. This means that the
>>>> block child is painted in the normal way as a block child of the
>>>> nearest
>>>> ancestor block of the inline in E.2 step 7.
>>>>
>>>
>>> I think we should alter Appendix E step 6 so that it paints the block
>>> children of the inline.
>>>
>>> It seems clear to me that authors would expect the anonymous block be
>>> painted as part of the opacity group. As you say, that requires that the
>>> anonymous block be painted as part of the stacking context for the
>>> inline.
>>
>> Me too. It seems to me that this is a mistake in Appendix E which fails
>> to take block children of inlines into account.
>>
>> Cheers,
>> Anton Prowse
>
>
> I have noticed that this does not just apply to opacity but to normal
> background-color. Consider this test case. Why does the anonymous block
> (with inlines) of the paragraph, not have a background-color?
>
> <!doctype html>
> <style type="text/css">
> p {background: green; border: 10px solid blue; }
> div {background: red; }
> </style>
> <p><div>Block</div> This paragraph should have a green background.</p>

That's a different thing entirely.  Your HTML is invalid (div inside p) 
and so browsers are fixing it up for you by immediately closing the 
<p>s.  If you want to test block inside inline, a good choice is to use 
p inside div and then use CSS to change the display type of the div to 
inline.

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Sunday, 3 July 2011 12:29:26 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:42 GMT