Closed
Bug 293758
Opened 19 years ago
Closed 19 years ago
Context menu screw-up with data and javascript protocol images
Categories
(Firefox :: Menus, defect, P2)
Firefox
Menus
Tracking
()
VERIFIED
FIXED
Firefox1.5
People
(Reporter: martijn.martijn, Assigned: Gavin)
References
()
Details
(Keywords: regression, testcase)
Attachments
(2 files, 1 obsolete file)
2.90 KB,
text/html
|
Details | |
3.10 KB,
patch
|
Gavin
:
review+
asa
:
approval-aviary1.1a2+
|
Details | Diff | Splinter Review |
Right-clicking on the xbm image (the image with the letters XBM, it is an image with a javascript: protocol) doesn't give the right context menu anymore on the url testcase. This doesn't happen in 2005-01-28 build, but it happens in 2005-03-01 build: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-02-28+07%3A00%3A00&maxdate=2005-03-01+09%3A00%3A00&cvsroot=%2Fcvsroot My guess: this is a fall-out from bug 278772.
Reporter | ||
Comment 1•19 years ago
|
||
This is a testcase with a data protocol image embedded.
Updated•19 years ago
|
Assignee | ||
Comment 2•19 years ago
|
||
Ok, the problem is that images from javascript: or data: don't have a "host", so http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/base/content/browser.js&rev=1.422&mark=3927#3907 fails. What is expected behavior? Hide the context menu item for such images? Previously, the context menu showed "Block images from image" (data:) or "Block images from <host>" (javascript:) and had no effect.
Assignee: nobody → gavin.sharp
Priority: -- → P2
Target Milestone: --- → Firefox1.1
Context Menu -> View Image gives me 2 errors in the console: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://browser/content/browser.js :: anonymous :: line 3713" data: no] Error: gContextMenu has no properties Source File: chrome://browser/content/browser.xul Line: 1 Middle-clicking it instead of left-clicking gives me: Error: gContextMenu has no properties Source File: chrome://browser/content/utilityOverlay.js Line: 223 instead of the second one above. Following that link shows me: // Used as an onclick handler for UI elements with link-like behavior. // e.g. onclick="checkForMiddleClick(this, event);" function checkForMiddleClick(node, event) { if (event.button == 1) { /* Execute the node's oncommand. * * Using eval() because of bug 246720. Would like to use node.oncommand(event). * * Since we're using eval(): * * |event| is correct because the name of this function's formal parameter matches * the automatic name of the formal parameter for oncommand, |event|. * * |this| is incorrect. To make it correct, we would have to use Function.call. */ eval(node.getAttribute("oncommand")); // If the middle-click was on part of a menu, close the menu. // (Menus close automatically with left-click but not with middle-click.) closeMenus(event.target); } } But that's another bug.
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Component: General → Menus
OS: Windows 2000 → All
Hardware: PC → All
Assignee | ||
Comment 4•19 years ago
|
||
Attachment #183690 -
Flags: review?(mconnor)
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch-r?]
Assignee | ||
Updated•19 years ago
|
Flags: blocking1.8b3?
Comment 5•19 years ago
|
||
Comment on attachment 183690 [details] [diff] [review] Patch r=me with the comment changed to: // this throws if the image URI doesn't have a host (eg, data: image URIs) // see bug 296758 for details "//xxx" is more of a fixme comment, where this is the right fix.
Attachment #183690 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 6•19 years ago
|
||
New patch addressing review comment, carrying over mconnor's r+ and asking for 1.1a2 approval for a regression fix.
Attachment #183690 -
Attachment is obsolete: true
Attachment #186154 -
Flags: review+
Attachment #186154 -
Flags: approval-aviary1.1a2?
Updated•19 years ago
|
Attachment #186154 -
Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch-r?] → [patch-r+][checkin needed][a+]
Comment 7•19 years ago
|
||
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Flags: blocking1.8b3?
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch-r+][checkin needed][a+]
Comment 8•19 years ago
|
||
(In reply to comment #5) > (From update of attachment 183690 [details] [diff] [review] [edit]) > // see bug 296758 for details The bug number here was mistyped, and the typo survived into the actual checkin. The current tree state may make fixing this a bit annoying, but it *is* a risk-free fix.
Assignee | ||
Comment 9•19 years ago
|
||
Thanks for noticing that Jeff, I've checked in the correction.
Updated•15 years ago
|
QA Contact: general → menus
You need to log in
before you can comment on or make changes to this bug.
Description
•