Bug 1320053 - set height 100% on .CodeMirror element;r=gl draft
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 25 Nov 2016 18:36:57 +0100
changeset 444016 47b85a76832f6e4f4da43474a75437572f819f35
parent 442775 0ddfec7126ec503b54df9c4b7c3b988906f6c882
child 538212 3ac26b6523307c48ea759e56669c275e1c070d0d
push id37169
push userjdescottes@mozilla.com
push dateFri, 25 Nov 2016 17:40:48 +0000
reviewersgl
bugs1320053
milestone53.0a1
Bug 1320053 - set height 100% on .CodeMirror element;r=gl MozReview-Commit-ID: IKmRGwiOjwu
devtools/client/sourceeditor/codemirror/mozilla.css
devtools/client/sourceeditor/editor.js
--- a/devtools/client/sourceeditor/codemirror/mozilla.css
+++ b/devtools/client/sourceeditor/codemirror/mozilla.css
@@ -11,16 +11,21 @@
 
 .theme-dark:root {
   --breakpoint-background: url("chrome://devtools/skin/images/breakpoint.svg#dark");
   --breakpoint-hover-background: url("chrome://devtools/skin/images/breakpoint.svg#dark-hover");
   --breakpoint-active-color: rgba(112,191,83,.4);
   --breakpoint-conditional-background: url("chrome://devtools/skin/images/breakpoint.svg#dark-conditional");
 }
 
+.CodeMirror {
+  height: 100%;
+  cursor: text;
+}
+
 .CodeMirror .errors {
   width: 16px;
 }
 
 .CodeMirror .error {
   display: inline-block;
   margin-left: 5px;
   width: 12px;
@@ -87,20 +92,16 @@
 }
 
 /* Don't display the highlight color since the debug line
    is already highlighted */
 .debug-line .CodeMirror-activeline-background {
   display: none;
 }
 
-.CodeMirror {
-  cursor: text;
-}
-
 .CodeMirror-gutters {
   cursor: default;
 }
 
 /* This is to avoid the fake horizontal scrollbar div of codemirror to go 0
 height when floating scrollbars are active. Make sure that this value is equal
 to the maximum of `min-height` specific to the `scrollbar[orient="horizontal"]`
 selector in floating-scrollbar-light.css across all platforms. */
--- a/devtools/client/sourceeditor/editor.js
+++ b/devtools/client/sourceeditor/editor.js
@@ -57,18 +57,17 @@ const CM_SCRIPTS = [
 
 const CM_IFRAME =
   "data:text/html;charset=utf8,<!DOCTYPE html>" +
   "<html dir='ltr'>" +
   "  <head>" +
   "    <style>" +
   "      html, body { height: 100%; }" +
   "      body { margin: 0; overflow: hidden; }" +
-  "      .CodeMirror { width: 100%; height: 100% !important; " +
-  "line-height: 1.25 !important;}" +
+  "      .CodeMirror { width: 100% !important; line-height: 1.25 !important; }" +
   "    </style>" +
   CM_STYLES.map(style => "<link rel='stylesheet' href='" + style + "'>").join("\n") +
   "  </head>" +
   "  <body class='theme-body devtools-monospace'></body>" +
   "</html>";
 
 const CM_MAPPING = [
   "focus",