Add as transformed class selector(s), then
remove the deprecated attribute selector
775049
function translateWithValueToCssClass(scope, element, attrs) {
      var updateFn = updateClassWithValue(element, className, attrs);
      var unwatch = attrs.$observe(attrs.$normalize(className), updateFn);

      updateFn(getNormalizedAttrValue(className, attrs, ""));
      scope.$on("$destroy", function() { unwatch(); });
    }
987636
def removeAttributeNode(self, attr: Attr) -> Optional[Attr]:
        """"""
        return self.attributes.removeNamedItem(attr)
1196058
function(element, attrs) {

            var $element = $(element);

            joint.util.forIn(attrs, function(attrs, selector) {
                var $elements = $element.find(selector).addBack().filter(selector);
                // Make a special case for setting classes.
                // We do not want to overwrite any existing class.
                if (joint.util.has(attrs, 'class')) {
                    $elements.addClass(attrs['class']);
                    attrs = joint.util.omit(attrs, 'class');
                }
                $elements.attr(attrs);
            });
        }
674699
def replace(*attributes)
      attributes = safe_array(attributes)
      user_modification_guard
      seen = {}
      filtered = []
      attributes.each do |value|
        matchable = matchable(value)
        unless seen[matchable]
          filtered << value
          seen[matchable] = true
        end
      end
      @target.replace(filtered)
      self
    end
661074
function _handleAttributes(oldNode, newNode, rule, clearInternals) {
    var attributes          = {},                         // fresh new set of attributes to set on newNode
        setClass            = rule.set_class,             // classes to set
        addClass            = rule.add_class,             // add classes based on existing attributes
        addStyle            = rule.add_style,             // add styles based on existing attributes
        setAttributes       = rule.set_attributes,        // attributes to set on the current node
        allowedClasses      = currentRules.classes,
        i                   = 0,
        classes             = [],
        styles              = [],
        newClasses          = [],
        oldClasses          = [],
        classesLength,
        newClassesLength,
        currentClass,
        newClass,
        attributeName,
        method;

    if (setAttributes) {
      attributes = wysihtml5.lang.object(setAttributes).clone();
    }

    // check/convert values of attributes
    attributes = wysihtml5.lang.object(attributes).merge(_checkAttributes(oldNode,  rule.check_attributes)).get();

    if (setClass) {
      classes.push(setClass);
    }

    if (addClass) {
      for (attributeName in addClass) {
        method = addClassMethods[addClass[attributeName]];
        if (!method) {
          continue;
        }
        newClass = method(wysihtml5.dom.getAttribute(oldNode, attributeName));
        if (typeof(newClass) === "string") {
          classes.push(newClass);
        }
      }
    }

    if (addStyle) {
      for (attributeName in addStyle) {
        method = addStyleMethods[addStyle[attributeName]];
        if (!method) {
          continue;
        }

        newStyle = method(wysihtml5.dom.getAttribute(oldNode, attributeName));
        if (typeof(newStyle) === "string") {
          styles.push(newStyle);
        }
      }
    }


    if (typeof(allowedClasses) === "string" && allowedClasses === "any" && oldNode.getAttribute("class")) {
      if (currentRules.classes_blacklist) {
        oldClasses = oldNode.getAttribute("class");
        if (oldClasses) {
          classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP));
        }

        classesLength = classes.length;
        for (; i<classesLength; i++) {
          currentClass = classes[i];
          if (!currentRules.classes_blacklist[currentClass]) {
            newClasses.push(currentClass);
          }
        }

        if (newClasses.length) {
          attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" ");
        }

      } else {
        attributes["class"] = oldNode.getAttribute("class");
      }
    } else {
      // make sure that wysihtml5 temp class doesn't get stripped out
      if (!clearInternals) {
        allowedClasses["_wysihtml5-temp-placeholder"] = 1;
        allowedClasses["_rangySelectionBoundary"] = 1;
        allowedClasses["wysiwyg-tmp-selected-cell"] = 1;
      }

      // add old classes last
      oldClasses = oldNode.getAttribute("class");
      if (oldClasses) {
        classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP));
      }
      classesLength = classes.length;
      for (; i<classesLength; i++) {
        currentClass = classes[i];
        if (allowedClasses[currentClass]) {
          newClasses.push(currentClass);
        }
      }

      if (newClasses.length) {
        attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" ");
      }
    }

    // remove table selection class if present
    if (attributes["class"] && clearInternals) {
      attributes["class"] = attributes["class"].replace("wysiwyg-tmp-selected-cell", "");
      if ((/^\s*$/g).test(attributes["class"])) {
        delete attributes["class"];
      }
    }

    if (styles.length) {
      attributes["style"] = wysihtml5.lang.array(styles).unique().join(" ");
    }

    // set attributes on newNode
    for (attributeName in attributes) {
      // Setting attributes can cause a js error in IE under certain circumstances
      // eg. on a <img> under https when it's new attribute value is non-https
      // TODO: Investigate this further and check for smarter handling
      try {
        newNode.setAttribute(attributeName, attributes[attributeName]);
      } catch(e) {}
    }

    // IE8 sometimes loses the width/height attributes when those are set before the "src"
    // so we make sure to set them again
    if (attributes.src) {
      if (typeof(attributes.width) !== "undefined") {
        newNode.setAttribute("width", attributes.width);
      }
      if (typeof(attributes.height) !== "undefined") {
        newNode.setAttribute("height", attributes.height);
      }
    }
  }
910497
function(e) {
    if (!e || e.tagName.toLowerCase() === 'svg')
      return;

    // Remove `style` and deprecated presentational attributes
    for (var i = 0; i < this.PRESENTATIONAL_ATTRIBUTES.length; i++) {
      e.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[i]);
    }

    if (this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.indexOf(e.tagName) !== -1) {
      e.removeAttribute('width');
      e.removeAttribute('height');
    }

    var cur = e.firstElementChild;
    while (cur !== null) {
      this._cleanStyles(cur);
      cur = cur.nextElementSibling;
    }
  }
1020960
function transformNode(el) {
  const attr = Object.keys(el.attrsMap).find(attr => attr.startsWith('~'))

  if (attr) {
    const attrName = attr.substr(1)
    let [arg, ...modifiers] = attrName.split('.')
    modifiers = modifiers.reduce((mods, mod) => {
      mods[mod] = true
      return mods
    }, {})
    getAndRemoveAttr(el, attr)
    addDirective(el, 'view', `v-view:${attrName}`, '', arg, modifiers)
  }
}
75298
function stringifyAttrs(attrs, tagName) {
  if (!attrs) {
    return '';
  }
  var attributes = [], value;
  for (var key in attrs) {
    value = attrs[key];
    if (key === 'style') {
      value = stringifyStyle(value);
    } else if (key === 'class') {
      value = stringifyClass(value);
    }
    attributes.push(key + '="' + String(value).replace(/"/g, '\\"') + '"');
  }
  return attributes.join(' ');
}
803262
function replaceElement(element, attrs = {}) {
  const elementAttrs = getAttrs(element);
  const name = elementAttrs['data-feather'];
  delete elementAttrs['data-feather'];

  const svgString = icons[name].toSvg({
    ...attrs,
    ...elementAttrs,
    ...{ class: classnames(attrs.class, elementAttrs.class) },
  });
  const svgDocument = new DOMParser().parseFromString(
    svgString,
    'image/svg+xml',
  );
  const svgElement = svgDocument.querySelector('svg');

  element.parentNode.replaceChild(svgElement, element);
}
710799
def construct_selector(self, el, attr=''):
        """"""

        selector = deque()

        ancestor = el
        while ancestor and ancestor.parent:
            if ancestor is not el:
                selector.appendleft(ancestor.name)
            else:
                tag = ancestor.name
                prefix = ancestor.prefix
                sel = ''
                if prefix:
                    sel += prefix + '|'
                sel = tag
                if attr:
                    sel += '[%s]' % attr
                selector.appendleft(sel)
            ancestor = ancestor.parent
        return '>'.join(selector)
647618
function applyClass(token) {
    // init attributes
    token.attrs = token.attrs || [];

    // get index of class attribute
    let keys = token.attrs.map(arr => arr[0]);
    let idx = keys.indexOf('class');

    if (idx === -1) {
        // Add class attribute if not defined
        token.attrs.push(['class', className]);
    } else {
        // Get the current class list to append.
        // Watch out for duplicates
        let classStr = token.attrs[idx][1] || '';
        let classList = classStr.split(' ');

        // Add the class if we don't already have it
        if (classList.indexOf(className) === -1) {
            token.attrs[idx][1] = classStr += ' ' + className;
        }
    }
}
399041
def _transform_options_for_attribute(attr, options={})
      return options unless self.class.respond_to?(:attribute_types)
      options.transform_values {|value|
        self.class.attribute_types.with_indifferent_access[attr].cast(value)
      }
    end
506112
def update_element_css_classes(obj, old_classes, new_classes)
      (old_classes - new_classes).each do |name|
        `#{obj.element}.classList.remove(#{name})`
      end

      (new_classes - old_classes).each do |name|
        `#{obj.element}.classList.add(#{name})`
      end
    end
714975
function () {
        if (this._input.value && this._input.value.length > 0) {
            u.addClass(this.element, this._CssClasses.IS_DIRTY);
        } else {
            u.removeClass(this.element, this._CssClasses.IS_DIRTY);
        }
    }
53838
function patchAttribute( attr ) {
		return (!BROKEN_ATTR_IMPLEMENTATIONS || BROKEN_ATTR_IMPLEMENTATIONS.test(attr)) ?
			{ className: createClassName(attr), applyClass: true } : null;
	}
224676
function(attrs, attributeBlocks){
    if (attributeBlocks.length) {
      if (attrs.length) {
        var val = this.attrs(attrs);
        attributeBlocks.unshift(val);
      }
      if (attributeBlocks.length > 1) {
        this.bufferExpression(this.runtime('attrs') + '(' + this.runtime('merge') + '([' + attributeBlocks.join(',') + ']), ' + stringify(this.terse) + ')');
      } else {
        this.bufferExpression(this.runtime('attrs') + '(' + attributeBlocks[0] + ', ' + stringify(this.terse) + ')');
      }
    } else if (attrs.length) {
      this.attrs(attrs, true);
    }
  }
1220325
function normalizeSelector(selector) {
  var parts = selector.match(/[^\s>]+|>/ig);
  selector = (parts) ? parts.join(' ') : '';
  return {
    normalized: selector,
    parts: parts || []
  };
}