DOM - implement selection events (fire selectstart and selectionchange events on the input node when the selection in that editor changes)

This commit is contained in:
janekptacijarabaci
2017-07-05 02:15:40 +02:00
committed by Roy Tam
parent c9c922e580
commit 6ba8f06d1a
4 changed files with 240 additions and 16 deletions
+5
View File
@@ -92,6 +92,9 @@ public:
return NS_OK;
}
AutoHideSelectionChanges hideSelectionChanges
(mFrame->GetConstFrameSelection());
if (mFrame) {
// SetSelectionRange leads to Selection::AddRange which flushes Layout -
// need to block script to avoid nested PrepareEditor calls (bug 642800).
@@ -1208,6 +1211,8 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
return NS_OK;
}
AutoHideSelectionChanges hideSelectionChanges(GetConstFrameSelection());
// Don't attempt to initialize recursively!
InitializationGuard guard(*this);
if (guard.IsInitializingRecursively()) {