code: private void addAttribute(int list, TreeHtmlAttributeInfo attr, RemoveInfo removes)
      {
          ArrayList al = _lists[list];
          // if the array list is the empty list then we need to allocate a new array list
          if (al == empty) {
              al = new ArrayList();
              _lists[list] = al;
          }
  
          // check to see if this attribute is already inside the tree.
          int cnt = al.size();
          for (int i = 0; i < cnt; i++) {
              TreeHtmlAttributeInfo a = (TreeHtmlAttributeInfo) al.get(i);
              assert(a != null);
              if (a.getAttribute().equals(attr.getAttribute())) {
                  removes.removes.add(a);
                  if (!attr.isApplyToDescendents()) {
                      removes.scopeOverrides = true;
                  }
                  al.remove(a);
                  break;
              }
          }
  
          // add this to the list
          al.add(attr);
      }
docs: This method will add an attribute to the list of inheritted attributes.
  @param list
  @param attr
  @param removes