title: NS_ERROR_FAILURE in Firefox on setting font of canvas inside a hidden iframe
body: <p>I am trying to create a text editor using a <code>canvas</code>.</p>
  
  <p>To place the cursor at the right position I need to calculate the width of every character.</p>
  
  <p>I am caching the width of each character on initial load. </p>
  
  <p>This works fine on Firefox when launched directly but throws an error (<code>NS_ERROR_FAILURE</code>) when launched inside an <code>iframe</code> whose parent is hidden.</p>
  
  <p>I've narrowed down this case in a fiddle <a href="https://jsfiddle.net/maitreyjukar/0dff1r67/" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Can anyone help me out with the cause of this issue?</p>