Bug 1141498, part 2 - Enable calls to DOM animation test's testcommon.js's addDiv() to set attributes. r=dholbert

This commit is contained in:
Jonathan Watt 2015-02-27 10:23:55 +00:00
parent 25976350db
commit 83fa89f7b3

View File

@ -7,9 +7,17 @@
* @param t The testharness.js Test object. If provided, this will be used
* to register a cleanup callback to remove the div when the test
* finishes.
*
* @param attrs A dictionary object with attribute names and values to set on
* the div.
*/
function addDiv(t) {
function addDiv(t, attrs) {
var div = document.createElement('div');
if (attrs) {
for (var attrName in attrs) {
div.setAttribute(attrName, attrs[attrName]);
}
}
document.body.appendChild(div);
if (t && typeof t.add_cleanup === 'function') {
t.add_cleanup(function() {