diff options
| author | Jim Porter | 2024-06-23 12:25:25 -0700 |
|---|---|---|
| committer | Jim Porter | 2024-07-04 12:14:37 -0700 |
| commit | 6d082f3c79269f00308d6e8b7d31d6a119376fe2 (patch) | |
| tree | 29cbb23773a685de02ea81ae4e4f1277cda3fa22 /test | |
| parent | 3ce7e4ee3f1f8bf85c2c455ac624bec6c7cd10a8 (diff) | |
| download | emacs-6d082f3c79269f00308d6e8b7d31d6a119376fe2.tar.gz emacs-6d082f3c79269f00308d6e8b7d31d6a119376fe2.zip | |
In SHR, keep track of image sizes as specified by the HTML
Previously, these values got lost when zooming the image.
* lisp/net/shr.el (shr-tag-img): Set 'image-dom-size'...
(shr-zoom-image): ... use it. Rename 'size' to 'zoom'.
(shr-image-fetched): Rename 'image-size' to 'image-zoom'.
(shr-put-image): Accept the zoom level as ':zoom' and document it.
Previously, FLAGS was a mix of alist and plist(!).
* test/lisp/net/shr-tests.el (shr-test/zoom-image): Rename "size" to
"zoom".
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/shr-tests.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index c813103b408..f8559df5272 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el | |||
| @@ -172,14 +172,14 @@ settings, then once more for each (OPTION . VALUE) pair.") | |||
| 172 | (shr-test-wait-for (lambda () (= put-image-calls 2)) | 172 | (shr-test-wait-for (lambda () (= put-image-calls 2)) |
| 173 | "Timed out waiting to zoom image") | 173 | "Timed out waiting to zoom image") |
| 174 | ;; Check that we have a single image at original size. | 174 | ;; Check that we have a single image at original size. |
| 175 | (let (image-sizes) | 175 | (let (image-zooms) |
| 176 | (goto-char (point-min)) | 176 | (goto-char (point-min)) |
| 177 | (while (< (point) (point-max)) | 177 | (while (< (point) (point-max)) |
| 178 | (when (get-text-property (point) 'display) | 178 | (when (get-text-property (point) 'display) |
| 179 | (push (get-text-property (point) 'image-size) image-sizes)) | 179 | (push (get-text-property (point) 'image-zoom) image-zooms)) |
| 180 | (goto-char (or (next-single-property-change (point) 'display) | 180 | (goto-char (or (next-single-property-change (point) 'display) |
| 181 | (point-max)))) | 181 | (point-max)))) |
| 182 | (should (equal image-sizes '(original)))))))))) | 182 | (should (equal image-zooms '(original)))))))))) |
| 183 | 183 | ||
| 184 | (require 'shr) | 184 | (require 'shr) |
| 185 | 185 | ||