From 808f9b86ca04ec0a7fb46b5e55d43c3b0b561888 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 5 Nov 2026 20:28:50 -1000 Subject: Let a keyboard scroll the hex dump Chrome and Firefox already let an overflowing box take focus, with their own ring, but WebKit does not. The table takes focus on a mouse click as well, where focus-visible keeps the ring off. --- tests/t0104-tree.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 21fc74b..d2f5234 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -270,11 +270,20 @@ test_expect_success 'a binary file in the tree shows as a hex dump' ' ) && cgitrc_repo binrc bin && cgit_rc binrc "url=bin/tree/blob.bin" >tmp && - grep "" tmp && + grep "
" tmp && grep "
0000 00 01 02 62 69 6e" tmp && ! grep "class=.truncated." tmp ' +# The dump scrolls sideways inside its own table, which a keyboard reaches +# by focusing the table, so the table takes the focus ring links have. +test_expect_success 'a focused hex dump shows the focus ring' ' + sed -n "/^div#cgit a:focus-visible,$/,/^}/p" \ + "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" >rule && + grep "^div#cgit table.bin-blob:focus-visible" rule && + grep "^ outline: solid 2px var(--link);$" rule +' + # Each byte of the dump costs several bytes of markup, so a large binary is # dumped up to its first 64 KB and links to the whole file. test_expect_success 'a large binary is dumped only in part' ' -- cgit 2.12.1