Closed Bug 1461610 Opened 6 years ago Closed 1 year ago

Zooming in or out an image doesn't change the cursor into a magnifying-glass

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED
109 Branch
Tracking Status
firefox60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox109 --- verified
firefox110 --- verified

People

(Reporter: obotisan, Assigned: tnikkel)

Details

Attachments

(1 file)

[Affected versions]:
- Latest Nightly 61.0a1
- beta 61.0b4
- Firefox 60.0

[Affected platforms]:
- Windows 10 x64
- Windows 7 x64
- Ubuntu 16.04 x64
- macOS 10.13

[Steps to reproduce]:
1. Go to http://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg
2. Zoom in or out using Ctrl + mouse wheel. 
3. Observe the cursor's behaviour.

[Expected result]:
- The cursor changes into a magnifying-glass that shows the actions you can do (zoom in or zoom out)

[Actual result]:
- The cursor remains the same until the image becomes bigger than the browser's window. 

[Regression range]:
- last good: 2008-02-07
- last bad: 2008-02-08

[Additional notes]:
- The image changes back to the original size after it was zoomed in or out and the image is clicked, but the cursor doesn't change only if the image is bigger than the browser window. 
- This is not a regression technically speaking, it's more about the date that the browser changed it's behaviour regarding the action of zooming in and out pf an image. 
- Before the behaviour was similar to what Chrome does at the moment. When you zoom in the image, the cursors change, but after clicking the image gets either bigger or a smaller. It doesn't goes back to the original size.
Component: Panning and Zooming → Layout
> 2. Zoom in or out using Ctrl + mouse wheel. 
> 3. Observe the cursor's behaviour.
> 
> [Expected result]:
> - The cursor changes into a magnifying-glass that shows the actions you can do (zoom in or zoom out)

Specifically, the cursor should perhaps change *as soon as you've done any zooming at all* on this image viewer page. There doesn't seem to be any reason to wait until the image is bigger than the window size.  That window-size dependency seems arbitrary.

I suspect [?] the intent of this cursor-change is to indicate what will happen if you click. And the availability of this "click to restore original zoomlevel" action *only* depends on whether or not you've zoomed -- not on whether or not we've exceeded the window size.
(Though maybe the intent of this cursor is to be a hint for the reverse scenario -- e.g. when you load an extremely high-res image and we zoom out by default so that it fits your browser window, and we change the cursor as a small hint that you can click to view it at full scale if you really want to...)

It would be interesting to track down the bug/changeset that "broke" this to see the reasoning there & if this was an intentional change or not.
So, when you zoom in to make the image overflow, you would see a magnifying-glass cursor, which is controlled by rule in ImageDocument.css[1], and the classes there is controlled by ImageDocument[2], and click handling code is also there[3].

We probably should change the logic in [2] to make it match that in [3].


[1] https://searchfox.org/mozilla-central/rev/d4b9e50875ad7e5d20f2fee6a53418315f6dfcc0/layout/style/ImageDocument.css#16-18
[2] https://searchfox.org/mozilla-central/rev/d4b9e50875ad7e5d20f2fee6a53418315f6dfcc0/dom/html/ImageDocument.cpp#557-582
[3] https://searchfox.org/mozilla-central/rev/d4b9e50875ad7e5d20f2fee6a53418315f6dfcc0/dom/html/ImageDocument.cpp#642-658
Component: Layout → DOM
Priority: -- → P3
Maybe Andrew or Timothy are interested?
Flags: needinfo?(tnikkel)
Flags: needinfo?(aosmond)
Component: DOM → DOM: Core & HTML
Flags: needinfo?(aosmond)
Severity: normal → S3

Clicking on the image toggles between "shrink to fit" and full size mode. However it also
resets the full zoom. So if the full zoom has been changed then a click can zoom in/out.

The full situation is complicated because you could be in "shrink to fit" mode (so the cursor
should be the zoom in cursor) and then increase the full zoom so that image is bigger than it
would be in fullsize mode so clicking would actually result in zooming out. I don't try to
resolve this. Instead I just let cursor be decided by the "shrink to fit"/full size state if
that's relevant, otherwise the fullzoom will determine the cursor.

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED
Flags: needinfo?(tnikkel)
Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7e750a604f4e
In image documents change the cursor to zoom in/out based on full zoom. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Flags: qe-verify+

Reproducible on a 2022-11-16 Nightly build on macOS 12.
Verified as fixed on Firefox 109.0b3(build ID: 20221215185833) and Nightly 110.0a1(build ID: 20221215195521) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: