W3C home > Mailing lists > Public > www-style@w3.org > June 2010

Re: [css3-text-layout] margin-before/after/start/end etc. and :ttb pseudo-classes

From: John Daggett <jdaggett@mozilla.com>
Date: Sun, 6 Jun 2010 20:03:40 -0700 (PDT)
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "MURATA Makoto (FAMILY Given)" <eb2m-mrt@asahi-net.or.jp>, www-style@w3.org, Brad Kemper <brad.kemper@gmail.com>
Message-ID: <977482599.370729.1275879820909.JavaMail.root@cm-mail03.mozilla.org>
fantasai wrote:

> With regards to pseudo-selectors,
> 
> 1. At no point in time has the Working Group seriously considered
>    a selector that keys off the value of another CSS property. *All*
>    such proposals have been rejected outright because of the kind of
>    problems Brad points out here.
> 
>    Selector matching is currently an process that is completely
>    independent of the cascading, inheritance, and computing stages of
>    CSS, and it is my strong opinion that it should remain that way.

So the problem is one of circular references, the style rules defined
for a given pseudo-selector could change the conditions?  E.g.

  p:writing-mode(tb-lr) {
    writing-mode: lr-tb;
  }

If there's no easy way of working around bad interactions like this,
then maybe features queries (i.e. @supports) would suffice to allow
graceful fallback?  I think HÃ¥kon mentioned this already.

Background on feature queries:

  http://lists.w3.org/Archives/Public/www-style/2009Dec/0130.html

Using feature queries for handling vertical text with a graceful fallback
for older user agents:

/* default rules for horizontal text */
p, p.yoko { ... }
body { ... }

@supports ( writing-mode: tb-rl; ) {
  p.tate {   /* rules for vertical text */
    writing-mode: tb-rl;
    margin: ... ;
  }
}

<body>
  <p>My beautiful haiku:</p>
  <p class="tate"> ...a pretty haiku... </p>
  <p>By John</p>
</body>

The first and third paragraphs would be rendered horizontally, the
middle paragraph vertically.  For older user agents, the middle
paragraph would render horizontally *without* using the rules inside
the @supports { } feature query.

John Daggett
Received on Monday, 7 June 2010 03:04:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:28 GMT