Bug 1568121 - restore line height calculation after bug 1564443 (consulting by :emilio). r=Paenglab,florian a=jorgk DONTBUILD
authorJorg K <jorgk@jorgk.com>
Tue, 30 Jul 2019 22:39:06 +0200
changeset 35263 0274467b8c7815966ebd56bda53c2ebeafb25509
parent 35262 efa306ce07b572592f8891e894da0726cfebb345
child 35264 2281a77dfbf64434687ebd51c70f6793a773deac
push id2474
push usermozilla@jorgk.com
push dateFri, 02 Aug 2019 06:23:51 +0000
treeherdercomm-beta@0274467b8c78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaenglab, florian, jorgk
bugs1568121, 1564443
Bug 1568121 - restore line height calculation after bug 1564443 (consulting by :emilio). r=Paenglab,florian a=jorgk DONTBUILD
mail/components/im/content/chat-conversation.js
--- a/mail/components/im/content/chat-conversation.js
+++ b/mail/components/im/content/chat-conversation.js
@@ -502,17 +502,23 @@
     _onSplitterChange() {
       // set the default height as the deck height (modified by the splitter)
       this.inputBox.defaultHeight = parseInt(this.inputBox.parentNode.height) -
         this._TEXTBOX_VERTICAL_OVERHEAD;
     }
 
     calculateTextboxDefaultHeight() {
       let totalSpace = parseInt(window.getComputedStyle(this).getPropertyValue("height"));
-      let lineHeight = 20;
+      let textboxStyle = window.getComputedStyle(this.inputBox);
+      let lineHeight = textboxStyle.lineHeight;
+      if (lineHeight == "normal") {
+        lineHeight = parseFloat(textboxStyle.fontSize) * 1.2;
+      } else {
+        lineHeight = parseFloat(lineHeight);
+      }
 
       // Compute the overhead size.
       let textboxHeight = this.inputBox.clientHeight;
       let deckHeight = this.inputBox.parentNode.getBoundingClientRect().height;
       this._TEXTBOX_VERTICAL_OVERHEAD = deckHeight - textboxHeight;
 
       // Calculate the number of lines to display.
       let numberOfLines = Math.round(totalSpace * this._TEXTBOX_RATIO / lineHeight);