function calculateLineHeightPx(nodeName, computedStyle) {
  var body = document.body;
  if (!body) {
    return 0;
  }

  var tempNode = document.createElement(nodeName);
  tempNode.innerHTML = "&nbsp;";
  tempNode.style.fontSize = computedStyle.fontSize;
  tempNode.style.fontFamily = computedStyle.fontFamily;
  tempNode.style.padding = "0";
  body.appendChild(tempNode

  // Make sure textarea has only 1 row
  );if (tempNode instanceof HTMLTextAreaElement) {
    ;tempNode.rows = 1;
  }

  // Assume the height of the element is the line-height
  var height = tempNode.offsetHeight;
  body.removeChild(tempNode);

  return height;
}
/**
 * Returns calculated line-height of the given node in pixels.
 *
 * @private
 */
Returns calculated line-height of the given node in pixels.
@private
Returns calculated line - height of the given node in pixels . @private
function calculateLineHeightPx(nodeName, computedStyle) {
  var body = document.body;
  if (!body) {
    return 0;
  }
  var tempNode = document.createElement(nodeName);
  tempNode.innerHTML = "&nbsp;";
  tempNode.style.fontSize = computedStyle.fontSize;
  tempNode.style.fontFamily = computedStyle.fontFamily;
  tempNode.style.padding = "0";
  body.appendChild(tempNode
  );if (tempNode instanceof HTMLTextAreaElement) {
    ;tempNode.rows = 1;
  }
  var height = tempNode.offsetHeight;
  body.removeChild(tempNode);
  return height;
}
function calculateLineHeightPx ( nodeName , computedStyle ) { var body = document . body ; if ( ! body ) { return 0 ; } var tempNode = document . createElement ( nodeName ) ; tempNode . innerHTML = "&nbsp;" ; tempNode . style . fontSize = computedStyle . fontSize ; tempNode . style . fontFamily = computedStyle . fontFamily ; tempNode . style . padding = "0" ; body . appendChild ( tempNode ) ; if ( tempNode instanceof HTMLTextAreaElement ) { ; tempNode . rows = 1 ; } var height = tempNode . offsetHeight ; body . removeChild ( tempNode ) ; return height ; }
Returns calculated line-height of the given node in pixels.
Returns calculated line - height of the given node in pixels .
// Make sure textarea has only 1 row // Assume the height of the element is the line-height