// 1. Let list be an empty list of name-value pairs.
Vector<NameValuePair>list;
// 2. For each content attribute on the DOMStringMap's associated element whose first five characters are the string "data-" and whose remaining characters (if any) do not include any ASCII upper alphas,
// in the order that those attributes are listed in the element's attribute list, add a name-value pair to list whose name is the attribute's name with the first five characters removed and whose value
// 3. For each name in list, for each U+002D HYPHEN-MINUS character (-) in the name that is followed by an ASCII lower alpha, remove the U+002D HYPHEN-MINUS character (-) and replace the character
// that followed it by the same character converted to ASCII uppercase.
// The supported property names on a DOMStringMap object at any instant are the names of each pair returned from getting the DOMStringMap's name-value pairs at that instant, in the order returned.
// To determine the value of a named property name for a DOMStringMap, return the value component of the name-value pair whose name component is name in the list returned from getting the
returnDOM::SyntaxError::create("Name cannot contain a '-' followed by a lowercase character.");
}
// 2. For each ASCII upper alpha in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character converted to ASCII lowercase.
// 1. For each ASCII upper alpha in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character converted to ASCII lowercase.
if(is_ascii_upper_alpha(character)){
builder.append('-');
builder.append(to_ascii_lowercase(character));
continue;
}
builder.append(character);
}
// Remove an attribute by name given name and the DOMStringMap's associated element.