mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
Leave the scope mask off a globe whose container holds no DOM children
This commit is contained in:
1 parent
5983c663bd
commit
89339cdd96
2 files changed
+10
-1
No files matched your search
+2
-1
@@ -454,7 +454,8 @@ function globeOf(target) {
|
|||||||
export function installScopeMask(target) {
|
export function installScopeMask(target) {
|
||||||
if (_canvas) return;
|
if (_canvas) return;
|
||||||
const globe = globeOf(target);
|
const globe = globeOf(target);
|
||||||
if (!globe.container) return;
|
// Only a DOM container can hold the mask (an engine double's cannot).
|
||||||
|
if (typeof globe.container?.appendChild !== 'function') return;
|
||||||
syncScopeMaskAppearance();
|
syncScopeMaskAppearance();
|
||||||
_container = globe.container;
|
_container = globe.container;
|
||||||
_globe = globe;
|
_globe = globe;
|
||||||
|
|||||||
@@ -801,3 +801,11 @@ test('on a globe engine (Navara) the mask goes into its host container and follo
|
|||||||
dom.restore();
|
dom.restore();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('an engine without a DOM container gets no mask and no listeners', async () => {
|
||||||
|
const { createFakeEngine } = await import('./globe/testing/fakeEngine.js');
|
||||||
|
const engine = createFakeEngine({ kind: 'navara' });
|
||||||
|
installScopeMask(engine);
|
||||||
|
assert.equal(engine.frames.preRender.numberOfListeners, 0);
|
||||||
|
destroyScopeMask();
|
||||||
|
});
|
||||||
Reference in new issue
Block a user