From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nicolas Graner Newsgroups: gmane.emacs.bugs Subject: bug#43542: EWW should default checkbox value to "on" Date: Mon, 21 Sep 2020 02:00:48 +0200 Message-ID: <871riwrob3.fsf@hypra-graner> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40151"; mail-complaints-to="usenet@ciao.gmane.io" To: 43542@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 21 02:02:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kK9HX-000AKI-9j for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 02:02:11 +0200 Original-Received: from localhost ([::1]:46360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK9HW-0000Mi-1E for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Sep 2020 20:02:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK9HO-0000MJ-Iw for bug-gnu-emacs@gnu.org; Sun, 20 Sep 2020 20:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kK9HO-0002dD-8V for bug-gnu-emacs@gnu.org; Sun, 20 Sep 2020 20:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kK9HO-00062o-6V for bug-gnu-emacs@gnu.org; Sun, 20 Sep 2020 20:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Graner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2020 00:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43542 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160064647023176 (code B ref -1); Mon, 21 Sep 2020 00:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Sep 2020 00:01:10 +0000 Original-Received: from localhost ([127.0.0.1]:52964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kK9GX-00061k-Qn for submit@debbugs.gnu.org; Sun, 20 Sep 2020 20:01:10 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kK9GS-00061Z-6X for submit@debbugs.gnu.org; Sun, 20 Sep 2020 20:01:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK9GR-0000IK-Jl for bug-gnu-emacs@gnu.org; Sun, 20 Sep 2020 20:01:03 -0400 Original-Received: from smtp26.services.sfr.fr ([93.17.128.163]:32737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK9GK-0002Y3-Oj for bug-gnu-emacs@gnu.org; Sun, 20 Sep 2020 20:01:02 -0400 Original-Received: from hypra-graner (37.124.67.86.rev.sfr.net [86.67.124.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by msfrf2601.sfr.fr (SMTP Server) with ESMTPS id 1FC3B1C000413 for ; Mon, 21 Sep 2020 02:00:50 +0200 (CEST) X-mail-filterd: 1.0.0 X-sfr-mailing: LEGIT X-sfr-spamrating: 40 X-sfr-spam: not-spam DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=universite-paris-saclay.fr; s=202006; t=1600646450; h=From:To:Subject:Date ; bh=UBhWHd3GL929LNjNANfhUzS3eFSIsYPb0PgCL27i0mk=; b=c9/4YRXvKWst3exgIM3+MsX NwzKXCZuoZUPIjG/td0yYV1p67EEhbtrg6UmwbfCiYPUapNf6y1EP0CKdPeUjDIjKVsKgc7BXbvP 5s/z2/bN/AfDf/O0lvfSXrenrZ28Z8qjS5oXZ2AamTUt+mP8hRHndmp5AbS6OZc0o3Y/Y2SrFbu8 t7FS0Ixp3NWpWWHUVSY5TFtseZMUSjC3TXSt1g+OREsKHU/tLGxOCH25CnYksEyim5e3s82ZLM07 Zr1M1c/soupMsV8SVlTF/7VzenY2S2Zu1Ue93aq7yVjYbk4dBkkEwf8/o9c+SAVpI93EMpHY44fh gV5BAhyU1GAIIxQ==; Original-Received: from hypra-graner (37.124.67.86.rev.sfr.net [86.67.124.37]) by msfrf2601.sfr.fr (SMTP Server) with ESMTP id 03BFC1C000401 for ; Mon, 21 Sep 2020 02:00:50 +0200 (CEST) Original-Received: from hypra-graner (37.124.67.86.rev.sfr.net [86.67.124.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by msfrf2601.sfr.fr (SMTP Server) with ESMTPS for ; Mon, 21 Sep 2020 02:00:49 +0200 (CEST) Received-SPF: pass client-ip=93.17.128.163; envelope-from=nicolas.graner@sfr.fr; helo=smtp26.services.sfr.fr X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 20:00:50 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188549 Archived-At: In EWW, when a has no 'value' attribute, when it is checked, its value is taken as nil (empty). According to HTML specification, it should be taken as "on". Example: --------------------------------------------------
-------------------------------------------------- If you open the above file and hit "submit", the request is: foo?box2=&box1=bar instead of: foo?box2=on&box1=bar Suggested patch: -------------------------------------------------- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 8918be0d2e..55eded6ce6 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1634,7 +1634,7 @@ eww-submit (cond ((member (plist-get input :type) '("checkbox" "radio")) (when (plist-get input :checked) - (push (cons name (plist-get input :value)) + (push (cons name (or (plist-get input :value) "on")) values))) ((equal (plist-get input :type) "file") (when-let ((file (plist-get input :filename))) -------------------------------------------------- Nicolas.