anchor.diff:    void addExtension(
         SelectorList extender, SimpleSelector target, ExtendRule extend,
         [List<CssMediaQuery> mediaContext]) {
  +    var rules = _selectors[target];
  +
  +    Map<ComplexSelector, ExtendState> newExtenders;
       var sources = _extensions.putIfAbsent(target, () => {});
  -    var existingState = sources[extender];
  -    if (existingState != null) {
  -      // If there's already an extend from [extender] to [target], we don't need
  -      // to re-run the extension. We may need to mark the extension as
  -      // mandatory, though.
  -      existingState.addSource(extend.span, mediaContext,
  +    for (var complex in extender.components) {
  +      var existingState = sources[complex];
  +      if (existingState != null) {
  +        // If there's already an extend from [extender] to [target], we don't need
  +        // to re-run the extension. We may need to mark the extension as
  +        // mandatory, though.
  +        existingState.addSource(extend.span, mediaContext,
  +            optional: extend.isOptional);
  +        continue;
  +      }
  +
  +      var state = new ExtendState(extend.span, mediaContext,
             optional: extend.isOptional);
  -      return;
  -    }
  -
  -    var state =
  -        new ExtendState(extend.span, mediaContext, optional: extend.isOptional);
  -    sources[extender] = state;
  -
  -    for (var complex in extender.components) {
  +      sources[complex] = state;
  +
         for (var component in complex.components) {
           if (component is CompoundSelector) {
             for (var simple in component.components) {
  
positive.code: 
    /// A map from all extended simple selectors to the sources of those
    /// extensions.
    final _extensions = <SimpleSelector, Map<SelectorList, ExtendState>>{};
  
    /// An expando from [CssStyleRule] to media query contexts.
    ///
  
negative.code:   /// If [replace] is `true`, this doesn't preserve the original selectors.
    List<List<ComplexSelector>> _extendComplex(
        ComplexSelector complex,
        Map<SimpleSelector, Map<ComplexSelector, ExtendState>> extensions,
        List<CssMediaQuery> mediaQueryContext,
        {bool replace: false}) {
      // This could be written more simply using [List.map], but we want to avoid
  