diff --git a/content/xbl/builtin/htmlBindings.xml b/content/xbl/builtin/htmlBindings.xml
index eb601745d650..f29efb68aad2 100644
--- a/content/xbl/builtin/htmlBindings.xml
+++ b/content/xbl/builtin/htmlBindings.xml
@@ -30,43 +30,7 @@ Can't yet put script tags in XBL (hyatt has the bug)
-->
-
-
-
+
diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp
index 0999710e4916..7119efe3fe9e 100644
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -194,7 +194,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver, nsIDOMEven
nsCOMPtr tag;
mHandlerElement->GetTag(*getter_AddRefs(tag));
PRBool isXULKey = (tag.get() == nsXULAtoms::key);
-
+
PRBool isReceiverCommandElement = PR_FALSE;
nsCOMPtr content(do_QueryInterface(aReceiver));
if (isXULKey && content && content.get() != mHandlerElement)
@@ -862,6 +862,20 @@ PRInt32 nsXBLPrototypeHandler::KeyToMask(PRInt32 key)
return cControl; // for warning avoidance
}
+void
+nsXBLPrototypeHandler::GetEventType(nsAWritableString &type)
+{
+ mHandlerElement->GetAttribute(kNameSpaceID_None, kTypeAtom, type);
+
+ if (type.IsEmpty()) {
+ // If we're a XUL key element, let's assume that we're "keypress".
+ nsCOMPtr tag;
+ mHandlerElement->GetTag(*getter_AddRefs(tag));
+ if (tag.get() == kKeyAtom)
+ type = NS_LITERAL_STRING("keypress");
+ }
+}
+
void
nsXBLPrototypeHandler::ConstructMask()
{
diff --git a/content/xbl/src/nsXBLPrototypeHandler.h b/content/xbl/src/nsXBLPrototypeHandler.h
index b9d8139309e7..c31c659114bf 100644
--- a/content/xbl/src/nsXBLPrototypeHandler.h
+++ b/content/xbl/src/nsXBLPrototypeHandler.h
@@ -84,6 +84,7 @@ protected:
inline PRInt32 GetMatchingKeyCode(const nsString& aKeyName);
void ConstructMask();
+ void GetEventType(nsAWritableString& type);
PRBool ModifiersMatchMask(nsIDOMUIEvent* aEvent);
inline PRBool KeyEventMatched(nsIDOMKeyEvent* aKeyEvent);