- From: Maciej Stachowiak <mjs@apple.com>
- Date: Sun, 6 May 2007 16:41:49 -0700
- To: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
- Cc: Dão Gottwald <dao@design-noir.de>, www-html@w3.org, public-html@w3.org
On May 6, 2007, at 3:51 PM, Benjamin Hawkes-Lewis wrote: > > Dão Gottwald wrote: >> Benjamin Hawkes-Lewis schrieb: >>> If AT had better support for CSS, and CSS had style selectors, >>> we'd be in a slightly happier place: >> Ah, style selectors once again ... >> :style("font-style:normal") { >> font-style: italic; >> } >> :style("font-style:italic") { >> font-style: normal; >> } >> See what happens? > > Hmm. Wouldn't that only be problematic if an equal weight has to be > given to both rules? I'd say the second rule would take precedence, > such that all text styled italic would be styled normal. In other > words: > > A is now B. > > B is now A. > > So we are back at A, like a chameleon. Note that this requires you to compute the style at least twice to detect the loop (in this case some simple analysis of the style rules might allow you never to get into it, but that would give different behavior, consider if the rules above also had color: red and color: green property definitions respectively. Is the text red, green, or unaffected by color? > Alternatively, one could require UAs to ignore self-contradictory > property declarations used with style selectors. Due to inheritence, compound selectors, specificity ordering and the cascade, cases of the phenomenon cited by Dão can actually be quite a bit more complex. It's probably not worth the extra complexity in the CSS model to make it self-referential in this way. Regards, Maciej
Received on Sunday, 6 May 2007 23:42:05 UTC