Implement separated support for getText and getBytes, for better performance on HTML5