bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15704: [PATCH 2/8] EWW: Handle HTML5 input types as text input.


From: Rüdiger Sonderfeld
Subject: bug#15704: [PATCH 2/8] EWW: Handle HTML5 input types as text input.
Date: Fri, 25 Oct 2013 01:43:28 +0200
User-agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; )

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üdiger Sonderfeld <address@hidden>
---
 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)
                             :name (cdr (assq :name cont))))
     (insert " ")))
 
+(defconst eww-text-input-types '("text" "password" "textarea"
+                                 "color" "date" "datetime" "datetime-local"
+                                 "email" "month" "number" "search" "tel"
+                                 "time" "url" "week")
+  "List of input types which represent a text input.
+See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
+
 (defun eww-process-text-input (beg end length)
   (let* ((form (get-text-property (min (1+ end) (point-max)) 'eww-form))
         (properties (text-properties-at end))
         (type (plist-get form :type)))
     (when (and form
-              (member type '("text" "password" "textarea")))
+              (member type eww-text-input-types))
       (cond
        ((zerop length)
        ;; Delete some space at the end.
-- 
1.8.4.1







reply via email to

[Prev in Thread] Current Thread [Next in Thread]