From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Newsgroups: gmane.emacs.bugs Subject: bug#15704: [PATCH 2/8] EWW: Handle HTML5 input types as text input. Date: Fri, 25 Oct 2013 01:43:28 +0200 Message-ID: <1459420.rGztnY536f@descartes> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1382658259 8314 80.91.229.3 (24 Oct 2013 23:44:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2013 23:44:19 +0000 (UTC) Cc: Lars Magne Ingebrigtsen To: 15704@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 25 01:44:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VZUZi-0005eY-UK for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2013 01:44:23 +0200 Original-Received: from localhost ([::1]:56647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUZi-00060w-Bq for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2013 19:44:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUZZ-00060O-34 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:44:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZUZT-000744-9e for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:44:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUZT-00073u-5u for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:44:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VZUZS-0005tP-Rx for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:44:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Oct 2013 23:44:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15704 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138265824422611 (code B ref -1); Thu, 24 Oct 2013 23:44:06 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2013 23:44:04 +0000 Original-Received: from localhost ([127.0.0.1]:42018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZUZP-0005sW-FO for submit@debbugs.gnu.org; Thu, 24 Oct 2013 19:44:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59288) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZUZK-0005r4-4s for submit@debbugs.gnu.org; Thu, 24 Oct 2013 19:43:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZUZ9-0006pp-Gm for submit@debbugs.gnu.org; Thu, 24 Oct 2013 19:43:53 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUZ9-0006pi-Dm for submit@debbugs.gnu.org; Thu, 24 Oct 2013 19:43:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUZ4-0005v1-3K for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:43:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZUYx-0006gC-Be for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:43:42 -0400 Original-Received: from ptmx.org ([178.63.28.110]:41401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUYx-0006g3-5v for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 19:43:35 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id A316A2B155; Fri, 25 Oct 2013 01:43:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8nBLFnp-YJPt; Fri, 25 Oct 2013 01:43:32 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 3A5862AEE8; Fri, 25 Oct 2013 01:43:32 +0200 (CEST) User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79607 Archived-At: HTML5 adds a bunch of new input types which can be treated as text. * lisp/net/eww.el (eww-text-input-types): New const. (eww-process-text-input): Treat input types in `eww-text-input-types' as text. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/net/eww.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 989cd2e..ccc2399 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -631,12 +631,19 @@ (defun eww-form-text (cont) =09=09=09 :name (cdr (assq :name cont)))) (insert " "))) =20 +(defconst eww-text-input-types '("text" "password" "textarea" + "color" "date" "datetime" "datetime-l= ocal" + "email" "month" "number" "search" "te= l" + "time" "url" "week") + "List of input types which represent a text input. +See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Inp= ut'.") + (defun eww-process-text-input (beg end length) (let* ((form (get-text-property (min (1+ end) (point-max)) 'eww-form= )) =09 (properties (text-properties-at end)) =09 (type (plist-get form :type))) (when (and form -=09 (member type '("text" "password" "textarea"))) +=09 (member type eww-text-input-types)) (cond ((zerop length) =09;; Delete some space at the end. --=20 1.8.4.1