Bug 329509 - allow dispatching event when element is disabled. r=annevk,smaug

Allow untrusted Events and Custom events to be dispatched at disabled form element. This is for interop and some developers have asked for this.

Differential Revision: https://phabricator.services.mozilla.com/D10000
This commit is contained in:
Marcos Cáceres
2018-10-31 08:55:33 +00:00
parent 4b3c93bd80
commit 62fdb0177b
17 changed files with 172 additions and 35 deletions

View File

@@ -3372,9 +3372,9 @@ HTMLInputElement::NeedToInitializeEditorForEvent(
}
bool
HTMLInputElement::IsDisabledForEvents(EventMessage aMessage)
HTMLInputElement::IsDisabledForEvents(WidgetEvent* aEvent)
{
return IsElementDisabledForEvents(aMessage, GetPrimaryFrame());
return IsElementDisabledForEvents(aEvent, GetPrimaryFrame());
}
void
@@ -3382,7 +3382,7 @@ HTMLInputElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
{
// Do not process any DOM events if the element is disabled
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
if (IsDisabledForEvents(aVisitor.mEvent)) {
return;
}