NS_ERROR_FAILURE in Firefox on setting font of canvas inside a hidden iframe
问题 I am trying to create a text editor using a canvas . To place the cursor at the right position I need to calculate the width of every character. I am caching the width of each character on initial load. This works fine on Firefox when launched directly but throws an error ( NS_ERROR_FAILURE ) when launched inside an iframe whose parent is hidden. I've narrowed down this case in a fiddle here. Can anyone help me out with the cause of this issue? 回答1: You can't have an iframe set to display