Re: [CSS3] Generated and Replaced Content - Grouping (long, examples)

On Thu, 30 Oct 2003, Afternoon wrote:
>> If you can write an actual spec for this, I would love to see it. And
>> would probably incorporate it into the CSS3 module. :-)
> I do wonder if providing a quite large but powerful syntax for
> selecting arbitrary sets of tags from a level playing field is
> something that's best left out of CSS

Especially since XPointer has already defined this in some detail...

See, this is the problem. As soon as you try to develop a syntax, it
becomes ridiculously complicated very quickly.

Maybe a better solution is "bookmarks":

   dl > dt:first-child { flow-bookmark: start definition inclusive }
   dl > dd + dt { flow-bookmark: end definition exclusive,
                                 start definition inclusive }
   dl > dd:last-child { flow-bookmark: end definition inclusive }

   dl::bookmarked-flow(definition) { ... }

Could that do the things I mentioned? Would it makes sense? (It requires
that you compute the styles of your children before doing the flowing,
which would lead to some interesting inheritance issues, I guess.)

> [...] and grouping created by adding real document structure. Your
> example with the img and the caption is a good one that occurs in real
> HTML, but would any proposed solution ever be as elegant as just
> sticking a div tag around the required elements?

There are many reasons why you can't change the HTML. First of all, the
language in question (HTML here, but it could be another one) might not
allow nesting as you want it (as is the case with <dl>). Secondly, you
might not have control over the documents you are styling. Or you might
want to style something that doesn't really map to structure (first two
sections on the left, next two on the right, with border around them).

There are many times where you want to style something that doesn't map to
an element and isn't ::before/::after/::outside, and would be very awkward
to handle through move-to/pending() (now called flow and flow(), btw).

XSLT/STTS can of course solve some of this, but is massive overkill for
the problems being solved here. It also fails to truly solve the problem,
as it (a) doesn't work with alternate stylesheets and (b) changes the DOM,
thus breaking scripts that do not know about the transform. It also has
limited client-side support, and you don't want to be converting vald HTML
into an invalid variant for styling on the server side, since that would
mean you weren't sending optimally accessible content over the wire.

Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.                         `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 30 October 2003 16:36:18 UTC