- 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>
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 UTC