Canvas false positive on S60 / BlackBerry Storm #97

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

Projects

None yet

2 participants

@davidwood

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
Member

Hah that is fantastic.

Thank you for the report and fix.

@paulirish
Member

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

@paulirish paulirish added a commit to KuraFire/Modernizr that referenced this issue Jun 28, 2012
@paulirish paulirish updated canvas test to prevent s60 & blackberry storm false positive.…
… thx bitprobe & andycouch. fixes #97
515533b
@patrickkettner patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
@paulirish paulirish updated canvas test to prevent s60 & blackberry storm false positive.…
… thx bitprobe & andycouch. fixes #97
ce28799
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment