GNU bug report logs - #15860
24.3.50; [PATCH] eww: Handle optgroup tag.

Previous Next

Package: emacs;

Reported by: <nakayamakenjiro <at> gmail.com>

Date: Mon, 11 Nov 2013 16:44:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.3.50

Fixed in version 24.4

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <nakayamakenjiro <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; [PATCH] eww: Handle optgroup tag.
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 <nakayamakenjiro <at> gmail.com>
---
 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




This bug report was last modified 11 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.