Bug 1214293, initialize show focus rings state properly in all child frames, r=smaug

This commit is contained in:
Neil Deakin 2016-03-18 15:44:40 -04:00
parent 1d940dfabd
commit 7257d92314
2 changed files with 15 additions and 8 deletions

View File

@ -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);

View File

@ -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);