gitweb, monoblue: fix vertical align of spans in .sourcelines
authorAnton Shestakov <av6@dwimlabs.net>
Fri, 25 Sep 2015 03:02:38 +0800
changeset 26362 3bfc473f4d33
parent 26361 6b4a0c602bec
child 26363 f29ee23bf361
gitweb, monoblue: fix vertical align of spans in .sourcelines Empty lines in file view could produce an inexplicable margin before the next line (most noticeable in browsers on webkit/blink engine). That was making empty lines seem taller than the rest. Instead of using default vertical align, let's set it to 'top'. This issue is actually present in paper, and only recently got into gitweb (2239626369f5) and monoblue (119202d4d7a4). There's a bit more to it in paper, so that will be dealt with in a future patch. Recipe to see live: preferably using a webkit/blink browser, such as chromium, browse a file with empty lines, e.g. https://selenic.com/hg/file/3.5/README#l8 Selecting a block of text that includes empty lines will reveal white "breaks" in the selection. Highlighted line (#l8) also shows such a break below itself.
mercurial/templates/static/style-gitweb.css
mercurial/templates/static/style-monoblue.css
tests/test-hgweb.t
--- a/mercurial/templates/static/style-gitweb.css	Fri Sep 25 00:54:20 2015 -0400
+++ b/mercurial/templates/static/style-gitweb.css	Fri Sep 25 03:02:38 2015 +0800
@@ -96,6 +96,7 @@
 	width: 100%;
 	padding: 0 0 0 5em;
 	counter-increment: lineno;
+	vertical-align: top;
 }
 pre.sourcelines > span:before {
 	-moz-user-select: -moz-none;
--- a/mercurial/templates/static/style-monoblue.css	Fri Sep 25 00:54:20 2015 -0400
+++ b/mercurial/templates/static/style-monoblue.css	Fri Sep 25 03:02:38 2015 +0800
@@ -270,6 +270,7 @@
     padding: 0 0 0 5em;
     font-size: 1.2em;
     counter-increment: lineno;
+    vertical-align: top;
 }
 div.source > pre.sourcelines > span {
     padding: 1px 1px 1px 5em;
--- a/tests/test-hgweb.t	Fri Sep 25 00:54:20 2015 -0400
+++ b/tests/test-hgweb.t	Fri Sep 25 03:02:38 2015 +0800
@@ -340,7 +340,7 @@
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
   200 Script output follows
-  content-length: 6242
+  content-length: 6264
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; }
@@ -441,6 +441,7 @@
   	width: 100%;
   	padding: 0 0 0 5em;
   	counter-increment: lineno;
+  	vertical-align: top;
   }
   pre.sourcelines > span:before {
   	-moz-user-select: -moz-none;