[BUGFIX release]  Fix usage of document.body.contains

Closes #5088.
On IE8 this line throws an error `'Node' is undefined`.