Closed
Bug 53896
Opened 24 years ago
Closed 23 years ago
Spacebar when buttons, checkboxes, radiobuttons have focus just scrolls page
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
VERIFIED
FIXED
People
(Reporter: bugzilla, Assigned: arik)
References
()
Details
(Keywords: access, regression)
Attachments
(1 file)
1.37 KB,
patch
|
Details | Diff | Splinter Review |
Build ID: just pulled Steps to Reproduce: (1) Go to http://www.cnet.com/frontdoor/0-1.html?st.10001.10001-ron.yhed.1 (2) Click in the Search field and tab twice to give the Go! button focus (3) Press spacebar The button action triggers as it should, but the page also scrolls. This is a regression; it used to be that the spacebar keypress ended with the button. Sounds like it isn't being killed now, and bubbling up to other places...
This bug has been marked "future" because the original netscape engineer working on this is over-burdened. If you feel this is an error, that you or another known resource will be working on this bug,or if it blocks your work in some way -- please attach your concern to the bug for reconsideration.
Target Milestone: --- → Future
Reporter | ||
Comment 4•24 years ago
|
||
nominating for rtm. this has regressed even more, and now you simply cannot do anything in webpages with the keyboard because spacebar no longer works to toggle any controls. see also bug 51600.
Keywords: regression,
rtm
Summary: Spacebar when HTML button has focus scrolls page (and triggers button) → Spacebar when buttons, checkboxes, radiobuttons have focus just scrolls page
Reporter | ||
Comment 5•24 years ago
|
||
nisheeth, could you please consider plussing this?
Comment 6•24 years ago
|
||
->saari, who has dealt with similar problems many times.
Assignee: joki → saari
Target Milestone: Future → M19
Comment 7•24 years ago
|
||
Are you nominating this for RTM because of the scrolling, the button not responding to space, or both?
Reporter | ||
Comment 8•24 years ago
|
||
I'm nominating for rtm for checkboxes, radiobuttons, and buttons not responding to space (not just buttons). It would be extremely annoying to have the page also scroll, but it'd be better than the current state (space not working at all). So rtm would be to make space work, regardless of what else happens.
Comment 9•24 years ago
|
||
patches for both problems Index: nsXBLWindowKeyHandler.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/xbl/src/nsXBLWindowKeyHandler.cpp,v retrieving revision 1.5 diff -u -r1.5 nsXBLWindowKeyHandler.cpp --- nsXBLWindowKeyHandler.cpp 2000/10/04 00:41:53 1.5 +++ nsXBLWindowKeyHandler.cpp 2000/10/10 21:25:32 @@ -254,7 +254,6 @@ rec = do_QueryInterface(elt); rv = currHandler->ExecuteHandler(rec, aKeyEvent); if (NS_SUCCEEDED(rv)) { - aKeyEvent->PreventDefault(); return NS_OK; } } Index: nsXBLPrototypeHandler.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/xbl/src/nsXBLPrototypeHandler.cpp,v retrieving revision 1.9 diff -u -r1.9 nsXBLPrototypeHandler.cpp --- nsXBLPrototypeHandler.cpp 2000/10/04 00:41:51 1.9 +++ nsXBLPrototypeHandler.cpp 2000/10/10 21:29:35 @@ -271,6 +271,7 @@ mHandlerElement->GetAttribute(kNameSpaceID_None, kOnCommandAtom, handlerT ext); if (handlerText.IsEmpty()) return NS_ERROR_FAILURE; // For whatever reason, they didn't give us an ything to do. + aEvent->PreventDefault(); // Preventing default for XUL key handlers } } Index: htmlBindings.xml =================================================================== RCS file: /cvsroot/mozilla/xpfe/global/resources/content/htmlBindings.xml,v retrieving revision 1.8 diff -u -r1.8 htmlBindings.xml --- htmlBindings.xml 2000/09/22 19:03:39 1.8 +++ htmlBindings.xml 2000/10/10 21:48:03 @@ -9,10 +9,19 @@ <handler event="keypress" key=" "> <![CDATA[ var v = document.commandDispatcher.focusedElement; - - if (v && (v.localName == 'TEXTAREA')) - return true; - + if (v && (v.localName == 'TEXTAREA')) { + return true; + } + if (v && v.localName == 'INPUT') { + var str = v.getAttribute('type').toLowerCase(); + if (str == 'button' || str == 'submit' || str == 'reset') { + return true; + } + str = v.getAttribute('TYPE').toLowerCase(); + if (str == 'button' || str == 'submit' || str == 'reset') { + return true; + } + } var controller = document.commandDispatcher.getControllerForCommand('cmd_scrollPageDow n'); controller.doCommand('cmd_scrollPageDown'); @@ -20,7 +29,6 @@ return true; ]]> </handler> - <handler event="keypress" keycode="VK_PAGE_UP" command="cmd_scrollPageUp" /> <handler event="keypress" keycode="VK_PAGE_DOWN" command="cmd_scrollPageD own"/>
Status: NEW → ASSIGNED
Comment 10•24 years ago
|
||
r=danm
Comment 11•24 years ago
|
||
a=hyatt
Reporter | ||
Comment 12•24 years ago
|
||
great! nisheeth, please plus this ASAP so PDT can approve.
Comment 13•24 years ago
|
||
Very visible, maddening bug, fix is not one-liner, but is small and well-understood. Would be good to get in for N6. rtm+ since it is ready to go, cc joki for possible further review, cc jrgm for further testing before landing.
Priority: P3 → P2
Whiteboard: [rtm+]
Comment 14•24 years ago
|
||
Please check this into the trunk and bake it for a cycle and then re-nominate. marking need info
Whiteboard: [rtm+] → [rtm+ need info]
Reporter | ||
Comment 15•24 years ago
|
||
saari: let me know if you want me to check this in.
Reporter | ||
Comment 16•24 years ago
|
||
Saari, hope you don't mind that I checked this into the trunk. trudelle and I agreed that it should be in tomorrow's builds so PDT could evaluate regressions and so forth.
Whiteboard: [rtm+ need info] → [rtm+ need info] Fix checked in on trunk
Comment 17•24 years ago
|
||
Blake, no problem at all, thanks for doing that!
Whiteboard: [rtm+ need info] Fix checked in on trunk → [rtm+]
Comment 18•24 years ago
|
||
This is working for the input element types that were specified mac/linux/win32). The XBL/js just needs to also check <input> for types 'checkbox | radio | file', and should also check for element <button> which can have a type attribute of 'submit | button | reset'
Reporter | ||
Comment 19•24 years ago
|
||
Reporter | ||
Comment 20•24 years ago
|
||
Thanks for catching that; attached a new patch. Why are the two checks for `TYPE' and `type' needed?
Comment 21•24 years ago
|
||
I don't believe they are required (doing .getAttribute in two cases). I did a simple test case in HTML for type='submit' using "TYPE"|"TyPe"|"type", and .getAttribute('type') returns "submit" in all cases. I can't find a statement in DOM2 that says that is mandated, though.
HTML: Internally we handle everything in lower case. Searching for element & attributes is case-insensitive, I seem to recall. Contact jst if you want to be sure.
Comment 23•24 years ago
|
||
r=danm on Blake's patch 16828
Comment 24•24 years ago
|
||
Looks like you need a super review for the new patch. Marking [rtm need info]. I'll be online for a while if you get one tonight -- don't want to lose a day since you tested on the trunk as requested.
Whiteboard: [rtm+] → [rtm need info]
Comment 25•24 years ago
|
||
a=brendan@mozilla.org on the patch as is for the branch. For the trunk, let's avoid the unnecessary uppercase getAttributes, use switch (better performance), and factor common guard expressions: if (v) { switch (v.localName) { case 'TEXTAREA': return true; case 'INPUT': switch (v.getAttribute('type').toLowerCase()) { case 'button': case 'submit': case 'reset': case 'checkbox': case 'radio': case 'file': return true; } break; case 'BUTTON': switch (v.getAttribute('type').toLowerCase()) { case 'submit': case 'button': case 'reset': return true; } break; } Does that look better? I think we can do a fast r=/a= if you can do the above in a trunk patch. Thanks, /be
Reporter | ||
Comment 26•24 years ago
|
||
Brendan's trunk patch looks good to me. r=blake Marking rtm+ since we now have a super reviewer for the branch patch as requested.
Whiteboard: [rtm need info] → [rtm+]
Comment 27•24 years ago
|
||
Brendan's patch looks great, even tested it. Anyone want to ++ this?
Reporter | ||
Comment 28•24 years ago
|
||
might as well just get brendan's patch into the trunk, there's no greater risk... so we have r=blake, saari. we need an sr= and we're good to go. cc'ing hyatt so hopefully he can do that. Meanwhile, Chris, can you put Brendan's patch in the form of a branch diff? Thanks!
Comment 29•24 years ago
|
||
Form of a branch diff Index: htmlBindings.xml =================================================================== RCS file: /m/pub/mozilla/xpfe/global/resources/content/htmlBindings.xml,v retrieving revision 1.8 diff -u -2 -r1.8 htmlBindings.xml --- htmlBindings.xml 2000/09/22 19:03:39 1.8 +++ htmlBindings.xml 2000/10/13 00:33:25 @@ -10,8 +10,30 @@ <![CDATA[ var v = document.commandDispatcher.focusedElement; - - if (v && (v.localName == 'TEXTAREA')) - return true; - + + + if (v) { + switch (v.localName) { + case 'TEXTAREA': + return true; + case 'INPUT': + switch (v.getAttribute('type').toLowerCase()) { + case 'button': + case 'submit': + case 'reset': + case 'checkbox': + case 'radio': + case 'file': + return true; + } + break; + case 'BUTTON': + switch (v.getAttribute('type').toLowerCase()) { + case 'submit': + case 'button': + case 'reset': + return true; + } + break; + } var controller = document.commandDispatcher.getControllerForCommand('cmd_scrollPageDown');
Updated•24 years ago
|
Whiteboard: [rtm+] → [rtm++]
Comment 30•24 years ago
|
||
a=hyatt
Comment 31•24 years ago
|
||
Fix in on branch and trunk
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 32•24 years ago
|
||
Chris, Brendan's patch introduced a new block if without adding the closing brace at the end. Because of this, a JS error is displayed in the console every time you press spacebar when certain HTML and XUL widgets have the focus. Can you add that brace (one line fix) and check it into the branch under the auspicies of this ++ bug?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 33•24 years ago
|
||
Here's the error. JavaScript error: line 33: missing } in compound statement
Comment 34•24 years ago
|
||
expect a flood of duplicates on JavaScript error: line 33: missing } in compound statement here's the fix: Index: htmlBindings.xml =================================================================== RCS file: /cvsroot/mozilla/xpfe/global/resources/content/htmlBindings.xml,v retrieving revision 1.10 diff -p -r1.10 htmlBindings.xml *** htmlBindings.xml 2000/10/13 21:36:31 1.10 --- htmlBindings.xml 2000/10/15 04:05:33 *************** *** 35,40 **** --- 35,41 ---- } break; } + } var controller = document.commandDispatcher.getControllerForCommand('cmd_scrollPageDown'); controller.doCommand('cmd_scrollPageDown');
r=shaver to get rid of that annoyance.
Comment 36•24 years ago
|
||
r=timeless
Reporter | ||
Comment 37•24 years ago
|
||
*** Bug 56835 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 38•24 years ago
|
||
*** Bug 56827 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 39•24 years ago
|
||
ok, this needs to be fixed because it also caused bug 56835. I'll check it in with r=timeless, sr=shaver.
Comment 40•24 years ago
|
||
Fix is fine by me
Comment 41•24 years ago
|
||
*** Bug 56642 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 42•24 years ago
|
||
oops...was checking this in as saari was. remarking FIXED
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 43•24 years ago
|
||
*** Bug 56987 has been marked as a duplicate of this bug. ***
Comment 44•24 years ago
|
||
When will the fix be in the nightlies? Testing with 2000101708 i still see bug 56642.
Comment 45•24 years ago
|
||
*** Bug 57133 has been marked as a duplicate of this bug. ***
Comment 46•24 years ago
|
||
and gone. I don't see it anymore in 2000101809.
Comment 47•24 years ago
|
||
VERIFIED on Mac 10-18-08, NT 10-18-08, Linux 10-18-09 branch builds. Adding vtrunk KW. Yay!
Keywords: vtrunk
Comment 48•24 years ago
|
||
Verified Fixed on Mozilla trunk builds spacebar no longer scrolls page when focus is on buttons, checkboxes or radio butons. linux 101908 RedHat 6.2 win32 101904 NT 4 mac 101904 Mac OS9 Setting bug to Verified and removing vtrunk keyword
Status: RESOLVED → VERIFIED
Keywords: vtrunk
Reporter | ||
Comment 49•24 years ago
|
||
saari, the brace fix still needs to go into the trunk.
Comment 50•24 years ago
|
||
Reopening to get the fix into the trunk; removing rtm++ since it's already in the branch.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Whiteboard: [rtm++]
Comment 51•24 years ago
|
||
oops, sorry about that premature Verification. I didn't read down far enough in the bug before I followed the steps to repro.
Comment 52•24 years ago
|
||
Oops, I thought it was in the trunk. Okay
Comment 53•24 years ago
|
||
Sorry all, we got tired of waiting. Fix checked in. verifyme [trunk]
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Keywords: verifyme
Resolution: --- → FIXED
Comment 56•24 years ago
|
||
*** Bug 57670 has been marked as a duplicate of this bug. ***
Comment 57•24 years ago
|
||
OK, verifying the second part. No console errors :) Verified Fixed on Mozilla trunk builds linux 102308 RedHat 6.2 win32 102304 NT 4 mac 102312 Mac OS9 Setting bug to Verified and removing vtrunk keyword
Comment 58•23 years ago
|
||
After having not seen this for a long time, I noticed this behavior occurred in the nightly build I downloaded today (2001042908). Trying to use the spacebar to submit a form scrolled the page instead. Enter still works to submit a form.
Comment 59•23 years ago
|
||
Arik, is it possible your XBL patch, recently landed, regressed this? Just asking, I'm not sure at all. /be
Reporter | ||
Comment 60•23 years ago
|
||
Reopening.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Whiteboard: [rtm++]
Comment 61•23 years ago
|
||
argh! I'm cursed, forever doomed with this filth.
Reporter | ||
Comment 62•23 years ago
|
||
No worries :-) Arik, you somehow messed up the checkin to nsXBLPrototypeHandler.cpp: http://bonsai.mozilla.org/cvsview2.cgi? diff_mode=context&whitespace_mode=show&subdir=mozilla/content/xbl/src&command=DI FF_FRAMESET&file=nsXBLPrototypeHandler.cpp&rev1=1.23&rev2=1.24&root=/cvsroot compare with http://bugzilla.mozilla.org/showattachment.cgi?attach_id=31655 So you effectively removed the conditional node checks from htmlBindings.xml without translating them into the equivalent C++, which would cause this problem. (Please be sure you fix on the 0.9 also if necessary).
Assignee: saari → arik
Status: REOPENED → NEW
Reporter | ||
Comment 63•23 years ago
|
||
Reclosing this, will handle in 71760.
Status: NEW → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → FIXED
Comment 64•23 years ago
|
||
Looks like the branch got the full patch for nsXBLPrototypeHandler.cpp from bug 71760, but the trunk didn't. Tsk. /be
Comment 65•23 years ago
|
||
Well, the spacebar doesn't scroll now, but it doesn't activate the button either. I confirmed this on WinNT 4.0 (sp5) build : 2001043007
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 66•23 years ago
|
||
*** Bug 78383 has been marked as a duplicate of this bug. ***
Comment 67•23 years ago
|
||
*** Bug 79483 has been marked as a duplicate of this bug. ***
Comment 68•23 years ago
|
||
*** Bug 79253 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 69•23 years ago
|
||
Reclosing, this no longer scrolls.
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Comment 70•23 years ago
|
||
bug 79483 is handling the regression of not triggering things.
Updated•5 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•