que-etc / resize-observer-polyfill

A polyfill for the Resize Observer API
MIT License
1.75k stars 132 forks source link

Check for `Element` prevents correctly working under jsdom #72

Open carsonreinke opened 4 years ago

carsonreinke commented 4 years ago

Under a jsdom environment Element is not an Object.

if (typeof Element === 'undefined' || !(Element instanceof Object)) {
    return;
}

https://github.com/que-etc/resize-observer-polyfill/blob/master/src/ResizeObserverSPI.js#L76

Probably simply just removing the later condition unless there was some reason for that.

Related to #50.