summaryrefslogtreecommitdiffstats
path: root/dom/html/nsGenericHTMLElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/html/nsGenericHTMLElement.cpp')
-rw-r--r--dom/html/nsGenericHTMLElement.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp
index aa70f9cdf..17dba6da9 100644
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -2285,10 +2285,17 @@ nsGenericHTMLFormElement::FormIdUpdated(Element* aOldElement,
}
bool
-nsGenericHTMLFormElement::IsElementDisabledForEvents(EventMessage aMessage,
+nsGenericHTMLFormElement::IsElementDisabledForEvents(WidgetEvent* aEvent,
nsIFrame* aFrame)
{
- switch (aMessage) {
+ MOZ_ASSERT(aEvent);
+
+ // Allow dispatch of CustomEvent and untrusted Events.
+ if (!aEvent->IsTrusted()) {
+ return false;
+ }
+
+ switch (aEvent->mMessage) {
case eMouseMove:
case eMouseOver:
case eMouseOut:
@@ -2454,8 +2461,9 @@ nsGenericHTMLFormElement::IsLabelable() const
void
nsGenericHTMLElement::Click()
{
- if (HandlingClick())
+ if (IsDisabled() || HandlingClick()) {
return;
+ }
// Strong in case the event kills it
nsCOMPtr<nsIDocument> doc = GetComposedDoc();