mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
only run shadow dom test if brower supports shadow dom
This commit is contained in:
parent
daa387f4b7
commit
ab33cd502e
@ -46,28 +46,32 @@
|
|||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
QUnit.test('shadow dom', function(assert) {
|
QUnit.test('shadow dom', function(assert) {
|
||||||
var done = assert.async();
|
if (document.head && document.head.attachShadow) {
|
||||||
|
var done = assert.async();
|
||||||
|
|
||||||
var shadowDiv = document.createElement('div');
|
var shadowDiv = document.createElement('div');
|
||||||
shadowDiv.attachShadow({
|
shadowDiv.attachShadow({
|
||||||
mode: 'open'
|
mode: 'open'
|
||||||
});
|
});
|
||||||
shadowDiv.shadowRoot.innerHTML = `<div id="shadow-example"></div>`
|
shadowDiv.shadowRoot.innerHTML = `<div id="shadow-example"></div>`
|
||||||
|
|
||||||
createViewer({
|
createViewer({
|
||||||
element: shadowDiv.shadowRoot.querySelector('#shadow-example'),
|
element: shadowDiv.shadowRoot.querySelector('#shadow-example'),
|
||||||
sequenceMode: true,
|
sequenceMode: true,
|
||||||
showReferenceStrip: true,
|
showReferenceStrip: true,
|
||||||
tileSources: [
|
tileSources: [
|
||||||
'/test/data/tall.dzi',
|
'/test/data/tall.dzi',
|
||||||
'/test/data/wide.dzi'
|
'/test/data/wide.dzi'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
$(shadowDiv).appendTo("#qunit-fixture");
|
$(shadowDiv).appendTo("#qunit-fixture");
|
||||||
|
|
||||||
assert.ok(viewer.referenceStrip, 'referenceStrip exists');
|
assert.ok(viewer.referenceStrip, 'referenceStrip exists');
|
||||||
done();
|
done();
|
||||||
|
} else {
|
||||||
|
assert.expect(0);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user