Closed
Bug 158362
Opened 22 years ago
Closed 19 years ago
spacebar does not scroll in print preview
Categories
(Core :: Print Preview, defect, P3)
Core
Print Preview
Tracking
()
VERIFIED
FIXED
People
(Reporter: joshgold, Assigned: MatsPalmgren_bugz)
References
()
Details
Attachments
(1 file, 4 obsolete files)
2.08 KB,
patch
|
neil
:
review+
bzbarsky
:
superreview+
benjamin
:
approval1.8b4+
|
Details | Diff | Splinter Review |
buildID: 2002061401
Hitting space in print preview mode doesn't scroll. Only PageDown works.
(always reproducible)
1. Print preview
2. Press spacebar
this was also mentioned in bug 111432 comment 1
Updated•22 years ago
|
Updated•22 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → Future
*** Bug 285061 has been marked as a duplicate of this bug. ***
Comment 3•19 years ago
|
||
This makes spacebar scrolling in print preview work for me.
Updated•19 years ago
|
Attachment #188066 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 4•19 years ago
|
||
Comment on attachment 188066 [details] [diff] [review]
patch
>- nsIDOMKeyEvent::DOM_VK_TAB, 0};
>+ nsIDOMKeyEvent::DOM_VK_TAB, nsIDOMKeyEvent::DOM_VK_SPACE, 0};
Don't need to list space here, it's always a char code.
> keyEvent->GetShiftKey(&b);
> if (b) return PR_FALSE;
>
> PRUint32 keyCode;
> keyEvent->GetKeyCode(&keyCode);
>+ PRUint32 charCode;
>+ keyEvent->GetCharCode(&charCode);
> PRInt32 i = 0;
> while (kOKKeyCodes[i] != 0) {
>- if (keyCode == kOKKeyCodes[i]) {
>+ if ((keyCode == kOKKeyCodes[i]) || (charCode == 0x20)) {
No point checking the charCode inside the loop. In fact, as Shift+Space is
legal for page up you might want to move it to before the shift test. Also you
should compare it to ' ' for readability.
Attachment #188066 -
Flags: review?(neil.parkwaycc.co.uk) → review-
Comment 5•19 years ago
|
||
Thanks, Neil. All your comments seems logical to me, but for some reason I need
to keep nsIDOMKeyEvent::DOM_VK_SPACE in, otherwise it doesn't work.
Also, I can't get Shift->spacebar scrolling to work.
Updated•19 years ago
|
Attachment #188066 -
Attachment is obsolete: true
Comment 7•19 years ago
|
||
(In reply to comment #6)
>Neil, maybe you know why I get these results in comment 5? Thanks.
Ah, this is due to aaron's keydown prevents keypress code, so we need to allow
space twice, once as a keydown of DOM_VK_SPACE and once as a keypress of " ".
We also need to allow the shift key in both cases. Maybe it would be easier to
write some special-case code rather than trying to hook into the existing loop?
Comment 8•19 years ago
|
||
Or remove the keypress eventlistener, which should be safe, because the keydown
eventlisteners prevents keypress events of firing, not? But that doesn't seem to
change anything.
Comment 9•19 years ago
|
||
Off course! The shift key also gets blocked. Why not remove that block? That
can't hurt anything, can it? And those keypress event listeners could also be
removed safely, I guess, since keydown also blocks keypress automatically.
Updated•19 years ago
|
Attachment #188092 -
Attachment is obsolete: true
Comment 10•19 years ago
|
||
What I don't want to happen is for a keypress to either a) activate a shortcut
or b) run a script, when it shouldn't (see bug 245024 for a click example).
Comment 11•19 years ago
|
||
Comment on attachment 188327 [details] [diff] [review]
patch3
>- mEventTarget->AddEventListener(NS_LITERAL_STRING("keypress"), this, true);
Although it's true that calling PreventDefault on the keydown now calls
PreventDefault on the keypress that doesn't handle the StopPropagation case.
r=me on the rest of the patch.
Comment 12•19 years ago
|
||
Ok, I've put it back in this patch.
Attachment #188327 -
Attachment is obsolete: true
Attachment #188594 -
Flags: superreview?(jst)
Assignee | ||
Comment 13•19 years ago
|
||
Propagate DOM_VK_SPACE and ' ' with and without SHIFT (but nothing else).
I have tested this on Windows and Linux.
Assignee: rods → mats.palmgren
Attachment #188594 -
Attachment is obsolete: true
Attachment #190212 -
Flags: superreview?(bzbarsky)
Attachment #190212 -
Flags: review?(neil.parkwaycc.co.uk)
Updated•19 years ago
|
Attachment #188594 -
Flags: superreview?(jst)
Updated•19 years ago
|
Attachment #190212 -
Flags: superreview?(bzbarsky) → superreview+
Updated•19 years ago
|
Attachment #190212 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #190212 -
Flags: approval1.8b4?
Updated•19 years ago
|
Attachment #190212 -
Flags: approval1.8b4? → approval1.8b4+
Assignee | ||
Comment 14•19 years ago
|
||
Checked in to trunk 2005-07-25 17:21 PDT
-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: Future → ---
Verified FIXED using build 2005-07-26-05 on Windows XP SeaMonkey trunk.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•