зеркало из https://github.com/mozilla/gecko-dev.git
Fixed context menus to work when right clicking over image links. Detabbed file too. b=114427 r=chak@netscape.com sr=blizzard@mozilla.org
This commit is contained in:
Родитель
61aed7e6fd
Коммит
ab43b4f842
|
@ -361,8 +361,21 @@ void CBrowserFrame::BrowserFrameGlueObj::ShowContextMenu(PRUint32 aContextFlags,
|
|||
// 1. We first get the nsIDOMHTMLAnchorElement
|
||||
// 2. We then get the URL associated with the link
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> linkElement(do_QueryInterface(aNode, &rv));
|
||||
if(NS_FAILED(rv))
|
||||
|
||||
// Search for an anchor element
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> linkElement;
|
||||
nsCOMPtr<nsIDOMNode> node = aNode;
|
||||
while (node)
|
||||
{
|
||||
linkElement = do_QueryInterface(node);
|
||||
if (linkElement)
|
||||
break;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> parentNode;
|
||||
node->GetParentNode(getter_AddRefs(parentNode));
|
||||
node = parentNode;
|
||||
}
|
||||
if (!linkElement)
|
||||
return;
|
||||
|
||||
rv = linkElement->GetHref(strUrlUcs2);
|
||||
|
|
Загрузка…
Ссылка в новой задаче