Closed Bug 141716 Opened 23 years ago Closed 23 years ago

Mozilla context menu broken on query.cgi

Categories

(Bugzilla :: Query/Bug List, defect, P1)

2.15
x86
Linux
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: caillon, Assigned: caillon)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Using a nightly build, and probably on nightlies for a while back, there is no context menu on the query page. This is because query.cgi defines a getSelection() JS method. However, getSelection() is a method of the DOM0 window object (global scope). Defining this function over-writes the native method and uses the bugzilla method instead. Because context menu relies on window.getSelection() for its Search engine context menu, the context menu breaks. The bug is two-fold. Bugzilla should not use getSelection or any other names such as this, and Mozilla should either prevent getSelection from being modified by code like this, or not break when this happens. This bug covers renaming the getSelection() method in Bugzilla. I will file a separate bug for the Mozilla issue.
Attached patch Proposed fix v1.0 (obsolete) — Splinter Review
use bzFoo() instead of foo() for function names.
Status: NEW → ASSIGNED
Keywords: patch, review
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.16
Comment on attachment 82008 [details] [diff] [review] Proposed fix v1.0 I'd like to see a senior member of the team OK these changes, as I personally hate name prefixing. I understand it's a band-aid that will fix things for our main user base which I'm okay with, though.
Attachment #82008 - Flags: review+
I recommend changing getSelection to get_selection for 2.16 and deal with the naming issue in the 2.18 timeframe. That way only the simplest, least-risky fix goes into the 2.16 release, and there's more time to talk about naming conventions.
Comment on attachment 82008 [details] [diff] [review] Proposed fix v1.0 What myk said. I don't suppose JS has namespaces? Thats how C++ gets out of this mess...
Attachment #82008 - Flags: review-
> I don't suppose JS has namespaces? Not in JS 1.x. IIRC it is in the JS 2.0/ECMA 262 4th Edition proposal...
Attachment #82008 - Attachment is obsolete: true
Comment on attachment 82366 [details] [diff] [review] v1.1: s/getSelection/get_selection/ I still say this is a moz bug, but it fixes it for me, so r=bbaetz x2
Attachment #82366 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: