Last Comment Bug 487692 - Fix context menu IDs and accesskeys and add a test for them
: Fix context menu IDs and accesskeys and add a test for them
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: UI Design (show other bugs)
: Trunk
: All All
: -- normal (vote)
: seamonkey2.1a1
Assigned To: Robert Kaiser
:
:
Mentors:
: 484381 (view as bug list)
Depends on: 484187
Blocks: SmTestFail 562705 562711
  Show dependency treegraph
 
Reported: 2009-04-09 14:37 PDT by Robert Kaiser
Modified: 2010-05-04 11:41 PDT (History)
1 user (show)
bugzillamozillaorg_serge_20140323: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
a1+


Attachments
context menu fixes, v0 (33.78 KB, patch)
2009-04-09 14:45 PDT, Robert Kaiser
no flags Details | Diff | Splinter Review
base on current Firefox test, fix all other known problems (395.23 KB, patch)
2010-04-21 09:18 PDT, Robert Kaiser
neil: review+
Details | Diff | Splinter Review
fix up Windows (2.87 KB, patch)
2010-04-22 15:12 PDT, Robert Kaiser
no flags Details | Diff | Splinter Review
test images with links, fix Windows (15.50 KB, patch)
2010-04-22 17:07 PDT, Robert Kaiser
neil: review+
Details | Diff | Splinter Review
More juggling (7.26 KB, patch)
2010-04-23 12:59 PDT, neil@parkwaycc.co.uk
kairo: feedback-
Details | Diff | Splinter Review

Description Robert Kaiser 2009-04-09 14:37:32 PDT
The discussion surrounding the context menu tests and fixes going along with it is becoming too long in bug 484187 to hold off landing of the infrastructure and the well-working tests, so I'm splitting this off into its own bug report here.
Comment 1 Robert Kaiser 2009-04-09 14:45:58 PDT
Created attachment 371937 [details] [diff] [review]
context menu fixes, v0

This is basically just the context menu part of bug 484187, for reference to build further work upon.
Comment 2 Robert Kaiser 2010-04-21 09:18:03 PDT
Created attachment 440529 [details] [diff] [review]
base on current Firefox test, fix all other known problems

INFO Passed: 646
INFO Failed: 0
INFO Todo:   0

This patch takes into account all comments from bug 484187 and updates this to the state the Firefox test is in right now, where it also checks activated/deactivated menuitems, as well as working and not working videos.

I'd be very much for going and getting this in with what it has, and then adding other possible states of the context menu if needed to the test.
Comment 3 Robert Kaiser 2010-04-21 09:20:14 PDT
Oh, and sorry for that patch being that large in bytes, most of it is adding the video.ogg needed for testing that a context menu with a correct video has the right states. If that patch needs further iterations, I guess I'll split off the video into its own patch.
Comment 4 Robert Kaiser 2010-04-22 06:33:38 PDT
Pushed as http://hg.mozilla.org/comm-central/rev/028eebe1606b
Comment 5 Robert Kaiser 2010-04-22 08:52:38 PDT
Serge, didn't see you on IRC so CCing and commenting here instead.

I'll watch test results as much as I'm around today, but I have to leave for a bit, and it could be that Windows fails some part of this test (set image as wallpaper might be around there) and if so, I'll try to come up with a patch-blind fix for it, but I don't have Windows around to run the test myself.

Linux should work fine, I tested that locally, Mac just passed successfully (I hope, as I couldn't detect what chunk it runs in).
Comment 6 Robert Kaiser 2010-04-22 08:55:09 PDT
(In reply to comment #5)
> Mac just passed successfully (I
> hope, as I couldn't detect what chunk it runs in).

Ah, found it at last: mochitest-plain-5 as I expected, and yes, passed fine on Mac.
Comment 7 Robert Kaiser 2010-04-22 14:31:19 PDT
1095 ERROR TEST-UNEXPECTED-FAIL | /tests/suite/browser/test/test_contextmenu.html | menuitem context-savepage has same accesskey as context-setWallpaper
1119 ERROR TEST-UNEXPECTED-FAIL | /tests/suite/browser/test/test_contextmenu.html | checking item #9 (---) name - got "context-setWallpaper", expected "---"

All others are just confusion by the latter one.

For the accesskey, the good thing is that "Select All" is always hidden on images, so we can re-use "A" there (label is "Set As Wallpaper") from what I see.

For the item itself, we need to detect either if the shell service is present or if we're on Windows.
Comment 8 Robert Kaiser 2010-04-22 15:12:09 PDT
Created attachment 440887 [details] [diff] [review]
fix up Windows

It's not particularly pretty, but this patch does the job and somewhat leaves the flow and logic of those arrays intact for a reader.
Comment 9 neil@parkwaycc.co.uk 2010-04-22 16:06:27 PDT
Comment on attachment 440887 [details] [diff] [review]
fix up Windows

Ideally you would use the same hasShell logic as nsContextMenu.js so that you don't have to fix the test should someone implement the shell service on Mac or Linux.

"A" is sadly used by "Save Page"...
Comment 10 neil@parkwaycc.co.uk 2010-04-22 16:11:43 PDT
Sorry, I was looking at an unpatched build. It actually conflicts with Copy Email Address.
Comment 11 neil@parkwaycc.co.uk 2010-04-22 16:19:25 PDT
Sigh, View Image and Open Link in New Window both use W...
Comment 12 Robert Kaiser 2010-04-22 17:07:22 PDT
Created attachment 440918 [details] [diff] [review]
test images with links, fix Windows

OK, I decided to just add tests for images with links as well, so that we know we don't conflict there. I found a solution that should pass all those tests, and I found a better solution for the shellservice check, I hope.
Comment 13 Robert Kaiser 2010-04-22 17:08:27 PDT
Oh, and reopening this as long as we have something to do in here.
Comment 14 neil@parkwaycc.co.uk 2010-04-23 12:59:21 PDT
Created attachment 441117 [details] [diff] [review]
More juggling

I didn't like your use of y as the access key to Copy Image, so I moved Copy Image to C, which meant I couldn't move Block Image to c, so I moved that to o, but that meant moving Reject popup windows to u, which meant moving View Source to o. But I then had to tweak nsContextMenu.js so that View Selection Source didn't appear on an image, Reject popup windows didn't appear on a textbox and Copy didn't appear on an image, and also I made it so Search web for... didn't appear on a link (they both use S). So the test might need changing ;-)
Comment 15 Robert Kaiser 2010-04-23 14:17:14 PDT
Sorry, now we are at the point where I start to cry and almost want to throw away everything.

Deciding what to show for what items just because of access keys is not only wrong but plain wrong and - ok, let's leave too strong words out of this.

I now am at the point where I refuise to look at any patch unless it contains a decsription of what is _useful_ to show on what context menu, and I'm about to either back out the patch I already checked in or mark this an Alpha blocker and nag you daily until we have a decent plan of what are useful items to show in which case - and ONLY THEN assign accesskeys, perhaps from scratch.

I can't believe we're even thinking about changing what's available in an accesskey based on the mere needs of a single of the languages we're supporting!
Comment 16 neil@parkwaycc.co.uk 2010-04-23 15:06:16 PDT
Comment on attachment 441117 [details] [diff] [review]
More juggling

Please read comment 14 while I repeatedly thwap Bugzilla for its stupidity...
Comment 17 Robert Kaiser 2010-04-24 08:34:54 PDT
OK, as I said, I'm completely disagreeing with "I didn't like your use of <x> as the access key to <foo>, so [...] I then had to tweak nsContextMenu.js so that <bar> didn't appear". That's coming from the wrong way, it's better to first decide which context menu entries we should show where (I agree it's longer than needed in a number of cases) and only then attack the accesskey problem again.

Because of that, I'm now going through all cases the patched test after my attachment 440918 [details] [diff] [review] would cover, and try to reason about all entries we're showing there at the moment, listing all IMHO questionable ones here.

So, here's my result and questions:

// Context menu for plain text

Looks reasonable.

// Context menu for text link

"context-bookmarkpage", "context-savepage", "context-sendpage"

Are those reasonable here? Shouldn't people always easily be able to click outside of a link to do those instead? Can't they even be confusing due to their similarity to the same actions on the link target?

// Context menu for text mailto-link

Same as for text links, though less confusion.

// Context menu for text input field

Looks reasonable.

// Context menu for an image

"context-bookmarkpage", "context-savepage", "context-sendpage" are again somewhat questionable, but thinking about popups having an image (even a linked one?) over their whole size and no top-level menu, I can see some reasoning for wanting this.
I also disagree with removing "View Selection Source" from images, as I tend to use that point to see the markup behind certain elements on screen, and that includes images.

Note: No selections in the test so far, so "View Selection Source" is UNTESTED right now.

// Context menu for an image with a link

Do we really need the whole list of image items here? I wonder if it would be OK to just leave "View Image" here and remove all other image-related items (context-*image, contest-setWallpaper). People wanting those actions can always "view image" and do those things from there.

// Context menu for an image with a mailto: link

Same as above, can we remove all image items except "View Image"?

// Context menu for a canvas

Looks reasonable (mostly, after comparison with FF).

// Context menu for a video

Looks reasonable.

// Context menu for an iframe

Looks reasonable.
Comment 18 Robert Kaiser 2010-04-24 08:45:27 PDT
Comment on attachment 441117 [details] [diff] [review]
More juggling

As said in comment #17, I don't agree with the change to "context-viewpartialsource-selection", I'm also not convinced by the "context-searchselect" change as I can easily come up with use cases where I'd want that.
The "popupwindow-reject/allow" change seems reasonable, though, but "context-sep-popup" needs to be hidden on text inputs as well, then.
I'm also not sure about removing "context-copy" from images, I don't see why it would be less useful there than elsewhere.

We definitely need to add tests for selections, I see that now.

And as I said above, if we go for thinking about removing some items, let's think that through and decide it before fixing any other accesskeys. Not liking an accesskey can't be the reason for removing items, we need to think about use-cases instead.
Comment 19 neil@parkwaycc.co.uk 2010-04-24 12:30:31 PDT
(In reply to comment #18)
> The "popupwindow-reject/allow" change seems reasonable, though, but
> "context-sep-popup" needs to be hidden on text inputs as well, then.
Good point.

> I'm also not sure about removing "context-copy" from images, I don't see why it
> would be less useful there than elsewhere.
I thought it was justified on the basis that "Copy Image" already copies it in text and HTML format. (I can't justify the other changes.)

> We definitely need to add tests for selections, I see that now.
In that case you'll want to figure out what to do for a context menu on a selected image. (Block vs. Copy)
Comment 20 neil@parkwaycc.co.uk 2010-04-24 15:26:39 PDT
Comment on attachment 440918 [details] [diff] [review]
test images with links, fix Windows

We got away with using y for Copy Image Location on Linux for 2.0.x so I guess it's better than nothing, and we can at least move forward...
Comment 21 neil@parkwaycc.co.uk 2010-04-24 15:32:19 PDT
Also, sorry for not noticing comment #15 - when I hit submit I didn't hang around and as a result I didn't see Bugzilla's stupid multiple requestee message until later and I didn't know you had already commented when I then went and completed the action I had originally intended to make.

(In reply to comment #17)
> Shouldn't people always easily be able to click
> outside of a link to do those instead?
But then again this is almost justification for not allowing Search Web on a link or View Partial Source on an image ;-)
Comment 22 Robert Kaiser 2010-04-29 11:05:41 PDT
Pushed Windows fixup and linked image test patch as http://hg.mozilla.org/comm-central/rev/87899a3eea57

Will file followups in a moment.
Comment 23 Robert Kaiser 2010-04-29 11:26:51 PDT
*** Bug 484381 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.