User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:188.8.131.52) Gecko/20080404 Firefox/184.108.40.206 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008061105 Minefield/3.0pre Load the attached test case, focus into the contentEditable DIV (such as clicking on the first paragraph), pageup/pagedown does not work: it moves the caret to the element before the contentEditable DIV when pageup is pressed, or to the element after the contentEditable DIV if pagedown is pressed Reproducible: Always Steps to Reproduce: 1. load the attach test case in latest FF3 nightly 2. clicking somewhere in the contentEditable DIV (such as the first paragraph) 3. press pageUp/pageDown Actual Results: when pageUp is pressed, the caret is moved to the element before the contentEditable DIV (in the test page, it is the "first row" DIV) when pageDown is pressed, the caret is moved to the element after the contentEditable DIV Expected Results: pageUp/pageDown should only move the caret within the contentEditable DIV
The problem is caused by the fact that when pageup/pagedown is pressed in a contentEditable area, it actually scrolls the entire page up/down, rather than the contentEditable area itself. I have no idea how this should be fixed. By trial and error, I found this possible fix: whenever a editor is focused, if it can scroll, set it as the root scollable view, so when pageup/pagedown is pressed in the editor, it will scroll the editor rather than the entire page. I think this is not the properly fix, but I just want to show it to get more feedback/pointers on where to look.
Confirmed on Windows Minefield per comment 0's steps. I also noticed that page up took me out of the content editable box onto the "first row" area. Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090731 Minefield/3.6a1pre (.NET CLR 3.5.30729)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Thanks for roc's suggestion, I believe this patch is now on the right direction in the original PresShell::PageMove, it always scrolls the page using the root scrollable view. by scrolling GetViewToScroll instead, this bug is fixed.
Comment on attachment 391981 [details] [diff] [review] proposed patch: use the same logic as in non-editable page scroll I like this! Would be nice to have an automated test for this. Perhaps something that uses synthesizeKey to synthesize a page-down.
Attachment #391981 - Flags: review?(roc) → review+
same patch as the previous one, with added mochitest case (I don't have a Mac, so I don't know whether it works as expected in Mac, but if so, I think this patch also fixes Bug 472318)
I believe this patch is required to make the richtext edtior case work in Bug 472318 (the patch in that bug is required as well)
Comment #7 is only applicable to Mac (windows and linux are not affected by Bug 472318)
Depends on: 472318
Whiteboard: [needs landing]
Assignee: nobody → liucougar
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Comment on attachment 391998 [details] [diff] [review] same patch with mochitest This already landed.
Attachment #391998 - Flags: review?(roc) → review+
You need to log in before you can comment on or make changes to this bug.