diff --git a/dom/tests/mochitest/general/chrome.ini b/dom/tests/mochitest/general/chrome.ini index b6b023b42eb..d34475d2706 100644 --- a/dom/tests/mochitest/general/chrome.ini +++ b/dom/tests/mochitest/general/chrome.ini @@ -6,3 +6,4 @@ skip-if = buildapp == 'b2g' || os == 'android' [test_offsets.js] [test_offsets.xul] skip-if = buildapp == 'mulet' +[test_spacetopagedown.html] diff --git a/dom/tests/mochitest/general/test_spacetopagedown.html b/dom/tests/mochitest/general/test_spacetopagedown.html new file mode 100644 index 00000000000..03f840f3d68 --- /dev/null +++ b/dom/tests/mochitest/general/test_spacetopagedown.html @@ -0,0 +1,76 @@ + + + + + + + + + + +Checkbox + +

Text

+ +

+ +
+
+ + diff --git a/dom/xbl/nsXBLPrototypeHandler.cpp b/dom/xbl/nsXBLPrototypeHandler.cpp index 4cba65f280b..be2120918ac 100644 --- a/dom/xbl/nsXBLPrototypeHandler.cpp +++ b/dom/xbl/nsXBLPrototypeHandler.cpp @@ -459,6 +459,10 @@ nsXBLPrototypeHandler::DispatchXBLCommand(EventTarget* aTarget, nsIDOMEvent* aEv else controller = GetController(aTarget); // We're attached to the receiver possibly. + // We are the default action for this command. + // Stop any other default action from executing. + aEvent->PreventDefault(); + if (mEventName == nsGkAtoms::keypress && mDetail == nsIDOMKeyEvent::DOM_VK_SPACE && mMisc == 1) { @@ -491,10 +495,6 @@ nsXBLPrototypeHandler::DispatchXBLCommand(EventTarget* aTarget, nsIDOMEvent* aEv } } } - - // We are the default action for this command. - // Stop any other default action from executing. - aEvent->PreventDefault(); if (controller) controller->DoCommand(command.get());