Bug 503943, add mouse capturing api to elements, remove capturing from views, r=roc,sr=smaug
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user