function setElementAttribute(element, name, value) {
  try {
    genericMethodCall(
        Methods.SET_ATTRIBUTE, element, 'setAttribute', [name, value]);
  } catch (e) {
    // IE throws an exception if the src attribute contains HTTP credentials.
    // However the attribute gets set anyway.
    if (e.message.indexOf('A security problem occurred') != -1) {
      return;
    }
    throw e;
  }
}
Sets an element's attributes without falling prey to things like
<form><input name="setAttribute"></form>. Equivalent to {@code
element.setAttribute("foo", "bar")}.
@param {!Element} element
@param {string} name
@param {string} value