mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1214293, initialize show focus rings state properly in all child frames, r=smaug
This commit is contained in:
parent
1d940dfabd
commit
7257d92314
@ -1224,6 +1224,8 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
||||
|
||||
Preferences::AddStrongObserver(mObserver, "intl.accept_languages");
|
||||
}
|
||||
|
||||
InitializeShowFocusRings();
|
||||
} else {
|
||||
// |this| is an outer window. Outer windows start out frozen and
|
||||
// remain frozen until they get an inner window, so freeze this
|
||||
@ -9699,6 +9701,17 @@ nsGlobalWindow::GetFocusMethod()
|
||||
return mFocusMethod;
|
||||
}
|
||||
|
||||
void
|
||||
nsGlobalWindow::InitializeShowFocusRings()
|
||||
{
|
||||
nsPIDOMWindowOuter* root = GetPrivateRoot();
|
||||
if (root) {
|
||||
bool showAccelerators = false, showFocusRings = false;
|
||||
root->GetKeyboardIndicators(&showAccelerators, &showFocusRings);
|
||||
mShowFocusRings = showFocusRings;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsGlobalWindow::ShouldShowFocusRing()
|
||||
{
|
||||
@ -9802,14 +9815,6 @@ nsGlobalWindow::SetReadyForFocus()
|
||||
bool oldNeedsFocus = mNeedsFocus;
|
||||
mNeedsFocus = false;
|
||||
|
||||
// update whether focus rings need to be shown using the state from the
|
||||
// root window
|
||||
if (nsPIDOMWindowOuter* root = GetPrivateRoot()) {
|
||||
bool showAccelerators, showFocusRings;
|
||||
root->GetKeyboardIndicators(&showAccelerators, &showFocusRings);
|
||||
mShowFocusRings = showFocusRings;
|
||||
}
|
||||
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm) {
|
||||
fm->WindowShown(GetOuterWindow(), oldNeedsFocus);
|
||||
|
@ -1593,6 +1593,8 @@ protected:
|
||||
|
||||
inline int32_t DOMMinTimeoutValue() const;
|
||||
|
||||
void InitializeShowFocusRings();
|
||||
|
||||
// Clear the document-dependent slots on our JS wrapper. Inner windows only.
|
||||
void ClearDocumentDependentSlots(JSContext* aCx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user