Cherry picking a fix for blackberry issue: https://bugs.dojotoolkit.org/ticket/17204