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

This commit is contained in:
Neil Deakin 2015-10-27 08:53:00 -04:00
Родитель ccef9e2575
Коммит a38d52b60a
2 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1197,6 +1197,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
@ -9551,6 +9553,17 @@ nsGlobalWindow::GetFocusMethod()
return mFocusMethod;
}
void
nsGlobalWindow::InitializeShowFocusRings()
{
nsPIDOMWindow* root = GetPrivateRoot();
if (root) {
bool showAccelerators, showFocusRings;
root->GetKeyboardIndicators(&showAccelerators, &showFocusRings);
mShowFocusRings = showFocusRings;
}
}
bool
nsGlobalWindow::ShouldShowFocusRing()
{
@ -9655,15 +9668,6 @@ nsGlobalWindow::SetReadyForFocus()
bool oldNeedsFocus = mNeedsFocus;
mNeedsFocus = false;
// update whether focus rings need to be shown using the state from the
// root window
nsPIDOMWindow* root = GetPrivateRoot();
if (root) {
bool showAccelerators, showFocusRings;
root->GetKeyboardIndicators(&showAccelerators, &showFocusRings);
mShowFocusRings = showFocusRings;
}
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm)
fm->WindowShown(this, oldNeedsFocus);

Просмотреть файл

@ -1589,6 +1589,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);