Bug 503943, add mouse capturing api to elements, remove capturing from views, r=roc,sr=smaug

This commit is contained in:
Neil Deakin
2009-09-10 08:51:36 -04:00
parent b7ea8b247c
commit 12bece4d53
33 changed files with 609 additions and 646 deletions

View File

@@ -1084,6 +1084,29 @@ nsNSElementTearoff::GetClassList(nsIDOMDOMTokenList** aResult)
return NS_OK;
}
NS_IMETHODIMP
nsNSElementTearoff::SetCapture(PRBool aRetargetToElement)
{
// If there is already an active capture, ignore this request. This would
// occur if a splitter, frame resizer, etc had already captured and we don't
// want to override those.
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(nsIPresShell::GetCapturingContent());
if (node)
return NS_OK;
nsIPresShell::SetCapturingContent(mContent, aRetargetToElement ? CAPTURE_RETARGETTOELEMENT : 0);
return NS_OK;
}
NS_IMETHODIMP
nsNSElementTearoff::ReleaseCapture()
{
if (nsIPresShell::GetCapturingContent() == mContent) {
nsIPresShell::SetCapturingContent(nsnull, 0);
}
return NS_OK;
}
//----------------------------------------------------------------------