mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 19:37:15 +00:00
Bug 1626388 - Convert dom.select_events.textcontrols.enabled to static pref r=njn
Converts dom.select_events.textcontrols.enabled to a static pref. Differential Revision: https://phabricator.services.mozilla.com/D69614 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
b0a2f87323
commit
05a7022978
@ -900,8 +900,7 @@ nsresult Selection::AddRangesForUserSelectableNodes(
|
||||
// pref, disabled by default.
|
||||
// See https://github.com/w3c/selection-api/issues/53.
|
||||
const bool executeDefaultAction = MaybeDispatchSelectstartEvent(
|
||||
*aRange, nsFrameSelection::sSelectionEventsOnTextControlsEnabled,
|
||||
doc);
|
||||
*aRange, StaticPrefs::dom_select_events_textcontrols_enabled(), doc);
|
||||
|
||||
if (!executeDefaultAction) {
|
||||
return NS_OK;
|
||||
|
@ -124,7 +124,7 @@ void SelectionChangeEventDispatcher::OnSelectionChange(Document* aDoc,
|
||||
// controls, so for now we only support doing that under a pref, disabled by
|
||||
// default.
|
||||
// See https://github.com/w3c/selection-api/issues/53.
|
||||
if (nsFrameSelection::sSelectionEventsOnTextControlsEnabled) {
|
||||
if (StaticPrefs::dom_select_events_textcontrols_enabled()) {
|
||||
nsCOMPtr<nsINode> target;
|
||||
|
||||
// Check if we should be firing this event to a different node than the
|
||||
|
@ -339,14 +339,6 @@ nsFrameSelection::nsFrameSelection(PresShell* aPresShell, nsIContent* aLimiter,
|
||||
|
||||
// This should only ever be initialized on the main thread, so we are OK here.
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
static bool prefCachesInitialized = false;
|
||||
if (!prefCachesInitialized) {
|
||||
prefCachesInitialized = true;
|
||||
|
||||
Preferences::AddBoolVarCache(&sSelectionEventsOnTextControlsEnabled,
|
||||
"dom.select_events.textcontrols.enabled",
|
||||
false);
|
||||
}
|
||||
|
||||
mAccessibleCaretEnabled = aAccessibleCaretEnabled;
|
||||
if (mAccessibleCaretEnabled) {
|
||||
@ -355,9 +347,9 @@ nsFrameSelection::nsFrameSelection(PresShell* aPresShell, nsIContent* aLimiter,
|
||||
}
|
||||
|
||||
bool plaintextControl = (aLimiter != nullptr);
|
||||
bool initSelectEvents = plaintextControl
|
||||
? sSelectionEventsOnTextControlsEnabled
|
||||
: StaticPrefs::dom_select_events_enabled();
|
||||
bool initSelectEvents =
|
||||
plaintextControl ? StaticPrefs::dom_select_events_textcontrols_enabled()
|
||||
: StaticPrefs::dom_select_events_enabled();
|
||||
|
||||
Document* doc = aPresShell->GetDocument();
|
||||
if (initSelectEvents || (doc && doc->NodePrincipal()->IsSystemPrincipal())) {
|
||||
@ -643,8 +635,6 @@ static nsINode* GetCellParent(nsINode* aDomNode) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool nsFrameSelection::sSelectionEventsOnTextControlsEnabled = false;
|
||||
|
||||
nsresult nsFrameSelection::MoveCaret(nsDirection aDirection,
|
||||
bool aContinueSelection,
|
||||
const nsSelectionAmount aAmount,
|
||||
|
@ -928,8 +928,6 @@ class nsFrameSelection final {
|
||||
|
||||
bool mDragState = false; // for drag purposes
|
||||
bool mAccessibleCaretEnabled = false;
|
||||
|
||||
static bool sSelectionEventsOnTextControlsEnabled;
|
||||
};
|
||||
|
||||
#endif /* nsFrameSelection_h___ */
|
||||
|
@ -2475,6 +2475,12 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Whether or not selection events on text controls are enabled.
|
||||
- name: dom.select_events.textcontrols.enabled
|
||||
type: bool
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
- name: dom.separate_event_queue_for_post_message.enabled
|
||||
type: bool
|
||||
value: true
|
||||
|
@ -255,13 +255,6 @@ pref("dom.indexedDB.logging.profiler-marks", false);
|
||||
// Whether or not File Handle is enabled.
|
||||
pref("dom.fileHandle.enabled", true);
|
||||
|
||||
// Whether or not selection events on text controls are enabled
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("dom.select_events.textcontrols.enabled", true);
|
||||
#else
|
||||
pref("dom.select_events.textcontrols.enabled", false);
|
||||
#endif
|
||||
|
||||
// The number of workers per domain allowed to run concurrently.
|
||||
// We're going for effectively infinite, while preventing abuse.
|
||||
pref("dom.workers.maxPerDomain", 512);
|
||||
|
Loading…
x
Reference in New Issue
Block a user