Bug 246620 - Add line numbers to View Source for Firefox; r=ehsan
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 02 Nov 2011 14:05:50 +1300
changeset 84618 02b3a12aea702ad30ecfb382c2bbf02d8fbea5a0
parent 84617 966b11b4940d9bffe858b61c65de2962311e7615
child 84619 39d88d1cd7d00900024f0753ec42026ed1d5e57c
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs246620
milestone12.0a1
Bug 246620 - Add line numbers to View Source for Firefox; r=ehsan
layout/style/viewsource.css
--- a/layout/style/viewsource.css
+++ b/layout/style/viewsource.css
@@ -16,16 +16,17 @@
  *
  * The Initial Developer of the Original Code is
  * Netscape Communications Corporation.
  * Portions created by the Initial Developer are Copyright (C) 1998
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Blake Ross <BlakeR1234@aol.com>
+ *   Geoff Lankow <geoff@darktrojan.net>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either of the GNU General Public License Version 2 or later (the "GPL"),
  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -42,26 +43,40 @@
   background-color: white;
   color: black;
   direction: ltr;
 }
 #viewsource {
   font-family: -moz-fixed;
   font-weight: normal;
   white-space: pre;
+  counter-reset: line;
 }
 #viewsource.wrap {
   white-space: pre-wrap;
   word-wrap: break-word;
 }
 pre {
   font: inherit;
   color: inherit;
   white-space: inherit; 
-  margin: 0;
+  margin: 0 0 0 5ch;
+}
+pre[id]:before,
+span[id]:before {
+  content: counter(line) " ";
+  counter-increment: line;
+  -moz-user-select: none;
+  display: inline-block;
+  width: 5ch;
+  margin: 0 0 0 -5ch;
+  text-align: right;
+  color: #ccc;
+  font-weight: normal;
+  font-style: normal;
 }
 .start-tag {
  color: purple;
  font-weight: bold;
 }
 .end-tag {
  color: purple;
  font-weight: bold;