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.
Hah that is fantastic.
Thank you for the report and fix.
updated canvas test to prevent s60 & blackberry storm false positive. thx bitprobe & andycouch. closed by 515533b
updated canvas test to prevent s60 & blackberry storm false positive.…
… thx bitprobe & andycouch. fixes #97