aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-09-05 15:42:26 +0200
committerLars Ingebrigtsen2020-09-05 15:42:26 +0200
commitb9bdc48b4c79c88e36216b404997084fecf1bed2 (patch)
treea46f6d4a0c0fe342c84bd6a73d26149cc8aa7e74
parent81657507c296843971e4a921377451ecc3739e5e (diff)
downloademacs-b9bdc48b4c79c88e36216b404997084fecf1bed2.tar.gz
emacs-b9bdc48b4c79c88e36216b404997084fecf1bed2.zip
Fix <optgroup> in selects in eww
* lisp/net/eww.el (eww-tag-select): Use all the options. This fixes the problem with <optgroup> elements that wrap them (bug#43217).
-rw-r--r--lisp/net/eww.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 04deb5bee05..dedf1c62717 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1402,16 +1402,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
1402 (options nil) 1402 (options nil)
1403 (start (point)) 1403 (start (point))
1404 (max 0)) 1404 (max 0))
1405 (dolist (elem (dom-non-text-children dom)) 1405 (dolist (elem (dom-by-tag dom 'option))
1406 (when (eq (dom-tag elem) 'option) 1406 (when (dom-attr elem 'selected)
1407 (when (dom-attr elem 'selected) 1407 (nconc menu (list :value (dom-attr elem 'value))))
1408 (nconc menu (list :value (dom-attr elem 'value)))) 1408 (let ((display (dom-text elem)))
1409 (let ((display (dom-text elem))) 1409 (setq max (max max (length display)))
1410 (setq max (max max (length display))) 1410 (push (list 'item
1411 (push (list 'item 1411 :value (dom-attr elem 'value)
1412 :value (dom-attr elem 'value) 1412 :display display)
1413 :display display) 1413 options)))
1414 options))))
1415 (when options 1414 (when options
1416 (setq options (nreverse options)) 1415 (setq options (nreverse options))
1417 ;; If we have no selected values, default to the first value. 1416 ;; If we have no selected values, default to the first value.