- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Fri, 6 Feb 2015 11:13:42 +1100
- To: Rune Lillesveen <rune@opera.com>
- Cc: Hayato Ito <hayato@google.com>, www-style list <www-style@w3.org>
On Fri, Feb 6, 2015 at 11:08 AM, Rune Lillesveen <rune@opera.com> wrote: > On Thu, Feb 5, 2015 at 10:02 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > >> No, you're misusing the cascade. It produces an ordering by applying >> the rules in the order specified. The Shadow Tree rules produce only >> a partial ordering, but still. >> >> In this example, then: >> >> 1. Origin doesn't matter. All three are still unsorted. >> 2. Shadow Tree Ancestor doesn't matter. All three are still unsorted. >> 3. Shadow Tree Age sorts #3 ahead of #2. #1 is still unsorted relative to them. >> 4. Specificity sorts #1 ahead of #3. You now have a total ordering. > > Humm. I think that means we'll have to start cascading declarations > independently in Blink (we currently cascade style rules, although > independently per selector in the selector list). If you add > background color to #2 and #1 (and not #3), the color from #1 should > apply and the background-color from #2 should apply, right? Hmm, you're right, this isn't very stable. If you remove #3, it completely changes the ordering, so that #2 sorts ahead of #1, rather than at the end. The ordering of any two declarations shouldn't be affected by the presence or absence of other declarations. We should fix this up somehow to make things work better. It probably means adding some special cascade behavior for ::content? ~TJ
Received on Friday, 6 February 2015 00:14:30 UTC