Fix context menu flags when right mousing on an image on a page that has a background image. Fix mfcembed menu code to exercise this functionality. b=178988 r=chak@netscape.c sr=blizzard@mozilla.org

git-svn-id: svn://10.0.0.236/trunk@138353 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie
2003-02-24 19:08:54 +00:00
parent 2d0321a981
commit 0cd4bc93d0
5 changed files with 41 additions and 37 deletions

View File

@@ -1566,19 +1566,19 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
}
else if (tag.Equals(NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator()))
{
// first check if this is a background image that the user was trying to click on
// and if the listener is ready for that (only nsIContextMenuListener2 and up)
if (menuInfoImpl && menuInfoImpl->HasBackgroundImage(node)) {
flags2 |= nsIContextMenuListener2::CONTEXT_BACKGROUND_IMAGE;
targetDOMnode = node;
}
if (!flags && !flags2) {
// only care about this if no other context was found.
flags |= nsIContextMenuListener::CONTEXT_DOCUMENT;
flags2 |= nsIContextMenuListener2::CONTEXT_DOCUMENT;
targetDOMnode = node;
}
if (!(flags & nsIContextMenuListener::CONTEXT_IMAGE)) {
// first check if this is a background image that the user was trying to click on
// and if the listener is ready for that (only nsIContextMenuListener2 and up)
if (menuInfoImpl && menuInfoImpl->HasBackgroundImage(node)) {
flags2 |= nsIContextMenuListener2::CONTEXT_BACKGROUND_IMAGE;
}
}
break; // exit do-while
}
else if ( tag.EqualsWithConversion("object", PR_TRUE) || /* XXX what about images and documents? */