Closed Bug 1065714 Opened 10 years ago Closed 9 years ago

Right-click context menu should not be shown on the Hello panel nor the Hello conversation window

Categories

(Hello (Loop) :: Client, defect, P3)

x86_64
Windows 7
defect

Tracking

(firefox45 fixed)

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed
backlog backlog+

People

(Reporter: jaws, Assigned: fcampo)

References

Details

Attachments

(1 file, 1 obsolete file)

STR:
Open the Loop panel
Right-click on a blank area outside of the Call URL textbox

Expected:
Nothing happens

Actual:
Get a content context menu that offers to View Source, View Page Info, etc.

This menu is confusing and non-native for browser chrome. The View Source menuitem doesn't work, and the View Page Info doesn't provide any value to the user since this is considered part of the browser.

I think I saw this same bug with the chat window, but I can't get the chat window to work right now to confirm.
This is kinda a duplicate of bug 1029861, but I'm going to add it as a dependency, as we may need Loop-specific things in the menus.
Depends on: 1029861
Do we need to uplift this in to Fx34?  Don't get me wrong.  I'd take this fix if it were available today, but I think other bugs are more pressing.  (I'm asking if you're ok with my removing loop-uplift.)
Flags: needinfo?(standard8)
Flags: needinfo?(jaws)
Its presence or interaction within won't cause any functional issues, so we can remove it from the loop-uplift tracking, although it would be nice to get it fixed.
Flags: needinfo?(standard8)
Flags: needinfo?(jaws)
Thanks, Jared.
Whiteboard: [loop-uplift]
backlog: --- → Fx36?
backlog: Fx36? → Fx38?
Priority: -- → P3
backlog: Fx38? → backlog+
Rank: 39
Flags: firefox-backlog+
Note: Mike says the key to fixing this would be to disable the context menu on the browser element that's being created in PanelFrame.jsm.

Probably just for Loop for now.
Summary: Right-click context menu should not be shown on about:looppanel → Right-click context menu should not be shown on the Hello panel nor the Hello conversation window
Sevaan: If we just remove the context menu, is that ok with you?
Flags: needinfo?(sfranks)
Yes please.
Flags: needinfo?(sfranks)
Assignee: nobody → fernando.campo
So far I've been unable to create a reliable test to check that the context menu is not being created, any advice is welcome

Also, lets not overload Mark with more reviews :)
Attachment #8682445 - Flags: review?(edilee)
Comment on attachment 8682445 [details] [diff] [review]
Right-click context menu should not be shown on Panel nor Conversation

>+++ b/browser/components/loop/content/js/panel.jsx
>+    contextMenu: function(e) {
I believe the naming convention is handleContextMenu.
>+      e.preventDefault();
>+      return false;
fcampo: is the return false required? It sounds like from 0.14, return false won't actually do what you want.
https://facebook.github.io/react/docs/events.html#syntheticevent

>+          <div className="fte-get-started-container"
>+               onContextMenu={this.contextMenu}>
We haven't been using => in jsx files... but if we did, I would have suggested:

onContextMenu={e => e.preventDefault()}>

:( ;)


dmose: for test, I wonder if checking for focus is reliable? Some reason I feel that Linux is probably going to do something different. Any suggestions for a test? Or just skip covering this with a unit test?
Flags: needinfo?(fernando.campo)
Flags: needinfo?(dmose)
The "simple" unit test would be to check that e.preventDefault is called when simulating a context click.

Though we probably want to do something more from the mochitest side to ensure that this integrates with the browser as expected (this is a slightly different solution to comment 6, which possibly wouldn't have required a test, but in some ways is nicer as its the content code controlling it).
Tests added (following :Standard8 advice, only checking that preventDefault is called)
Changed function name following convention
Decided not to start using arrow functions to follow same code pattern than it's used (I think it's easier to read with function call in the prop)
Attachment #8682445 - Attachment is obsolete: true
Attachment #8682445 - Flags: review?(edilee)
Attachment #8683637 - Flags: review?(edilee)
Flags: needinfo?(fernando.campo)
Comment on attachment 8683637 [details] [diff] [review]
Right-click context menu should not be shown on Panel nor Conversation

I'll land this.
Flags: needinfo?(dmose)
Attachment #8683637 - Flags: review?(edilee) → review+
Comment on attachment 8683637 [details] [diff] [review]
Right-click context menu should not be shown on Panel nor Conversation

>+++ b/browser/components/loop/test/desktop-local/panel_test.js
>+        TestUtils.Simulate.contextMenu(
>+            view.getDOMNode(),
>+++ b/browser/components/loop/test/desktop-local/roomViews_test.js
>+    it("should NOT show the context menu on right click", function() {
>+        var prevent = sandbox.stub();
Fyi, I fixed the indent when landing.
https://hg.mozilla.org/integration/fx-team/rev/bbdb386545e290c40780aae83218b52ce6708bcd
Bug 1065714 - Right-click context menu should not be shown on Panel nor Conversation [r=Mardak]
https://hg.mozilla.org/mozilla-central/rev/bbdb386545e2
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
See Also: → 1222345
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: