From 5edcc2dc142f88558704a71ca46e5577561b232b Mon Sep 17 00:00:00 2001 From: Kenjiro NAKAYAMA Date: Sat, 21 Dec 2013 15:42:23 -0500 Subject: [PATCH] eww: support disabled and readonly text * net/eww.el (eww-form-text): Support text form with disabled and readonly attributes. --- lisp/ChangeLog | 2 ++ lisp/net/eww.el | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42fd827c38d..0f6f824471d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,8 @@ (eww-history-browse, eww-history-quit, eww-history-kill) (eww-history-mode-map, eww-history-mode): New command and functions to list browser histories. + (eww-form-text): Support text form with disabled + and readonly attributes. 2013-12-21 Rüdiger Sonderfeld diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 8bcfb4838b6..36a91f8f10b 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -680,18 +680,22 @@ appears in a or tag." (value (or (cdr (assq :value cont)) "")) (width (string-to-number (or (cdr (assq :size cont)) - "40")))) + "40"))) + (readonly-property (if (or (cdr (assq :disabled cont)) + (cdr (assq :readonly cont))) + 'read-only + 'inhibit-read-only))) (insert value) (when (< (length value) width) (insert (make-string (- width (length value)) ? ))) (put-text-property start (point) 'face 'eww-form-text) (put-text-property start (point) 'local-map eww-text-map) - (put-text-property start (point) 'inhibit-read-only t) + (put-text-property start (point) readonly-property t) (put-text-property start (point) 'eww-form - (list :eww-form eww-form - :value value - :type type - :name (cdr (assq :name cont)))) + (list :eww-form eww-form + :value value + :type type + :name (cdr (assq :name cont)))) (insert " "))) (defconst eww-text-input-types '("text" "password" "textarea" -- 2.39.2