function(div) {
  var sizeSpan = document.createElement('span');
  sizeSpan.setAttribute('style', 'margin: 0; padding: 0 0 0 1em; border: 0;');
  div.appendChild(sizeSpan);
  var oneEmWidth=sizeSpan.offsetWidth;
  div.removeChild(sizeSpan);
  return oneEmWidth;
}
function(div) {
  var sizeSpan = document.createElement('span');
  sizeSpan.setAttribute('style', 'margin: 0; padding: 0 0 0 1em; border: 0;');
  div.appendChild(sizeSpan);
  var oneEmWidth=sizeSpan.offsetWidth;
  div.removeChild(sizeSpan);
  return oneEmWidth;
}
function ( div ) { var sizeSpan = document . createElement ( 'span' ) ; sizeSpan . setAttribute ( 'style' , 'margin: 0; padding: 0 0 0 1em; border: 0;' ) ; div . appendChild ( sizeSpan ) ; var oneEmWidth = sizeSpan . offsetWidth ; div . removeChild ( sizeSpan ) ; return oneEmWidth ; }
Needed for dashed lines.
Needed for dashed lines .