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 36126 0274467b8c7815966ebd56bda53c2ebeafb25509
parent 36125 efa306ce07b572592f8891e894da0726cfebb345
child 36127 2281a77dfbf64434687ebd51c70f6793a773deac
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
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);