summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-09-19 21:15:06 +0200
committerMichael Albinus <michael.albinus@gmx.de>2022-09-19 21:15:06 +0200
commitc6d3d97bf5a75e0c4a653f3cc380371f890f4fb3 (patch)
treec080e249caaeccf026aaca5726f6c62c3bfb1e56 /lisp/net
parent0e5eb6ec8ce99c423bbafc6e8e3292d4459050d1 (diff)
parentd6b25b84bc8cde6b8d396b073945c8340e6ca40d (diff)
downloademacs-c6d3d97bf5a75e0c4a653f3cc380371f890f4fb3.tar.gz
emacs-c6d3d97bf5a75e0c4a653f3cc380371f890f4fb3.tar.bz2
emacs-c6d3d97bf5a75e0c4a653f3cc380371f890f4fb3.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/shr.el62
1 files changed, 27 insertions, 35 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 54ce9b1a41c..d56420eb02e 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -373,7 +373,6 @@ DOM should be a parse tree as generated by
shr-width
(* shr-width (frame-char-width)))
(shr--window-width)))
- (max-specpdl-size max-specpdl-size)
(shr--link-targets nil)
(hscroll (window-hscroll))
;; `bidi-display-reordering' is supposed to be only used for
@@ -625,41 +624,34 @@ size, and full-buffer size."
(shr-stylesheet shr-stylesheet)
(shr-depth (1+ shr-depth))
(start (point)))
- ;; shr uses many frames per nested node.
- (if (and (> shr-depth (/ max-specpdl-size 15))
- (not (and shr-offer-extend-specpdl
- (y-or-n-p "Too deeply nested to render properly; increase `max-specpdl-size'?")
- (setq max-specpdl-size (* max-specpdl-size 2)))))
- (setq shr-warning
- "Not rendering the complete page because of too-deep nesting")
+ (when style
+ (if (string-match-p "color\\|display\\|border-collapse" style)
+ (setq shr-stylesheet (nconc (shr-parse-style style)
+ shr-stylesheet))
+ (setq style nil)))
+ ;; If we have a display:none, then just ignore this part of the DOM.
+ (unless (or (equal (cdr (assq 'display shr-stylesheet)) "none")
+ (and shr-discard-aria-hidden
+ (equal (dom-attr dom 'aria-hidden) "true")))
+ ;; We don't use shr-indirect-call here, since shr-descend is
+ ;; the central bit of shr.el, and should be as fast as
+ ;; possible. Having one more level of indirection with its
+ ;; negative effect on performance is deemed unjustified in
+ ;; this case.
+ (cond (external
+ (funcall external dom))
+ ((fboundp function)
+ (funcall function dom))
+ (t
+ (shr-generic dom)))
+ (when-let ((id (dom-attr dom 'id)))
+ (push (cons id (set-marker (make-marker) start)) shr--link-targets))
+ ;; If style is set, then this node has set the color.
(when style
- (if (string-match-p "color\\|display\\|border-collapse" style)
- (setq shr-stylesheet (nconc (shr-parse-style style)
- shr-stylesheet))
- (setq style nil)))
- ;; If we have a display:none, then just ignore this part of the DOM.
- (unless (or (equal (cdr (assq 'display shr-stylesheet)) "none")
- (and shr-discard-aria-hidden
- (equal (dom-attr dom 'aria-hidden) "true")))
- ;; We don't use shr-indirect-call here, since shr-descend is
- ;; the central bit of shr.el, and should be as fast as
- ;; possible. Having one more level of indirection with its
- ;; negative effect on performance is deemed unjustified in
- ;; this case.
- (cond (external
- (funcall external dom))
- ((fboundp function)
- (funcall function dom))
- (t
- (shr-generic dom)))
- (when-let ((id (dom-attr dom 'id)))
- (push (cons id (set-marker (make-marker) start)) shr--link-targets))
- ;; If style is set, then this node has set the color.
- (when style
- (shr-colorize-region
- start (point)
- (cdr (assq 'color shr-stylesheet))
- (cdr (assq 'background-color shr-stylesheet))))))))
+ (shr-colorize-region
+ start (point)
+ (cdr (assq 'color shr-stylesheet))
+ (cdr (assq 'background-color shr-stylesheet)))))))
(defun shr-fill-text (text)
(if (zerop (length text))