Subject: 24.3.50; [PATCH] eww: Handle optgroup tag.

From: <[email-masked]>
Date: Tue, 12 Nov 2013 00:53:34 +0900

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

Signed-off-by: Kenjiro Nakayama <[email-masked]>
---
 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