From 561df568c3d7852130aad11eb7cd4f6f06daa087 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Wed, 2 Nov 2011 14:05:50 +1300 Subject: [PATCH] Bug 246620 - Add line numbers to View Source for Firefox; r=ehsan --- layout/style/viewsource.css | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/layout/style/viewsource.css b/layout/style/viewsource.css index 72ee55861b98..0483c766f8db 100644 --- a/layout/style/viewsource.css +++ b/layout/style/viewsource.css @@ -21,6 +21,7 @@ * * Contributor(s): * Blake Ross + * Geoff Lankow * * 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"), @@ -47,6 +48,7 @@ font-family: -moz-fixed; font-weight: normal; white-space: pre; + counter-reset: line; } #viewsource.wrap { white-space: pre-wrap; @@ -56,7 +58,20 @@ 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;