Closed
Bug 1218144
Opened 9 years ago
Closed 11 months ago
Context menu entry "View image info" should select the image automatically
Categories
(Firefox :: Page Info Window, defect)
Firefox
Page Info Window
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: 08xjcec48, Assigned: aryx)
References
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151022152545
Steps to reproduce:
1. Open the direct link to an image: https://upload.wikimedia.org/wikipedia/commons/5/55/Firefox_40_on_Windows_10.png
2. Right-click on it
3. Pick the "View image info" option
Actual results:
Firefox now shows another address (chrome://global/skin/media/imagedoc-darknoise.png) besides the opened image, and I need to click on the proper address to finally see the image info.
Expected results:
"View image info" should open the info to that image alone, and not display "chrome://global/skin/media/imagedoc-darknoise.png".
Summary: Image context menu "View image info" shows chrome://global/skin/media/imagedoc-darknoise.png → Image context menu entry "View image info" shows chrome://global/skin/media/imagedoc-darknoise.png
Attachment #8678530 -
Attachment description: Untitled-1.png → "View image info" bug.
Attachment #8678530 -
Attachment filename: Untitled-1.png → view_image_info_bug.png
Attachment #8678530 -
Attachment description: "View image info" bug. → "View image info" bug
![]() |
Assignee | |
Comment 1•9 years ago
|
||
Listing the background image there is likely correct (think about a tab with content from within an extension), but at least the image in the foreground should be selected.
Status: UNCONFIRMED → NEW
Component: Untriaged → Page Info Window
Ever confirmed: true
Summary: Image context menu entry "View image info" shows chrome://global/skin/media/imagedoc-darknoise.png → context menu entry "View image info" should show/select image if in image viewer mode, not chrome://global/skin/media/imagedoc-darknoise.png
Comment 2•9 years ago
|
||
OS: Unspecified → All
Hardware: Unspecified → x86_64
Version: 42 Branch → 48 Branch
![]() |
Assignee | |
Updated•8 years ago
|
Assignee: nobody → aryx.bugmail
Status: NEW → ASSIGNED
![]() |
Assignee | |
Comment 3•8 years ago
|
||
What happened here:
The information of the image on which the context menu got used always uses the image element's title attribute as imageText, or if it doesn't find it the alt attribute:
https://dxr.mozilla.org/mozilla-central/rev/16effd5b21ab03629feca04b5b83911bb757394c/browser/base/content/content.js#1039-1047
When the information for all the images (which will be used by the Media tab of the Page Info window) gets collected, imageText only gets set if it's not a background image (doesn't apply for View Image Info) and neither an SVGImageElement nor an ImageDocument:
https://dxr.mozilla.org/mozilla-central/rev/16effd5b21ab03629feca04b5b83911bb757394c/browser/base/content/content.js#1252-1263
But for the View Image page, it's an ImageDocument, so matching in the Page Info window fails:
https://dxr.mozilla.org/mozilla-central/rev/16effd5b21ab03629feca04b5b83911bb757394c/browser/base/content/pageinfo/pageInfo.js#1069
Comment hidden (mozreview-request) |
Comment 5•8 years ago
|
||
mozreview-review |
Comment on attachment 8839247 [details]
Bug 1218144 - also select image in Page Info window when opened from View Image page.
https://reviewboard.mozilla.org/r/113940/#review117924
Sorry for the delay here; I was on PTO most of last week.
::: browser/base/content/content.js:1043
(Diff revision 1)
>
> getImageInfo(imageElement) {
> let imageInfo = null;
> if (imageElement) {
> + let imageText;
> + if (!(imageElement instanceof content.SVGImageElement) &&
The fix looks reasonable, but I think we need a short comment here to explain why this test matters, or it's likely someone may regress this in the future.
Also, is there any chance you could add test coverage for this? http://searchfox.org/mozilla-central/source/browser/base/content/test/general/browser_bug517902.js can be used as inspiration (although we'll need to tweak this test a bit in bug 1326910).
Attachment #8839247 -
Flags: review?(florian)
Comment hidden (mozreview-request) |
![]() |
Assignee | |
Comment 7•8 years ago
|
||
This might still be more of a feedback request. The passes here but if it would be great if you can advice on two issues:
1) For the first context menu, I have to call |hidePopup()| - awaitPopupHidden doesn't work like for the second one. How should this be done?
2) How does one handle the Page Info window opening and loading async? Services.ww.registerNotification works, but a yield BrowserTestUtils(aSubject, "load") got ignored. It loads about:blank first, so one has to wait for that xul one.
Flags: needinfo?(florian)
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8839247 [details]
Bug 1218144 - also select image in Page Info window when opened from View Image page.
https://reviewboard.mozilla.org/r/113940/#review119600
Thanks for adding the test!
Does the SVG case not matter enough to be covered too?
::: browser/base/content/test/pageinfo/browser_viewImageInfo_from_viewImagePage.js:10
(Diff revision 2)
> + let pageSource = encodeURI("data:text/html," +
> + "<style type='text/css'>%23test-image,%23not-test-image {background-image: url('about:logo?c');}</style>" +
> + "<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" +
> + "<img src='about:logo?b' height=300 width=350 alt=2>" +
> + "<img src='about:logo?a' height=200 width=250>" +
> + "<img id='showContextMenu' src='about:logo?b' height=200 width=250 alt=1>" +
I would make this url unique, so that the test really verifies the right image has been selected in the list. Eg. about:logo?d or about:logo?context
Attachment #8839247 -
Flags: review?(florian) → review+
Comment 9•8 years ago
|
||
(In reply to Sebastian Hengst [:aryx][:archaeopteryx] (needinfo on intermittent or backout) from comment #7)
Ah, I didn't see this comment before looking at the patch.
> This might still be more of a feedback request. The passes here but if it
> would be great if you can advice on two issues:
>
> 1) For the first context menu, I have to call |hidePopup()| -
> awaitPopupHidden doesn't work like for the second one. How should this be
> done?
I was surprised by this hidePopup in the code, but if it works reliably, that's good enough for an r+ IMHO.
I would have tried a synthesizeMouseAtCenter call instead of the .click().
> 2) How does one handle the Page Info window opening and loading async?
> Services.ww.registerNotification works, but a yield
> BrowserTestUtils(aSubject, "load") got ignored. It loads about:blank first,
> so one has to wait for that xul one.
Other tests seem to use the page-info-dialog-loaded notification: http://searchfox.org/mozilla-central/source/browser/base/content/test/general/browser_pageInfo.js#15 (btw, this test seems a good candidate to be moved to the new folder you created).
Flags: needinfo?(florian)
Summary: context menu entry "View image info" should show/select image if in image viewer mode, not chrome://global/skin/media/imagedoc-darknoise.png → Context menu entry "View image info" should select the image automatically
Version: 68 Branch → 69 Branch
Comment 10•4 years ago
|
||
"View Image Info" was removed from the context menu in Fx87 by bug 1690029. So I think this request is obsolete now, unless there is a change of course.
Reporter | ||
Comment 11•4 years ago
|
||
This problem also happens if you open the Page info
/ More information
dialog from the main menu or the address bar padlock and then click on the Media
tab.
Updated•2 years ago
|
Severity: normal → S3
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•