function getLineHeightPx(element: Element): number {
  const computed = getComputedStyle(element);
  const correctDocument = getCorrectDocumentFromNode(element);
  const div = correctDocument.createElement('div');
  div.style.fontFamily = computed.fontFamily;
  div.style.fontSize = computed.fontSize;
  div.style.fontStyle = computed.fontStyle;
  div.style.fontWeight = computed.fontWeight;
  div.style.lineHeight = computed.lineHeight;
  div.style.position = 'absolute';
  div.textContent = 'M';

  const documentBody = correctDocument.body;
  invariant(documentBody, 'Missing document.body');

  // forced layout here
  documentBody.appendChild(div);
  const rect = div.getBoundingClientRect();
  documentBody.removeChild(div);

  return rect.height;
}
Return the computed line height, in pixels, for the provided element.