]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix <optgroup> in selects in eww
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 5 Sep 2020 13:42:26 +0000 (15:42 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 5 Sep 2020 13:42:26 +0000 (15:42 +0200)
* lisp/net/eww.el (eww-tag-select): Use all the options.  This
fixes the problem with <optgroup> elements that wrap them (bug#43217).

lisp/net/eww.el

index 04deb5bee056c4c13e5ea2379634046b3ca551f1..dedf1c62717d84906426d1435ed4a73b0129322c 100644 (file)
@@ -1402,16 +1402,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
        (options nil)
        (start (point))
        (max 0))
-    (dolist (elem (dom-non-text-children dom))
-      (when (eq (dom-tag elem) 'option)
-       (when (dom-attr elem 'selected)
-         (nconc menu (list :value (dom-attr elem 'value))))
-       (let ((display (dom-text elem)))
-         (setq max (max max (length display)))
-         (push (list 'item
-                     :value (dom-attr elem 'value)
-                     :display display)
-               options))))
+    (dolist (elem (dom-by-tag dom 'option))
+      (when (dom-attr elem 'selected)
+       (nconc menu (list :value (dom-attr elem 'value))))
+      (let ((display (dom-text elem)))
+       (setq max (max max (length display)))
+       (push (list 'item
+                   :value (dom-attr elem 'value)
+                   :display display)
+             options)))
     (when options
       (setq options (nreverse options))
       ;; If we have no selected values, default to the first value.