mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -28,15 +28,22 @@ if (!window.assert_times_equal) {
|
|||
// creates div element, appends it to the document body and
|
||||
// removes the created element during test cleanup
|
||||
function createDiv(test, doc) {
|
||||
return createElement(test, 'div', doc);
|
||||
}
|
||||
|
||||
// creates element of given tagName, appends it to the document body and
|
||||
// removes the created element during test cleanup
|
||||
// if tagName is null or undefined, returns div element
|
||||
function createElement(test, tagName, doc) {
|
||||
if (!doc) {
|
||||
doc = document;
|
||||
}
|
||||
var div = doc.createElement('div');
|
||||
doc.body.appendChild(div);
|
||||
var element = doc.createElement(tagName || 'div');
|
||||
doc.body.appendChild(element);
|
||||
test.add_cleanup(function() {
|
||||
div.remove();
|
||||
element.remove();
|
||||
});
|
||||
return div;
|
||||
return element;
|
||||
}
|
||||
|
||||
// Creates a style element with the specified rules, appends it to the document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue