Re: CSS2 errata - border backgrounds

On Thu, 19 Jul 2001, fantasai wrote:
>
> Consistency goes either way. And even though CSS1 explicitly paints
> borders on top of the background, with the current state of browser
> implementations and CSS2 wording, I think it would be easier to
> correct the one passing mention of background in the border area in
> 8.5.3 than the five (or six) instances of just content & padding.

I assert that the spec actually says that the background images should be
relative and clipped to the padding edge, while the background colours
should be painted up to the border edge. This is implemented in at
least two browsers (Netscape 6.x and Opera).

According to the CSS2 spec, section 14.2.1, background-position specifies
the position of a background image relative to the padding edge of a box,
and tiling should cover only the content and padding areas of a box:

#   All tiling covers the content and padding areas of a box.
#   ...
#   If the background image is fixed within the viewport (see the
#   'background-attachment' property), the image is placed relative to the
#   viewport instead of the element's padding area.

And, according to section 8.5.3, borders are drawn on top of a box's
background:

#   All borders are drawn on top of the box's background.

This logically means the background color should be underneath the border,
but not the background image.


> I think it would be easier to correct the one passing mention of
> background in the border area in 8.5.3 than the five (or six)
> instances of just content & padding.

The instances are already corrected -- see the errata. The only
outstanding errata item is that the spec should more explicitly state that
the background images are clipped to the padding edge.

This testcase demonstrates why it is IMHO nicer for the background images
not to overlap the border:

   http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/backgroundimage.html

Changing the spec at this point should be avoided if at all possible,
since it would break at least two pre-existing implementations, namely
Opera and Netscape.

-- 
Ian Hickson                                            )\     _. - ._.)   fL
Invited Expert, CSS Working Group                     /. `- '  (  `--'
The views expressed in this message are strictly      `- , ) -  > ) \
personal and not those of Netscape or Mozilla. ________ (.' \) (.' -' ______

Received on Friday, 20 July 2001 07:24:31 UTC