mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 343953, @ nsGenericHTMLElement::PostHandleEventForAnchors, r=bryner, sr=jst, p=mh+mozilla@glandium.org
This commit is contained in:
parent
2ba1526c57
commit
b7137c1ce5
@ -1499,13 +1499,15 @@ nsGenericHTMLElement::PostHandleEventForAnchors(nsEventChainPostVisitor& aVisito
|
||||
if (win) {
|
||||
nsIFocusController *focusController =
|
||||
win->GetRootFocusController();
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
|
||||
if(domElement)
|
||||
focusController->SetFocusedElement(domElement);
|
||||
break;
|
||||
if (focusController) {
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
|
||||
if(domElement)
|
||||
focusController->SetFocusedElement(domElement);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1169,13 +1169,15 @@ nsHTMLInputElement::SetFocus(nsPresContext* aPresContext)
|
||||
nsCOMPtr<nsPIDOMWindow> win = doc->GetWindow();
|
||||
if (win) {
|
||||
nsIFocusController *focusController = win->GetRootFocusController();
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
focusController->SetFocusedWindow(win);
|
||||
focusController->SetFocusedElement(this);
|
||||
if (focusController) {
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
focusController->SetFocusedWindow(win);
|
||||
focusController->SetFocusedElement(this);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1215,13 +1217,15 @@ nsHTMLInputElement::Select()
|
||||
nsPIDOMWindow *win = doc->GetWindow();
|
||||
if (win) {
|
||||
nsIFocusController *focusController = win->GetRootFocusController();
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
focusController->SetFocusedWindow(win);
|
||||
focusController->SetFocusedElement(this);
|
||||
SelectAll(presContext);
|
||||
return NS_OK;
|
||||
if (focusController) {
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
focusController->SetFocusedWindow(win);
|
||||
focusController->SetFocusedElement(this);
|
||||
SelectAll(presContext);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1612,7 +1612,8 @@ nsGlobalWindow::SetDocShell(nsIDocShell* aDocShell)
|
||||
nsIFocusController *focusController =
|
||||
nsGlobalWindow::GetRootFocusController();
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (focusController)
|
||||
focusController->GetActive(&isActive);
|
||||
// only restore OS chrome if the closing window was active
|
||||
|
||||
if (isActive) {
|
||||
|
Loading…
Reference in New Issue
Block a user