diff --git a/mozilla/content/xbl/builtin/htmlBindings.xml b/mozilla/content/xbl/builtin/htmlBindings.xml index eb601745d65..f29efb68aad 100644 --- a/mozilla/content/xbl/builtin/htmlBindings.xml +++ b/mozilla/content/xbl/builtin/htmlBindings.xml @@ -30,43 +30,7 @@ Can't yet put script tags in XBL (hyatt has the bug) --> - - - + diff --git a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp index 0999710e491..7119efe3fe9 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/mozilla/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/mozilla/content/xbl/src/nsXBLPrototypeHandler.h b/mozilla/content/xbl/src/nsXBLPrototypeHandler.h index b9d8139309e..c31c659114b 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeHandler.h +++ b/mozilla/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);