]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Fix failing instanceof when reading context
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Sat, 22 Apr 2017 07:49:10 +0000 (09:49 +0200)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sat, 22 Apr 2017 17:14:16 +0000 (13:14 -0400)
commitf7d2d7536a03b58b99c3a67cd93b58d24f811425
tree885735104e7c6e1ef15e78fa5107cb10a6018491
parentf2c569ef25320f26c442cfde4238a2fb536d4888
Fix failing instanceof when reading context

`instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is inside an iframe or when running in a protected environment. We could guess the types from their toString() value but let's keep things flexible and assume it's a sufficient condition if the item has a context2D which has item as `canvas`.
src/platforms/platform.dom.js
test/jasmine.matchers.js
test/specs/platform.dom.tests.js