Assigns a pseudo class to the given element. Multiple pseudo classes may be assigned to a single element.
@param e the DOM element
@param pseudoClass the pseudo class to be assigned
767065
public void addMatch(Element e, PseudoClassType pseudoClass)
    {
        if (elements == null)
            elements = new HashMap<Element, Set<PseudoClassType>>();
        
        Set<PseudoClassType> classes = elements.get(e);
        if (classes == null)
        {
            classes = new HashSet<PseudoClassType>(2);
            elements.put(e, classes);
        }
        classes.add(pseudoClass);
    }
956075
private boolean add_i(final GroupElement e) {
	if (e == null || e == this) {
	    // -DEBUG
	    System.out.println("Group::add_i::failed to add " + e.get_name() + " (null or self)");
	    return false;
	}
	final GroupElement ge = find_i(e.get_name(), e instanceof Group ? false : true);
	if (ge != null && ge != this) {
	    // -DEBUG
	    System.out.println("Group::add_i::failed to add " + e.get_name() + " (already attached)");
	    return false;
	}
	elements.add(e);
	e.set_parent(this);
	return true;
    }
888762
public void add(E element) {
        if (element == null) throw new NullPointerException();

        if (root == null) {
            root = new MutableNode<>(element);
        } else {
            MutableNode<E> node = root;
            while (!node.getElement().equals(element)) {
                int distance = distance(node.getElement(), element);

                MutableNode<E> parent = node;
                node = parent.childrenByDistance.get(distance);
                if (node == null) {
                    node = new MutableNode<>(element);
                    parent.childrenByDistance.put(distance, node);
                    break;
                }
            }
        }
    }
615847
public static TypeElement getDeclaringClass(Element element) {
    do {
      element = element.getEnclosingElement();
    } while (element != null && !isTypeElement(element));
    return (TypeElement) element;
  }
739146
public static void setMetaClass(GroovyObject self, MetaClass metaClass) {
        // this method was introduced as to prevent from a stack overflow, described in GROOVY-5285
        if (metaClass instanceof HandleMetaClass)
            metaClass = ((HandleMetaClass)metaClass).getAdaptee();

        self.setMetaClass(metaClass);
        disablePrimitiveOptimization(self);
    }
600553
public static void setMetaClass(Class self, MetaClass metaClass) {
        final MetaClassRegistry metaClassRegistry = GroovySystem.getMetaClassRegistry();
        if (metaClass == null)
            metaClassRegistry.removeMetaClass(self);
        else {
            if (metaClass instanceof HandleMetaClass) {
                metaClassRegistry.setMetaClass(self, ((HandleMetaClass)metaClass).getAdaptee());
            } else {
                metaClassRegistry.setMetaClass(self, metaClass);
            }
            if (self==NullObject.class) {
                NullObject.getNullObject().setMetaClass(metaClass);
            }
        }
    }
536774
def do_class(self, element, decl, pseudo):
        """"""
        step = self.state[self.state['current_step']]
        actions = step['actions']
        strval = self.eval_string_value(element, decl.value)
        actions.append(('attrib', ('class', strval)))
1078718
public void appendElements(ExtensionPoint... elements) {
    List<ExtensionPoint> rc = new ArrayList<ExtensionPoint>();
    rc.addAll(Arrays.asList(this.elements));
    rc.addAll(Arrays.asList(elements));
    this.elements = rc.toArray(new ExtensionPoint[0]);
  }
1037807
@Override
    public void setMetaClass(final MetaClass metaClass) {
        final MetaClass newMetaClass = new DelegatingMetaClass(metaClass) {
            @Override
            public Object getAttribute(final Object object, final String attribute) {
                return GPathResult.this.getProperty("@" + attribute);
            }

            @Override
            public void setAttribute(final Object object, final String attribute, final Object newValue) {
                GPathResult.this.setProperty("@" + attribute, newValue);
            }
        };
        super.setMetaClass(newMetaClass);
    }
304874
function(elem, options) {
			elem = $(elem);
			if (elem.hasClass(this._getMarker())) {
				return;
			}
			elem.addClass(this._getMarker());
			options = $.extend({}, this.defaultOptions, this._getMetadata(elem), options || {});
			var inst = $.extend({name: this.name, elem: elem, options: options},
				this._instSettings(elem, options));
			elem.data(this.name, inst); // Save instance against element
			this._postAttach(elem, inst);
			this.option(elem, options);
		}
600811
public void addDeclaration(Element el, PseudoElementType pseudo, Declaration decl)
    {
        List<Declaration> list = getOrCreate(el, pseudo);
        list.add(decl);
    }
778651
public static void addCSSClass(Element e, String cssclass) {
    String oldval = e.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
    if(oldval == null || oldval.length() == 0) {
      setAtt(e, SVGConstants.SVG_CLASS_ATTRIBUTE, cssclass);
      return;
    }
    String[] classes = oldval.split(" ");
    for(String c : classes) {
      if(c.equals(cssclass)) {
        return;
      }
    }
    setAtt(e, SVGConstants.SVG_CLASS_ATTRIBUTE, oldval + " " + cssclass);
  }
668127
function(e) {
      this.setClassFromState();
      // Clear the field when no value 
	 if (this.hiddenEl.value != this.el.value) this.hiddenEl.value = this.el.value;
      lang.later(50, this, function() {
         if(this.el.value == "") {
            this.setValue("");
         }
      });
   }
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);
            });
        }
463882
public void removeMatch(String name, PseudoClassType pseudoClass)
    {
        if (names != null)
        {
            Set<PseudoClassType> classes = names.get(name);
            if (classes != null)
                classes.remove(pseudoClass);
        }   
    }
963745
function ClassList (el) {
  if (!el || !el.nodeType) {
    throw new Error('A DOM element reference is required')
  }
  this.el = el
  this.list = el.classList
}
730274
private Node createPseudoElement(ElementBox box, PseudoElementType pseudo) 
    {
        Element n = box.getElement();
        //New box style
        NodeData style = decoder.getElementStyleInherited(n, pseudo);
        if (style != null)
        {
            TermList cont = style.getValue(TermList.class, "content");
            if (cont != null && cont.size() > 0)
            {
                //create the DOM tree for the pseudo element
                //parent
                Element pelem = createAnonymousElement(n.getOwnerDocument(), "XPspan", "inline"); 
                //content elements
                for (Term<?> c : cont)
                {
                    if (c instanceof TermIdent)
                    {
                    }
                    else if (c instanceof TermString)
                    {
                        Text txt = n.getOwnerDocument().createTextNode(((TermString) c).getValue());
                        pelem.appendChild(txt);
                    }
                    else if (c instanceof TermURI)
                    {
                    }
                    else if (c instanceof TermFunction.Attr)
                    {
                        TermFunction.Attr f = (TermFunction.Attr) c;
                        String val = HTMLNorm.getAttribute(n, f.getName());
                        Text txt = n.getOwnerDocument().createTextNode(val);
                        pelem.appendChild(txt);
                    }
                }

                //use the pseudo element style for the new (main) element
                decoder.useStyle(pelem, null, style);

                return pelem;
            }
            else
                return null; //no contents
        }
        else
            return null; //no pseudo declaration
    }