Bug 1679474 - Removed DispatchSelectEvent from HTMLInputElement::PostHandleEvent. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D154776
This commit is contained in:
@@ -3013,22 +3013,6 @@ void HTMLInputElement::Select() {
|
||||
TextControlState::ScrollAfterSelection::No);
|
||||
}
|
||||
|
||||
void HTMLInputElement::DispatchSelectEvent(nsPresContext* aPresContext) {
|
||||
// If already handling select event, don't dispatch a second.
|
||||
if (!mHandlingSelectEvent) {
|
||||
// FYI: If you want to skip dispatching eFormSelect event and if there are
|
||||
// no event listeners, you can refer
|
||||
// nsPIDOMWindow::HasFormSelectEventListeners(), but be careful about
|
||||
// some C++ event handlers, e.g., EventTarget::PostHandleEvent().
|
||||
WidgetEvent event(true, eFormSelect);
|
||||
|
||||
mHandlingSelectEvent = true;
|
||||
EventDispatcher::Dispatch(static_cast<nsIContent*>(this), aPresContext,
|
||||
&event);
|
||||
mHandlingSelectEvent = false;
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLInputElement::SelectAll(nsPresContext* aPresContext) {
|
||||
nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
|
||||
|
||||
@@ -3747,7 +3731,6 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
||||
if (shouldSelectAllOnFocus) {
|
||||
RefPtr<nsPresContext> presContext =
|
||||
GetPresContext(eForComposedDoc);
|
||||
DispatchSelectEvent(presContext);
|
||||
SelectAll(presContext);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user