Hi Willy, On 20 Aug, Willy Tarreau wrote: > Normally it's preferable to make one commit per functional change. Noted. Here are three patches then. I've taken care of explaining the reasoning behind each of these changes in the commit messages, which should answer your interrogations! :)
Cheers, ~Nicolas
>From c3f0cb4be4d5802cc3e63d4501c17be1b1392ca1 Mon Sep 17 00:00:00 2001 From: Nicolas CARPi <nico-git@deltablot.email> Date: Tue, 20 Aug 2024 15:20:10 +0200 Subject: [PATCH 3/3] BUG/MINOR: stats: add lang attribute to html tag The "html" element of the stats page was missing a "lang" attribute. This change specifies the "en" value, which corresponds to english language. It is also a required element for WCAG Success Criterion 3.1.1, which renders the web more accessible through a set of requirements. In this case it allows assistive technologies such as screen readers to determine the language of the page. MDN page: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang HTML standard: https://html.spec.whatwg.org/multipage/dom.html#attr-lang WCAG criterion: https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html --- src/stats-html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats-html.c b/src/stats-html.c index c69fb9d2a..23cfb91a0 100644 --- a/src/stats-html.c +++ b/src/stats-html.c @@ -60,7 +60,7 @@ void stats_dump_html_head(struct appctx *appctx) /* WARNING! This must fit in the first buffer !!! */ chunk_appendf(chk, "<!DOCTYPE html>\n" - "<html><head><title>Statistics Report for " PRODUCT_NAME "%s%s</title>\n" + "<html lang=\"en\"><head><title>Statistics Report for " PRODUCT_NAME "%s%s</title>\n" "<link rel=\"icon\" href=\"data:,\">\n" "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n" "<style type=\"text/css\"><!--\n" -- 2.46.0
>From c1dd4290557855b135582fc2e054c1fe1e1abe5f Mon Sep 17 00:00:00 2001 From: Nicolas CARPi <nico-git@deltablot.email> Date: Tue, 20 Aug 2024 15:08:47 +0200 Subject: [PATCH 1/3] BUG/MINOR: stats: fix color of input elements in dark mode Previously the text color was dark, with a dark background, this makes it white, and thus readable. This is visible on the "Scope" input field. --- src/stats-html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats-html.c b/src/stats-html.c index e27ff8e40..a8e63a2e2 100644 --- a/src/stats-html.c +++ b/src/stats-html.c @@ -169,7 +169,7 @@ void stats_dump_html_head(struct appctx *appctx) " h2 { color: #a265e0; }\n" " h3 { color: #ff5190; background-color: #3e3e1f; }\n" " a { color: #3391ff; }\n" - " input { background-color: #2f3437; }\n" + " input { background-color: #2f3437; color: #e8e6e3; }\n" " .hr { border-color: #8c8273; }\n" " .titre { background-color: #1aa6a6; color: #e8e6e3; }\n" " .frontend {background: #2f3437;}\n" -- 2.46.0
>From c2bcab32c95bfded64191ff8835a450eaf6152c8 Mon Sep 17 00:00:00 2001 From: Nicolas CARPi <nico-git@deltablot.email> Date: Tue, 20 Aug 2024 15:12:23 +0200 Subject: [PATCH 2/3] CLEANUP: stats: use modern DOCTYPE tag Switching the stats page doctype to the modern standard is shorter and less complex, and is the recommended doctype by current HTML standard. It makes it clear that we do not want to run in quirks mode. More information below. Quirks mode: https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode HTML Standard: https://html.spec.whatwg.org/multipage/syntax.html#the-doctype --- src/stats-html.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stats-html.c b/src/stats-html.c index a8e63a2e2..c69fb9d2a 100644 --- a/src/stats-html.c +++ b/src/stats-html.c @@ -59,8 +59,7 @@ void stats_dump_html_head(struct appctx *appctx) /* WARNING! This must fit in the first buffer !!! */ chunk_appendf(chk, - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n" - "\"http://www.w3.org/TR/html4/loose.dtd\">\n" + "<!DOCTYPE html>\n" "<html><head><title>Statistics Report for " PRODUCT_NAME "%s%s</title>\n" "<link rel=\"icon\" href=\"data:,\">\n" "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n" -- 2.46.0