Re: [css3-background] "Margins are always transparent" missing

Le Mer 10 avril 2013 1:30, Brad Kemper a écrit :
> On Apr 9, 2013, at 7:14 PM, "G¨¦rard Talbot" <www-style@gtalbot.org>
> wrote:
>
>> Hello,
>>
>> One particular statement from CSS 2.1 seems to be missing from CSS 3
>> Backgrounds and Borders spec.
>>
>> "
>> 'background' refers to the background of the content, padding and border
>> areas. (...) Margins are always transparent.
>> "
>> CSS 2.1, section 14.2 The background
>> http://www.w3.org/TR/CSS21/colors.html#background
>>
>>
>> "
>> The background style of the content, padding, and border areas of a box
>> is
>> specified by the 'background' property of the generating element. Margin
>> backgrounds are always transparent.
>> "
>> CSS 2.1, section 8.1 Box dimensions
>> http://www.w3.org/TR/CSS21/box.html#box-dimensions
>>
>>
>> The background (background-color and/or background-image) of an element
>> never paints its margin area ... except for the root element, this being
>> the only exception in this case ("The background of the root element
>> becomes the background of the canvas and covers the entire canvas").
>>
>> I can not find a similar statement anywhere in CSS 3 Backgrounds and
>> Borders spec.
>>
>> Actual
>> ------
>> Each box has a rectangular content area, a band of padding around the
>> content, a border around the padding, and a margin outside the border.
>> (The margin may actually be negative, but margins have no influence on
>> the
>> background and border.)
>>
>> Proposed
>> --------
>> Each box has a rectangular content area, a band of padding around the
>> content, a border around the padding, and a margin outside the border.
>> <ins>Margins are always transparent.</ins> (The margin may actually be
>> negative, but margins have no influence on the background and border.)
>>
>> coming from
>> CSS Backgrounds and Borders, section 1. Introduction
>> http://www.w3.org/TR/css3-background/#introduction
>
> This doesn't seem necessary. The margin is only mentioned non-normatively
> in that introductory section,

Fair enough. I propose then to indicate normatively somewhere (not
determined yet) that
- background (background color and background image) do not paint into the
margin area of an element and/or
- background (background color and background image) refers exclusively to
(or draws exclusively or paints exclusively) the background of the content
area, padding area (if any) and border area (if any) and/or
- background (background color and background image) of an element is
never painted into its own margin area.

> and the background painting area is well
> defined in a way that does not include painting in the margins.
>
> http://www.w3.org/TR/css3-background/#background-clip
>


I still do not see where this is explicitly stated. As presented,
background-clip defines (can set) the background painting area; but
nowhere does it say that background (background color and background
image) - by definition - of an element is never painted into its own
margin area.

I found a 3rd place where CSS 2.1 indicates that margin area of an element
is transparent: in this schema
http://www.w3.org/TR/CSS21/box.html#img-boxdim
we can read TM Margin (Transparent)

> Also, technically, the border-image can paint into the margins,

Yes, but border-image is not background.

> and so can
> the box-shadow.

Box-shadow is not background. My post was about background.

> So maybe it would not clarify anything to stress the
> transparency of the margins. The margin itself is transparent, sure, but
> since this spec is not about the rendering of margins,

CSS3 box model module
8. The 'margin' properties
http://www.w3.org/TR/2001/WD-css3-box-20010726/#the-margin
does not state nor suggest that the background (background color and
background image) of an element never paints into its own margin area.

But, on the other hand, we can read that
"
The color/pattern of the element's background extends into the padding.
See the 'background' property.
"
CSS3 box model module, 5. The 'padding' properties
http://www.w3.org/TR/2001/WD-css3-box-20010726/#the-padding

and

"
The background of the element extends into the border area. See the
'background' property.
"
CSS3 box model module, section 6. The 'border' properties
http://www.w3.org/TR/2001/WD-css3-box-20010726/#the-border


> I think the clear
> definitions of where things in this spec do paint are sufficient.

I disagree. Everywhere (CSS 2.1, CSS 3 Backgrounds and Borders, CSS 3 Box
model) I read, I see a statement missing or silence or a weakness in the
spec or a perfectible diagram. The specs (CSS 3 Backgrounds and Borders,
CSS 3 Box model) should promote understanding, reduce sources of
confusion, misunderstanding.

Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Wednesday, 10 April 2013 19:41:31 UTC