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

Canvas false positive on S60 / BlackBerry Storm #97

Closed
davidwood opened this issue Jul 27, 2010 · 2 comments
Closed

Canvas false positive on S60 / BlackBerry Storm #97

davidwood opened this issue Jul 27, 2010 · 2 comments

Comments

@davidwood
Copy link

The test for canvas returns true on S60 browser and BlackBerry Storm. The issue with these browsers is that window.canvas exists and window.canvas.getContext is a valid function, however, the function always returns undefined. To resolve the error, the canvas test should execute the getContext method and check if a valid object is returned.

return !!(doc.createElement( canvas ).getContext && doc.createElement( canvas).getContext('2d'));

This false positive also results in an error when the canvastext test is run, halting the Modernizr tests, as the canvastext test assumes that if the canvas test passed, the getContext method will return a valid object.

@paulirish
Copy link
Member

Hah that is fantastic.

Thank you for the report and fix.

@paulirish
Copy link
Member

updated canvas test to prevent s60 & blackberry storm false positive. thx bitprobe & andycouch. closed by 515533b

paulirish added a commit to KuraFire/Modernizr that referenced this issue Jun 28, 2012
patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants