Commit 5edcc2dc authored by Kenjiro NAKAYAMA's avatar Kenjiro NAKAYAMA Committed by Ted Zlatanov
Browse files

eww: support disabled and readonly text

* net/eww.el (eww-form-text): Support text form with disabled and readonly attributes.
parent d49fbfd6
......@@ -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 <ruediger@c-plusplus.de>
......
......@@ -680,18 +680,22 @@ appears in a <link> or <a> 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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment