Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing instanceof when reading context #4165

Merged
merged 1 commit into from
Apr 22, 2017

Conversation

simonbrunel
Copy link
Member

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.

Fixes #3887 #4102 #4152

@simonbrunel simonbrunel added this to the Version 2.6 milestone Apr 22, 2017
@simonbrunel simonbrunel requested a review from etimberg April 22, 2017 07:52
`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`.
@mgetzbw
Copy link

mgetzbw commented May 1, 2017

@simonbrunel looks like Salesforce is fixing their side of the issue however this fix won't be released for a few months. That said I think this fix is still the more appropriate option, as realistically we don't care if the object is a CanvasRenderingContext2D insofar as it can pretend to be one.

@simonbrunel simonbrunel deleted the fix/4102 branch May 1, 2017 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants