Re: Last call comments on CSS3 module: color; musing and a transparent question

Jonny Axelsson wrote:
> 
> When color == transparent and background =/= transparent, is the color "on 
> top of" the background color, or is it a punch-through?

On top of.


> In other words if you have a red box on a yellow box and the text in the red 
> box is transparent, will the text be red or yellow? I assume it will be red, 
> but I could not see anything definite one way or the other.

Red.

This is covered by the painting order rules, which say that backgrounds come 
first, then text is overlayed on top.

CSS3 will hopefully make this more explicit somewhere, but the painting order 
goes something like this.

  * (0) Starting from the initial containing block's (ICB) stacking context:
   * (1) For each non-inline box in the local stacking context in turn, excluding
     those that are in floats and do not introduce a new stacking context, first
     sorted by stack level, then having in-flow boxes before floating boxes, and
     then in document order:
    * Background color
    * Background image
    * Border
    * Outline
    * If the box creates a new stacking context, contents of the stacking context
      (inserted atomically), recursing from (0) using this box as the ICB
    * If the box is a float, then for each non-inline in-flow or positioned box
      in the float that does not create a local stacking context, in turn in
      document order, recurse from (1)
    * If the box is a replaced element, then the replaced content
   * (2) For each inline box in the same stacking context with no inline
     ancestors except the root of the stacking context, in turn in document
     order:
    * Inline background color
    * Inline background image
    * Inline border
    * Inline outline
    * Inline underline
    * Inline overline
    * Inline text or replaced content
    * For each inline box having this box as its nearest inline ancestor, recurse
      from (2) using this box as the root of the stacking context
    * Inline line-through

Did I miss anything?

-- 
Ian Hickson
``The inability of a user agent to implement part of this specification due to
the limitations of a particular device (e.g., non interactive user agents will
probably not implement dynamic pseudo-classes because they make no sense
without interactivity) does not imply non-conformance.'' -- Selectors, Sec13

Received on Thursday, 23 May 2002 22:57:04 UTC