aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRĂ¼diger Sonderfeld2013-12-01 16:38:43 +0100
committerLars Magne Ingebrigtsen2013-12-01 16:38:43 +0100
commit10240949caee9cab6c29237dac743cfe6726fc76 (patch)
tree1168f35f35cc8e6f8ea652ffc4e158a3884e0a00
parent8feacce0ea243a23270b5941e07ffb5b5898f1f8 (diff)
downloademacs-10240949caee9cab6c29237dac743cfe6726fc76.tar.gz
emacs-10240949caee9cab6c29237dac743cfe6726fc76.zip
Treat HTML5 input types as text
* net/eww.el (eww-text-input-types): : New const. (eww-process-text-input): Treat input types in `eww-text-input-types' as text.
-rw-r--r--lisp/net/eww.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index ef03c7281be..2f481c31b15 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -634,12 +634,19 @@ appears in a <link> or <a> tag."
634 :name (cdr (assq :name cont)))) 634 :name (cdr (assq :name cont))))
635 (insert " "))) 635 (insert " ")))
636 636
637(defconst eww-text-input-types '("text" "password" "textarea"
638 "color" "date" "datetime" "datetime-local"
639 "email" "month" "number" "search" "tel"
640 "time" "url" "week")
641 "List of input types which represent a text input.
642See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
643
637(defun eww-process-text-input (beg end length) 644(defun eww-process-text-input (beg end length)
638 (let* ((form (get-text-property (min (1+ end) (point-max)) 'eww-form)) 645 (let* ((form (get-text-property (min (1+ end) (point-max)) 'eww-form))
639 (properties (text-properties-at end)) 646 (properties (text-properties-at end))
640 (type (plist-get form :type))) 647 (type (plist-get form :type)))
641 (when (and form 648 (when (and form
642 (member type '("text" "password" "textarea"))) 649 (member type eww-text-input-types))
643 (cond 650 (cond
644 ((zerop length) 651 ((zerop length)
645 ;; Delete some space at the end. 652 ;; Delete some space at the end.