Closed
Bug 117805
Opened 23 years ago
Closed 23 years ago
Context menus don't work in XML documents
Categories
(Core :: XML, defect)
Core
XML
Tracking
()
VERIFIED
FIXED
mozilla0.9.8
People
(Reporter: caillon, Assigned: caillon)
References
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
546 bytes,
text/html
|
Details | |
556 bytes,
application/xhtml+xml
|
Details | |
948 bytes,
patch
|
jag+mozilla
:
review+
jag+mozilla
:
superreview+
|
Details | Diff | Splinter Review |
Linux 2002010206 - Right clicking on a document served with an XML mime type will not allow for any context menus to appear. The same page served with a text/html mime type will allow for context menus. Testcases coming up.
Assignee | ||
Comment 1•23 years ago
|
||
Context menu appears in HTML mode
Assignee | ||
Comment 2•23 years ago
|
||
Context menu will not appear in XML mode
Updated•23 years ago
|
Severity: normal → major
confirmed on w2k with win32 build 2001123008 trunk
Keywords: regression
OS: Linux → All
Samir, your checkin to fix bug 15176 broke this. XML document does not have getSelection() method, it is a method of the interface nsIDOMNSHTMLDocument. Is there any other way to achieve what you want?
Hardware: PC → All
Comment 5•23 years ago
|
||
The reason we changed from _content.getSelection() to ownerDocument.getSelection() is that the former would not give us the selection when in documents within a frameset. If there is some other way to get the selection with and without frames we should switch over.
Assignee | ||
Comment 6•23 years ago
|
||
Right clicking brings up these 11 warnings and 3 errors in the JS console: (11 times) Warning: reference to undefined property this.target.ownerDocument.getSelection Source File: chrome://communicator/content/nsContextMenu.js Line: 636 --------------- Error: this.target.ownerDocument.getSelection is not a function Source File: chrome://communicator/content/nsContextMenu.js Line: 636 Error: gContextMenu has no properties Source File: chrome://messenger/content/mailNavigatorOverlay.xul Line: 62 Error: gContextMenu has no properties Source File: chrome://editor/content/editorApplicationOverlay.js Line: 64
Keywords: mozilla0.9.8
Assignee | ||
Comment 7•23 years ago
|
||
Assignee | ||
Comment 8•23 years ago
|
||
Taking if you don't mind, Heikki. The attached patch checks to see if |this.target.ownerDocument.getSelection()| is a function for the current document. If it is, we'll use it and if not we use the older |_content.getSelection()| Seeking r=/sr=
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Christopher, that is not a full solution. Think about XHTML frameset documents...
Comment on attachment 64297 [details] [diff] [review] Proposed fix v1.0 r=heikki I am in favor of checking this in on the trunk, because the fix to bug 116523 will fix this for real later.
Attachment #64297 -
Flags: review+
Comment 11•23 years ago
|
||
Comment on attachment 64297 [details] [diff] [review] Proposed fix v1.0 >Index: resources/content/nsContextMenu.js >=================================================================== >RCS file: /cvsroot/mozilla/xpfe/communicator/resources/content/nsContextMenu.js,v >retrieving revision 1.48 >diff -u -r1.48 nsContextMenu.js >--- resources/content/nsContextMenu.js 2001/12/21 00:43:53 1.48 >+++ resources/content/nsContextMenu.js 2002/01/10 17:19:26 >@@ -633,7 +633,11 @@ > }, > > searchSelected : function() { >- var searchStr = this.target.ownerDocument.getSelection(); >+ var searchStr; >+ if (typeof this.target.ownerDocument.getSelection == "function") A better way of doing this would be: if ("getSelection" in this.target.ownerDocument) Could you add a comment pointing to bug 117805 and bug 116523, and add a comment to the latter bug mentioning this change can be undone once that is fixed?
Attachment #64297 -
Flags: needs-work+
Assignee | ||
Comment 12•23 years ago
|
||
Attachment #64297 -
Attachment is obsolete: true
Comment 13•23 years ago
|
||
Comment on attachment 64975 [details] [diff] [review] Patch v.2 with jag's changes sr=jag Carrying over Heikki's r=, which I'm sure still stands.
Attachment #64975 -
Flags: superreview+
Attachment #64975 -
Flags: review+
Comment 14•23 years ago
|
||
isn't getSelection deprecated?
Assignee | ||
Comment 15•23 years ago
|
||
Henrik, yes that is bug 116523 which this bug depends on -- this is just a workaround to get context menus back in XML. attachment 64975 [details] [diff] [review] has been checked in by bbaetz. Heikki should we leave this open for the real fix? Or just check back after Samir fixes 116523?
Let's mark this fixed and keep eye on Samir when he fixes bug 116523, it will HAVE to work on XML as well...
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 17•23 years ago
|
||
*** Bug 121133 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•