From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy at warmcat.com (Andy Green) Date: Tue, 19 Jun 2018 17:01:36 +0800 Subject: [PATCH v3 02/17] blame: css: make blame highlight div absolute and at parent top In-Reply-To: <152939875224.4492.4288866616332837866.stgit@mail.warmcat.com> References: <152939875224.4492.4288866616332837866.stgit@mail.warmcat.com> Message-ID: <152939889662.4492.10338039444772278695.stgit@mail.warmcat.com> Normal operation of blame view requires div.highlight to have absolute position and set to its parent's top for me. Otherwise the grey background boxes indicating the extent of the patch in the lines td displace the highlit sources, they start at the bottom of the td. This patch makes the blame highlight div start back up the top of its parent area and render on top of the grey boxes. Checked on Linux Firefox 60 and Linux Chrome 69. "highlight" div class name is also used in md2html rendering output. So this patch solves it by introducing a wrapper div and new "blame_highlight" css class. Signed-off-by: Andy Green --- cgit.css | 2 ++ ui-blame.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cgit.css b/cgit.css index 43f6a5a..fb3cc70 100644 --- a/cgit.css +++ b/cgit.css @@ -162,6 +162,8 @@ div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { background: white; } +div#cgit div.blame_highlight { position: absolute; top: 0; } + div#cgit table.list th { font-weight: bold; /* color: #888; diff --git a/ui-blame.c b/ui-blame.c index daa7e2b..8b56554 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -196,7 +196,7 @@ static void print_object(const struct object_id *oid, const char *path, free((void *)sb.final_buf); /* Lines */ - html("
");
+	html("
");
 	if (ctx.repo->source_filter) {
 		char *filter_arg = xstrdup(basename);
 		cgit_open_filter(ctx.repo->source_filter, filter_arg);
@@ -206,7 +206,7 @@ static void print_object(const struct object_id *oid, const char *path,
 	} else {
 		html_txt(buf);
 	}
-	html("
"); + html("
"); html("\n");