This commit is contained in:
Dão Gottwald 2009-10-13 19:23:48 +02:00
Родитель 3ae47529de
Коммит 64f88bd2e9
2 изменённых файлов: 20 добавлений и 12 удалений

Просмотреть файл

@ -4791,16 +4791,6 @@ function asyncOpenWebPanel(event)
var wrapper = null;
if (linkNode) {
wrapper = linkNode;
// javascript links should be executed in the current browser
if (wrapper.href.substr(0, 11) === "javascript:") {
if (event.button == 1) {
loadURI(wrapper.href, null, null, false);
return false;
}
return true;
}
if (event.button == 0 && !event.ctrlKey && !event.shiftKey &&
!event.altKey && !event.metaKey) {
// A Web panel's links should target the main content area. Do this
@ -4817,6 +4807,12 @@ function asyncOpenWebPanel(event)
return true;
if (wrapper.getAttribute("onclick"))
return true;
// javascript links should be executed in the current browser
if (wrapper.href.substr(0, 11) === "javascript:")
return true;
// data links should be executed in the current browser
if (wrapper.href.substr(0, 5) === "data:")
return true;
try {
urlSecurityCheck(wrapper.href, wrapper.ownerDocument.nodePrincipal);
@ -4830,6 +4826,7 @@ function asyncOpenWebPanel(event)
if (!url)
return true;
loadURI(url, null, postData.value, false);
event.preventDefault();
return false;
}
else if (linkNode.getAttribute("rel") == "sidebar") {
@ -4839,11 +4836,12 @@ function asyncOpenWebPanel(event)
PlacesUIUtils.showMinimalAddBookmarkUI(makeURI(wrapper.href),
wrapper.getAttribute("title"),
null, null, true, true);
event.preventDefault();
return false;
}
}
else {
return !handleLinkClick(event, wrapper.href, linkNode);
handleLinkClick(event, wrapper.href, linkNode);
}
return true;
@ -4865,7 +4863,8 @@ function asyncOpenWebPanel(event)
}
if (href) {
href = makeURLAbsolute(baseURI, href);
return !handleLinkClick(event, href, null);
handleLinkClick(event, href, null);
return true;
}
}
if (event.button == 1 &&
@ -4888,6 +4887,7 @@ function handleLinkClick(event, href, linkNode)
if (event.ctrlKey) {
#endif
openNewTabWith(href, doc, null, event, false);
event.stopPropagation();
return true;
}
@ -4902,6 +4902,7 @@ function handleLinkClick(event, href, linkNode)
if (event.shiftKey) {
openNewWindowWith(href, doc, null, false);
event.stopPropagation();
return true;
}
@ -4918,6 +4919,7 @@ function handleLinkClick(event, href, linkNode)
openNewTabWith(href, doc, null, event, false);
else
openNewWindowWith(href, doc, null, false);
event.stopPropagation();
return true;
}
return false;

Просмотреть файл

@ -5081,6 +5081,12 @@ nsGenericElement::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
case NS_MOUSE_CLICK:
if (NS_IS_MOUSE_LEFT_CLICK(aVisitor.mEvent)) {
nsInputEvent* inputEvent = static_cast<nsInputEvent*>(aVisitor.mEvent);
if (inputEvent->isControl || inputEvent->isMeta ||
inputEvent->isAlt ||inputEvent->isShift) {
break;
}
// The default action is simply to dispatch DOMActivate
nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();
if (shell) {