Re: [css3-page][css3-mediaqueries] Changing element styles on page breaks

Le 21/02/2012 17:20, Brad Kemper a écrit :
> If styling the page box meant typing ':page { color:green; }'
> instead of just 'color:green;' by itself, it need not have an effect
> on the way margin boxes inherit. Counter-increment could likewise go
> inside ruleset braces  with a ':page' selector, without any adverse
> effect.

Are you suggesting to change the syntax for declarations in @page? The
current syntax being eg. @page { margin: 2cm }

This syntax is already in CSS 2.1 so I don’t think we can change it. 2.1
even defines that @page can contain both declarations and at-rules
(although no such at-rule is defined in that level) but nothing else.


Le 24/02/2012 00:28, Tab Atkins Jr. a écrit :
> On Tue, Feb 21, 2012 at 8:20 AM, Brad Kemper <brad.kemper@gmail.com>
> wrote:
>> If I can set a separate color to the first line of a span of text,
>> why can't I also set a separate color to a the part of an inner
>> span within the first line?
>
> Because the well-behaved pseudo-elements are leaf nodes, while
> ::first-line either has descendants (and thus the box-tree is no
> longer a tree, as elements have two parents), or is broken up and
> nested tightly inside of elements (in which case it's a leaf node).
>
> Depending on how Web Components handle selectors, we may eventually
> have well-behaved non-leaf pseudo-elements, but they don't exist
> yet.

I don’t understand the part about elements having two parents. Could you
explain a bit more?

As I understand it there are two box trees for document. The first one 
is "before layout" and is built from the element tree as described in 
9.2 of css21. The other one is "after layout" and has page boxes, line 
boxes etc. A box from the first tree may have been fragmented into 
multiple boxes in the second tree, but it’s still a tree. In that tree, 
line boxes do have descendants.

Regards,
-- 
Simon Sapin

Received on Friday, 24 February 2012 14:53:33 UTC