diff options
| author | Eli Zaretskii | 2017-10-06 15:42:22 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-10-06 15:42:22 +0300 |
| commit | e5bff696bcf5f54d2db9bcc8c5ce93083ac0a0d3 (patch) | |
| tree | 1035a15b00127ba7f28ff766fb02c4050843a343 | |
| parent | 6b88f78aa1bcda78793f0254a34a9cc099e7ba72 (diff) | |
| download | emacs-e5bff696bcf5f54d2db9bcc8c5ce93083ac0a0d3.tar.gz emacs-e5bff696bcf5f54d2db9bcc8c5ce93083ac0a0d3.zip | |
Revert last change in 'shr-descend'
* lisp/net/shr.el (shr-descend): Revert the part of the last
change which introduced calls to shr-indirect-call into this
function. Add a comment explaining the rationale for that.
(Bug#28402)
| -rw-r--r-- | lisp/net/shr.el | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index fe5197b35f7..260ada54222 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -483,7 +483,11 @@ size, and full-buffer size." | |||
| 483 | (apply 'shr-generic dom args))))) | 483 | (apply 'shr-generic dom args))))) |
| 484 | 484 | ||
| 485 | (defun shr-descend (dom) | 485 | (defun shr-descend (dom) |
| 486 | (let ((tag-name (dom-tag dom)) | 486 | (let ((function |
| 487 | (intern (concat "shr-tag-" (symbol-name (dom-tag dom))) obarray)) | ||
| 488 | ;; Allow other packages to override (or provide) rendering | ||
| 489 | ;; of elements. | ||
| 490 | (external (cdr (assq (dom-tag dom) shr-external-rendering-functions))) | ||
| 487 | (style (dom-attr dom 'style)) | 491 | (style (dom-attr dom 'style)) |
| 488 | (shr-stylesheet shr-stylesheet) | 492 | (shr-stylesheet shr-stylesheet) |
| 489 | (shr-depth (1+ shr-depth)) | 493 | (shr-depth (1+ shr-depth)) |
| @@ -498,7 +502,17 @@ size, and full-buffer size." | |||
| 498 | (setq style nil))) | 502 | (setq style nil))) |
| 499 | ;; If we have a display:none, then just ignore this part of the DOM. | 503 | ;; If we have a display:none, then just ignore this part of the DOM. |
| 500 | (unless (equal (cdr (assq 'display shr-stylesheet)) "none") | 504 | (unless (equal (cdr (assq 'display shr-stylesheet)) "none") |
| 501 | (shr-indirect-call tag-name dom) | 505 | ;; We don't use shr-indirect-call here, since shr-descend is |
| 506 | ;; the central bit of shr.el, and should be as fast as | ||
| 507 | ;; possible. Having one more level of indirection with its | ||
| 508 | ;; negative effect on performance is deemed unjustified in | ||
| 509 | ;; this case. | ||
| 510 | (cond (external | ||
| 511 | (funcall external dom)) | ||
| 512 | ((fboundp function) | ||
| 513 | (funcall function dom)) | ||
| 514 | (t | ||
| 515 | (shr-generic dom))) | ||
| 502 | (when (and shr-target-id | 516 | (when (and shr-target-id |
| 503 | (equal (dom-attr dom 'id) shr-target-id)) | 517 | (equal (dom-attr dom 'id) shr-target-id)) |
| 504 | ;; If the element was empty, we don't have anything to put the | 518 | ;; If the element was empty, we don't have anything to put the |