Bug 1386468 - Only register SelectionChangeListener for plaintext controls when dom.select_events.textcontrols.enabled is turned on; r=mystor

This commit is contained in:
Ehsan Akhgari 2017-08-01 20:27:24 -04:00
Родитель 68b377c1ce
Коммит 064dd8f2a2
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -728,8 +728,13 @@ nsFrameSelection::Init(nsIPresShell *aShell, nsIContent *aLimiter)
}
}
bool plaintextControl = (aLimiter != nullptr);
bool initSelectEvents = plaintextControl ?
sSelectionEventsOnTextControlsEnabled :
sSelectionEventsEnabled;
nsIDocument* doc = aShell->GetDocument();
if (sSelectionEventsEnabled ||
if (initSelectEvents ||
(doc && nsContentUtils::IsSystemPrincipal(doc->NodePrincipal()))) {
int8_t index = GetIndexFromSelectionType(SelectionType::eNormal);
if (mDomSelections[index]) {