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

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

bug#15860: 24.3.50; [PATCH] eww: Handle optgroup tag.


From: nakayamakenjiro
Subject: bug#15860: 24.3.50; [PATCH] eww: Handle optgroup tag.
Date: Tue, 12 Nov 2013 00:53:34 +0900
User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.2

If HTML has optgroup tag, the select box with options disapears. eww should 
support optgroup tag.

Signed-off-by: Kenjiro Nakayama <address@hidden>
---
 lisp/net/eww.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 573715e..4fe88b6 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -725,7 +725,15 @@ appears in a <link> or <a> tag."
        (options nil)
        (start (point))
        (max 0))
-    (dolist (elem cont)
+    (let ((opelem))
+    (cond ((eq (car (car cont)) 'optgroup)
+         (dolist (groupelem cont)
+           (unless (cdr (assq :disabled (cdr groupelem)))
+              (setq opelem (nconc opelem (cdr (cdr groupelem)))))
+             ))
+         (t
+          (setq opelem cont)))
+    (dolist (elem opelem)
       (when (eq (car elem) 'option)
        (when (cdr (assq :selected (cdr elem)))
          (nconc menu (list :value
@@ -735,7 +743,7 @@ appears in a <link> or <a> tag."
          (push (list 'item
                      :value (cdr (assq :value (cdr elem)))
                      :display display)
-               options))))
+               options)))))
     (when options
       (setq options (nreverse options))
       ;; If we have no selected values, default to the first value.
-- 
1.8.3.1





reply via email to

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