From mboxrd@z Thu Jan 1 00:00:00 1970 From: wub at partyvan.eu (Juuso Lapinlampi) Date: Thu, 12 May 2016 19:36:29 +0000 Subject: [PATCH 4/5] ui: Fix bad value for attribute action on form elements In-Reply-To: References: <1462989858-15825-1-git-send-email-wub@partyvan.eu> <1462989858-15825-5-git-send-email-wub@partyvan.eu> <20160512192225.GA24828@partyvan.eu> Message-ID: <20160512193629.GA5410@partyvan.eu> On Thu, May 12, 2016 at 09:27:14PM +0200, Jason A. Donenfeld wrote: > Good idea with the Chrome developer tools. I just tried it myself, and > no it doesn't work. > > The switch branch form works with https://git.zx2c4.com/zmusic-ng/ and > fails with https://git.zx2c4.com/zmusic-ng which is what I suspected. > > It turns out action is not required either, and when omitted means > "this page", which is what we want and what I originally suggested: > > https://www.w3.org/TR/html5/forms.html#attr-fs-action You're right, it does fail. Thanks for testing. The "diff options" in commit diff page also uses `action='.'`. That also creates an issue. The (more) relevant WHATWG specification about action is there: https://html.spec.whatwg.org/multipage/forms.html#attr-fs-action So the action is optional. Would this patch work to fix the validation and related bugs? diff --git a/ui-diff.c b/ui-diff.c index 52ed942..edee793 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -340,7 +340,7 @@ void cgit_print_diff_ctrls(void) html("
"); html("diff options"); - html("
"); + html(""); cgit_add_hidden_formfields(1, 0, ctx.qry.page); html(""); html(""); diff --git a/ui-shared.c b/ui-shared.c index 770b685..2c88b72 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -937,7 +937,7 @@ static void print_header(void) cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL); if (ctx.env.authenticated) { html("
"); - html("\n"); + html("\n"); cgit_add_hidden_formfields(0, 1, ctx.qry.page); html(""); if (ctx.repo->max_stats > 1) {