Bug 1376317 - Move the pref var cache for dom.placeholder.show_on_focus to nsContentUtils; r=smaug
This commit is contained in:
@@ -2854,15 +2854,8 @@ nsTextEditorState::UpdateOverlayTextVisibility(bool aNotify)
|
||||
mPreviewVisibility = valueIsEmpty && !previewValue.IsEmpty();
|
||||
mPlaceholderVisibility = valueIsEmpty && previewValue.IsEmpty();
|
||||
|
||||
static bool sPrefCached = false;
|
||||
static bool sPrefShowOnFocus = true;
|
||||
if (!sPrefCached) {
|
||||
sPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sPrefShowOnFocus,
|
||||
"dom.placeholder.show_on_focus", true);
|
||||
}
|
||||
|
||||
if (mPlaceholderVisibility && !sPrefShowOnFocus) {
|
||||
if (mPlaceholderVisibility &&
|
||||
!nsContentUtils::ShowInputPlaceholderOnFocus()) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
|
||||
mPlaceholderVisibility = !nsContentUtils::IsFocusedContent(content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user