Index: test/browser/elemHideEmulation.js |
=================================================================== |
--- a/test/browser/elemHideEmulation.js |
+++ b/test/browser/elemHideEmulation.js |
@@ -50,26 +50,36 @@ |
} |
function unexpectedError(error) |
{ |
console.error(error); |
this.ok(false, "Unexpected error: " + error); |
} |
-function expectHidden(test, element) |
+function expectHidden(test, element, id) |
{ |
- test.equal(window.getComputedStyle(element).display, "none", |
- "The element's display property should be set to 'none'"); |
+ let withId = ""; |
+ if (typeof id != "undefined") |
+ withId = ` with ID '${id}'`; |
+ |
+ test.equal( |
+ window.getComputedStyle(element).display, "none", |
+ `The element${withId}'s display property should be set to 'none'`); |
} |
-function expectVisible(test, element) |
+function expectVisible(test, element, id) |
{ |
- test.notEqual(window.getComputedStyle(element).display, "none", |
- "The element's display property should not be set to 'none'"); |
+ let withId = ""; |
+ if (typeof id != "undefined") |
+ withId = ` with ID '${id}'`; |
+ |
+ test.notEqual( |
+ window.getComputedStyle(element).display, "none", |
+ `The element${withId}'s display property should not be set to 'none'`); |
} |
function findUniqueId() |
{ |
let id = "elemHideEmulationTest-" + Math.floor(Math.random() * 10000); |
if (!testDocument.getElementById(id)) |
return id; |
return findUniqueId(); |
@@ -355,19 +365,19 @@ |
function compareExpectations(test, elems, expectations) |
{ |
for (let elem in expectations) |
{ |
if (elems[elem]) |
{ |
if (expectations[elem]) |
- expectVisible(test, elems[elem]); |
+ expectVisible(test, elems[elem], elem); |
else |
- expectHidden(test, elems[elem]); |
+ expectHidden(test, elems[elem], elem); |
} |
} |
} |
function runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, selector, expectations) |
{ |
testDocument.body.innerHTML = `<div id="parent"> |
<div id="middle"> |