diff --git a/src/buildHTML.js b/src/buildHTML.js index 5fc35e4d..ca5f410a 100644 --- a/src/buildHTML.js +++ b/src/buildHTML.js @@ -641,20 +641,17 @@ function buildHTMLUnbreakable(children, options) { // Compute height and depth of this chunk. const body = makeSpan(["base"], children, options); - // Add struts, which ensure that the top of the HTML element falls at + // Add strut, which ensures that the top of the HTML element falls at // the height of the expression, and the bottom of the HTML element // falls at the depth of the expression. - const topStrut = makeSpan(["strut"]); - const bottomStrut = makeSpan(["strut", "bottom"]); - - topStrut.style.height = body.height + "em"; - bottomStrut.style.height = (body.height + body.depth) + "em"; - // We'd like to use `vertical-align: top` but in IE 9 this lowers the - // baseline of the box to the bottom of this strut (instead staying in the - // normal place) so we use an absolute value for vertical-align instead - bottomStrut.style.verticalAlign = -body.depth + "em"; - - body.children.unshift(topStrut, bottomStrut); + // We used to have separate top and bottom struts, where the bottom strut + // would like to use `vertical-align: top`, but in IE 9 this lowers the + // baseline of the box to the bottom of this strut (instead of staying in + // the normal place) so we use an absolute value for vertical-align instead. + const strut = makeSpan(["strut"]); + strut.style.height = (body.height + body.depth) + "em"; + strut.style.verticalAlign = -body.depth + "em"; + body.children.unshift(strut); return body; } diff --git a/test/screenshotter/images/BinomTest-chrome.png b/test/screenshotter/images/BinomTest-chrome.png index 83651956..00caf630 100644 Binary files a/test/screenshotter/images/BinomTest-chrome.png and b/test/screenshotter/images/BinomTest-chrome.png differ diff --git a/test/screenshotter/images/LeftRight-chrome.png b/test/screenshotter/images/LeftRight-chrome.png index 795c0131..985b3005 100644 Binary files a/test/screenshotter/images/LeftRight-chrome.png and b/test/screenshotter/images/LeftRight-chrome.png differ diff --git a/test/screenshotter/images/LeftRightMiddle-chrome.png b/test/screenshotter/images/LeftRightMiddle-chrome.png index 439a75df..21e8bc5d 100644 Binary files a/test/screenshotter/images/LeftRightMiddle-chrome.png and b/test/screenshotter/images/LeftRightMiddle-chrome.png differ