Backed out changeset 18c139fe8859 (bug 1675894) for selectionchange.tentative.html failures CLOSED TREE

This commit is contained in:
Bogdan Tara
2020-12-05 14:45:37 +02:00
parent f8cb249c67
commit 1981b0d0f7
2 changed files with 119 additions and 106 deletions

View File

@@ -2098,19 +2098,10 @@ void TextControlState::SetSelectionRange(
if (changed) {
// It sure would be nice if we had an existing Element* or so to work with.
RefPtr<AsyncEventDispatcher> asyncDispatcher = new AsyncEventDispatcher(
mTextCtrlElement, eFormSelect, CanBubble::eYes);
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(mTextCtrlElement, u"select"_ns,
CanBubble::eYes, ChromeOnlyDispatch::eNo);
asyncDispatcher->PostDOMEvent();
// SelectionChangeEventDispatcher covers this when !IsSelectionCached().
// XXX(krosylight): Shouldn't it fire before select event?
// Currently Gecko and Blink both fire selectionchange after select.
if (IsSelectionCached() &&
StaticPrefs::dom_select_events_textcontrols_enabled()) {
asyncDispatcher = new AsyncEventDispatcher(
mTextCtrlElement, eSelectionChange, CanBubble::eNo);
asyncDispatcher->PostDOMEvent();
}
}
if (NS_FAILED(rv)) {