Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0104-tree.sh | 11 |
1 file changed, 10 insertions, 1 deletion
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 "<table class=.bin-blob.>" tmp && + grep "<table class=.bin-blob. tabindex=.0. aria-label=.Hex dump.>" tmp && grep "<td class=.right.>0000</td><td class=.hex.> 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' ' |
