[PATCH 2/5] Replace table summary attribute with aria-label

Chris Mayo aklhfex at gmail.com
Mon Feb 18 21:46:41 CET 2019


summary is not valid in HTML5.

Signed-off-by: Chris Mayo <aklhfex at gmail.com>
---
 tests/t0105-commit.sh | 2 +-
 ui-commit.c           | 2 +-
 ui-diff.c             | 6 +++---
 ui-repolist.c         | 2 +-
 ui-summary.c          | 2 +-
 ui-tree.c             | 6 +++---
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh
index 9cdf55c..fd4c187 100755
--- a/tests/t0105-commit.sh
+++ b/tests/t0105-commit.sh
@@ -12,7 +12,7 @@ test_expect_success 'find commit subject' '
 '
 
 test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp'
-test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp'
+test_expect_success 'find diffstat' 'grep "<table aria-label=.diffstat. class=.diffstat.>" tmp'
 
 test_expect_success 'find diff summary' '
 	grep "1 files changed, 1 insertions, 0 deletions" tmp
diff --git a/ui-commit.c b/ui-commit.c
index 9a47b54..207854f 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -45,7 +45,7 @@ void cgit_print_commit(char *hex, const char *prefix)
 
 	cgit_print_layout_start();
 	cgit_print_diff_ctrls();
-	html("<table summary='commit info' class='commit-info'>\n");
+	html("<table aria-label='commit info' class='commit-info'>\n");
 	html("<tr><th>author</th><td>");
 	cgit_open_filter(ctx.repo->email_filter, info->author_email, "commit");
 	html_txt(info->author);
diff --git a/ui-diff.c b/ui-diff.c
index 001d77e..eb0a395 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -202,7 +202,7 @@ static void cgit_print_diffstat(const struct object_id *old_oid,
 		html("')");
 	}
 	html("</div>");
-	html("<table summary='diffstat' class='diffstat'>");
+	html("<table aria-label='diffstat' class='diffstat'>");
 	max_changes = 0;
 	cgit_diff_tree(old_oid, new_oid, inspect_filepair, prefix,
 		       ctx.qry.ignorews);
@@ -485,9 +485,9 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
 		return;
 
 	if (use_ssdiff) {
-		html("<table summary='ssdiff' class='ssdiff'>");
+		html("<table aria-label='ssdiff' class='ssdiff'>");
 	} else {
-		html("<table summary='diff' class='diff'>");
+		html("<table aria-label='diff' class='diff'>");
 		html("<tr><td>");
 	}
 	cgit_diff_tree(old_rev_oid, new_rev_oid, filepair_cb, prefix,
diff --git a/ui-repolist.c b/ui-repolist.c
index 41424c0..bab151d 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -293,7 +293,7 @@ void cgit_print_repolist(void)
 	else if (ctx.cfg.section_sort)
 		sort_repolist("section");
 
-	html("<table summary='repository list' class='list nowrap'>");
+	html("<table aria-label='repository list' class='list nowrap'>");
 	for (i = 0; i < cgit_repolist.count; i++) {
 		ctx.repo = &cgit_repolist.repos[i];
 		if (!is_visible(ctx.repo))
diff --git a/ui-summary.c b/ui-summary.c
index 8e81ac4..25f37dd 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -50,7 +50,7 @@ void cgit_print_summary(void)
 		columns++;
 
 	cgit_print_layout_start();
-	html("<table summary='repository info' class='list nowrap'>");
+	html("<table aria-label='repository info' class='list nowrap'>");
 	cgit_print_branches(ctx.cfg.summary_branches);
 	htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns);
 	cgit_print_tags(ctx.cfg.summary_tags);
diff --git a/ui-tree.c b/ui-tree.c
index df8ad82..08a8505 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -22,7 +22,7 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
 	unsigned long lineno, idx;
 	const char *numberfmt = "<a id='n%1$d' href='#n%1$d'>%1$d</a>\n";
 
-	html("<table summary='blob content' class='blob'>\n");
+	html("<table aria-label='blob content' class='blob'>\n");
 
 	if (ctx.cfg.enable_tree_linenumbers) {
 		html("<tr><td class='linenumbers'><pre>");
@@ -66,7 +66,7 @@ static void print_binary_buffer(char *buf, unsigned long size)
 	unsigned long ofs, idx;
 	static char ascii[ROWLEN + 1];
 
-	html("<table summary='blob content' class='bin-blob'>\n");
+	html("<table aria-label='blob content' class='bin-blob'>\n");
 	html("<tr><th>ofs</th><th>hex dump</th><th>ascii</th></tr>");
 	for (ofs = 0; ofs < size; ofs += ROWLEN, buf += ROWLEN) {
 		htmlf("<tr><td class='right'>%04lx</td><td class='hex'>", ofs);
@@ -264,7 +264,7 @@ static int ls_item(const struct object_id *oid, struct strbuf *base,
 static void ls_head(void)
 {
 	cgit_print_layout_start();
-	html("<table summary='tree listing' class='list'>\n");
+	html("<table aria-label='tree listing' class='list'>\n");
 	html("<tr class='nohover'>");
 	html("<th class='left'>Mode</th>");
 	html("<th class='left'>Name</th>");
-- 
2.20.1



More information about the CGit mailing list