Launchpad bug pages trigger caret browsing in Firefox and other Gecko browsers

Bug #107247 reported by Colin Watson
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Björn Tillenius
Mozilla Firefox
Fix Released
Medium
firefox (Ubuntu)
Won't Fix
Medium
Alexander Sack

Bug Description

It is possible for a Web page to turn on Firefox's "caret browsing" mode just for that page, such that Firefox displays a cursor in the Web page text and prevents scrolling from working as normal. This should never happen.

This bug was triggered by bug 107376 in a previous version of Launchpad, suggesting that the general cause is JavaScript focusing a text field, and then using CSS to hide that field. It seems unrelated to the document.designMode DOM property, because the page did not become editable.

Steps to reproduce:
1. In Firefox or Epiphany, open any bug page, such as this one.
2. Wait for the Subscribers box to finish loading.
3. Press the Up or Down arrow keys.

What should happen: The page scrolls.
What actually happens: A visible caret moves through the page.

Revision history for this message
Colin Watson (cjwatson) wrote :

The I-beam cursor doesn't consistently appear; sometimes it just apparently refuses to scroll (though perhaps I wasn't holding down the cursor key for long enough) until I switch to another tab and back.

For what it's worth, I initially thought this was just a local problem, but was prompted to file this bug by Tollef Fog Heen saying on IRC that he could also reproduce this.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

I suffered this problem yesterday too, but eventually tracked it down to Firefox: "Edit" > "Preferences" > "Advanced" > "General" > "Accessibility" > "Always use the cursor keys to navigate within pages" had become checked. If multiple Ubuntu developers are experiencing it, that suggests a bug in the Ubuntu firefox package.

Changed in malone:
status: Unconfirmed → Rejected
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Hello Colin,

thanks for the report.
please check in your firefox about:config if accessibility.browsewithcaret is set to false.
Maybe some extension set it to True?

Changed in malone:
status: Rejected → Unconfirmed
Revision history for this message
Diogo Matsubara (matsubara) wrote :

I had a stale page and inadvertently changed the rejected status to unconfirmed.

Changed in malone:
status: Unconfirmed → Rejected
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

(Dealing with mid-air collisions in bug reports is bug 28459.)

To be clear, nothing in Launchpad can put Firefox into cursor navigation (aka "caret browsing") mode; that is a Firefox problem. But as for the "sometimes it just apparently refuses to scroll ... until I switch to another tab and back", that is a separate regression, which I have just reported as bug 107376.

Revision history for this message
Colin Watson (cjwatson) wrote :

The mentioned firefox pref is set to false for me, as it should be. Please consider reopening this bug.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Argh, ok, just experienced the problem again. I think bug 28459 is triggering a bug in Firefox. Steps to reproduce:
1. open a bug page
2. click once in the bug page
3. press the Up or Down arrow keys.

Changed in malone:
status: Rejected → Needs Info
importance: Undecided → High
status: Needs Info → Confirmed
description: updated
Revision history for this message
Alexander Sack (asac) wrote :

can reproduce ... confirmed + needs evaluation

Changed in firefox:
assignee: nobody → asac
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Closing the malone task. With bug 107376 fixed, I couldn't reproduce this anymore.

Changed in malone:
status: Confirmed → Fix Committed
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Also occurs in Firefox 2.0.0.3 for Mac. Alexander, I've made a Launchpad branch in which I can produce a minimized testcase. Unless you still have your own copy of a version of the page where the bug occurs, I'll take care of reporting it upstream, so you can reject it for Ubuntu (assuming you're not going to apply any fix for such a small problem before mozilla.org does).

Changed in firefox:
assignee: nobody → mpt
description: updated
Revision history for this message
Alexander Sack (asac) wrote : Re: A Web page can temporarily turn on caret browsing

Matthew, if you posted upstream, please add info to upstream target and change tag to mt-confirm. I will then ensure that upstream bug gets confirmed. Thanks.

Changed in malone:
status: Fix Committed → Fix Released
Revision history for this message
John Vivirito (gnomefreak) wrote :

Is anyone still able to reproduce this bug? If so what version are you seeing this in?

Revision history for this message
Alexander Sack (asac) wrote :

ffox 2 wont see feature fixes anymore.

Changed in firefox:
status: Confirmed → Won't Fix
Revision history for this message
Alexander Sack (asac) wrote :

i cannot reproduce it anymore. marking fixed in firefox 3. feel free to reopen if launchpad got fixed and you still have a way to reproduce this.

Changed in firefox:
status: Won't Fix → Fix Released
Changed in firefox-3.0:
status: New → Fix Released
Changed in firefox:
status: Fix Released → Won't Fix
Changed in firefox:
status: New → Invalid
Revision history for this message
era (era) wrote :

I'm getting this bug on this very page, as well as -- I think -- Launchpad pages in general. Jaunty, basically out of the box, albeit with latest security updates, i.e. Firefox 3.0.11. Should I reopen, or create a new bug report?

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

I thought I'd re-reported this, but apparently not. Reopening. It currently happens on every bug page in Launchpad, starting from the moment that the Subscribers box finishes loading.

Changed in malone:
status: Fix Released → Confirmed
Changed in firefox-3.0 (Ubuntu):
status: Fix Released → Confirmed
description: updated
summary: - A Web page can temporarily turn on caret browsing
+ Launchpad bug pages trigger caret browsing in Firefox and other Gecko
+ browsers
Graham Binns (gmb)
Changed in malone:
status: Confirmed → Triaged
milestone: none → 2.2.7
status: Triaged → Confirmed
status: Confirmed → Triaged
Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 107247] Re: A Web page can temporarily turn on caret browsing

On Wed, Jul 15, 2009 at 03:48:29PM -0000, Matthew Paul Thomas wrote:
> I thought I'd re-reported this, but apparently not. Reopening. It
> currently happens on every bug page in Launchpad, starting from the
> moment that the Subscribers box finishes loading.
>
> ** Changed in: malone
> Status: Fix Released => Confirmed
>
> ** Changed in: firefox-3.0 (Ubuntu)
> Status: Fix Released => Confirmed
>
> ** Summary changed:
>
> - A Web page can temporarily turn on caret browsing
> + Launchpad bug pages trigger caret browsing in Firefox and other Gecko browsers
>

Does anyone of the launchpad team already know or has any gut feeling
what triggers this in firefox?

Would be nice to get a (if possible) minimal testcase extracted and
attached to this bug before you workaround it in malone.

Thanks!

 - Alexander

Revision history for this message
In , Alexander Sack (asac) wrote :

LP: https://bugs.launchpad.net/bugs/107247

Steps to reproduce:
1. In Firefox or Epiphany, open any launchpad bug page, such as the one above.
2. Wait for the Subscribers box to finish loading.
3. Press the Up or Down arrow keys.

Result: firefox switches to caret browsing mode.

We see this on ffox 3.0/3.5 and mozilla-central builds.

Alexander Sack (asac)
Changed in firefox:
assignee: Matthew Paul Thomas (mpt) → nobody
importance: Undecided → Unknown
status: Invalid → Unknown
Changed in firefox-3.5 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in firefox-3.0 (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Neil-httl (neil-httl) wrote :

Looks like the linked site changed something since this bug was filed so that it no longer qualifies as a test case. Does anyone have another test case?

Revision history for this message
In , Alexander Sack (asac) wrote :

hmmm. i think you need to be member of the launchpad beta testers to see the version affected. i will try to get something ...

Revision history for this message
In , Alexander Sack (asac) wrote :

got more info: seems it should also happen if you are not in the launchpad beta testers. however, i was told that you need to be logged in to reproduce.

Revision history for this message
In , Alexander Sack (asac) wrote :

maybe also helpful that this commit makes it goes away:

http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/revision/9000

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Sorry, but there's no obvious link between that commit and caret browsing.

Revision history for this message
In , Alexander Sack (asac) wrote :

maybe also check https://bugs.edge.launchpad.net/bugs/404088 (and https://bugs.edge.launchpad.net/bugs/392138) which was the bug that caused the above fix for this as a side-effect to land. They are talking about focusing some hidden element. does that ring a bell?

Revision history for this message
In , Neil-httl (neil-httl) wrote :

No, but I'll CC enndeakin as being the person who knows most about focusing...

Revision history for this message
In , Enn (enndeakin) wrote :

> Result: firefox switches to caret browsing mode.

That seems unlikely. Do you actually mean that caret browsing is enabled (and that the preference is set), or just that the caret appears? Is the text editable?

Please describe what actually happens.

A testcase is needed here as well.

Revision history for this message
In , Alexander Sack (asac) wrote :

we are working on a testcase ...

But it really triggers caret browsing. I just tried and this are the instructions

 1. caret browsing disabled (accessibility.browsewithcaret=false)
 2. log into launchpad and go to the bug page and wait till the subscribers are loaded
 3. press the up and/or down key

(
Expected result: page scrolls
Actual result: page doesn't scroll as expected - feels like a missing focus.
)
 4. click on the page (i clicked in the title)
 5. use arrow keys

Expected result: page scrolls
Actual result: a caret appears which you can move on the document using the arrow keys.

 however, a caret appears and the arrow key move it through the document (which i refer to as caret browsing).

Revision history for this message
In , Alexander Sack (asac) wrote :

> 4. click on the page (i clicked in the title)
> 5. use arrow keys

Also, sometimes you dont need those two extra steps

(In reply to comment #8)
> that the preference is set), or just that the caret appears? Is the text
> editable?

no its not editable. you can just move the caret through the document using arrow keys.

Revision history for this message
Björn Tillenius (bjornt) wrote :

The fix for bug 404088 fixes this on the Launchpad side.

Changed in malone:
assignee: nobody → Björn Tillenius (bjornt)
milestone: 2.2.7 → 2.2.8
status: Triaged → In Progress
Revision history for this message
Björn Tillenius (bjornt) wrote :

LP side fixed in lp:launchpad/devel r9000. edge.launchpad.net shouldn't have this problem anymore, but it should still be present on launchpad.net for another two months.

Changed in malone:
status: In Progress → Fix Committed
Revision history for this message
In , Bugzilla-paul (bugzilla-paul) wrote :

This is still happening today (2009-08-07) on the main (deployed) Malone instance, eg. the URL:

  https://bugs.launchpad.net/malone/+bug/392138

exhibits the behaviour on about 50% of page loads.

Yes, just to confirm, the page *is* triggering the caret to appear in between the characters in the text, and that:

  accessibility.browsewithcaret=false

I reproduced this first time, by opening the above URL, PageDn, PageDn, PageDn (until at bottom), PageUp, PageUp, PageUp (until at top), and which point the PageUp/Down stopped working and the caret had appeared, movable via the Up/Down arrow keys.

Revision history for this message
In , Bugzilla-paul (bugzilla-paul) wrote :

Repeated tests to try to reproduce it (each started from a fresh page load):

1. Yes: PageDn (x3), PageUp (x3), page "locked", caret there
2. Yes: PageDn (hold), PageUp (hold), page locked, click for caret to appear
3. No.
4. Yes: PageUp (repeat), PageDn (repeat), PageUp (repeat), PageDown (repeat), Arrow Down, caret on
5. Yes: Hold Down Arrow whilst page loading, Page jumps back (almost) to top, page "locked", click for caret to show
6. Yes: Hold Down Arrow whilst page loading, scroll down, jump back to top, scolls down again, jump to top again, page locks; click to different tag, click back again, page unlocks.
7. Yes: Page locked itself, click for caret to appear, change tabs and back again, page unlocked.
8. Yes: Hold Arrow Down whilst page loading, page jumped + locked, change tabs and back to unlock.
9. Yes: Hold Up Arrow whilst page loading, page locked
10. Yes: Hold Page Down whilst page loading, page jumped to top and locked, click for caret to appear.

So, nine times out of ten, reproducibility. The most reliable way (although not the only way) appears to be to hold down one of the scrolling (Arrow or Paging) keys whilst the page is loading. And that changes tabs clears caret browsing mode.

The Downstream bug report has that produce cross-platform (and cross browser) so appears to be Gecko itself kicking into caret mode, rather than the browser interface enabling it.

Revision history for this message
Paul Sladen (sladen) wrote :

Bjorn: indeed, I can't make this happen in edge any more.

Revision history for this message
Alexander Sack (asac) wrote :

Bjorn, any chance to get us a testcase? This is kind of important.

Revision history for this message
Bernhard (b.a.koenig) wrote :
Revision history for this message
Bernhard (b.a.koenig) wrote :
Revision history for this message
Bernhard (b.a.koenig) wrote :

But the scrolling issue also works on https://bugs.edge.launchpad.net/malone/+bug/107247

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 107247] Re: Launchpad bug pages trigger caret browsing in Firefox and other Gecko browsers

On Mon, Aug 10, 2009 at 05:06:02PM -0000, Alexander Sack wrote:
> Bjorn, any chance to get us a testcase? This is kind of important.

Sorry, I tried to produce one, but failed. It's quite hard, since there
are a lot of dependencies, but I'll give it another try.

Revision history for this message
Paul Sladen (sladen) wrote :

As asac reminded me---it only shows up when *logged in* to Launchpad; so diffing out everything that's the same should get rid of alot.

Revision history for this message
Paul Sladen (sladen) wrote :

Rather than try to exact a test-case I tried writing one from scratch; it's not quite there. It doesn't succeed in turning on the caret mode, but it does jump the window and then prevent scrolling with the arrow keys/page up+down working... which is halfway there; the non-boilerplate guts being:

  e = document.getElementById("foobar");
  e.focus();
  e.style.visibility="hidden";
  ...
  <input id="foobar" name="foo" value="bar"/>

Revision history for this message
In , Bugzilla-paul (bugzilla-paul) wrote :

It appears that bug #289632 ("Caret browsing halts keyboard focus on javascript links") may be related to this. There are certainly <a href="..." onclick="..."> elements in the Launchpad page in question.

Revision history for this message
nh2 (nh2) wrote :

I keep getting this in Karmic with Firefox 3.5, but not on the Launchpad edge server.

Revision history for this message
In , Enn (enndeakin) wrote :

Still can't reproduce this.

Revision history for this message
In , Bugzilla-paul (bugzilla-paul) wrote :

Thanks Neil,

This is still 100% reproducible by my end, simply by holding the Down Arrow key down whilst loading the page of any Launchpad Bug report. *Whilst logged in*.

The being *logged in* bit is crucial, as otherwise the box that is triggering this caret behaviour will not be made editable.

Is there anything further that can myself or other can do to assist?

  -Paul

Revision history for this message
Stephen Warren (srwarren) wrote :

I also see this on bugs.launchpad.net, but not bugs.edge.launchpad.net. Looking forward to the push to production.

Revision history for this message
In , Era+mozilla (era+mozilla) wrote :

http://launchpadlibrarian.net/30122852/prevent-scrolling.html is an attachment to the downstream bug which exhibits a similar problem, although it's not 100% the same as the Launchpad issue. Apparently Paul was unable to isolate the precise HTML/CSS/JavaScript combo which would allow you to reproduce fully, but his attachment should at least show you that something is wrong, and that this is reproducible. (See also the comments at https://bugs.launchpad.net/malone/+bug/107247/comments/28)

Revision history for this message
John Vivirito (gnomefreak) wrote :

this sounds like firefox is at not at fault it seems to be LP and if edge fixed it than the fix will come with next version of Lp.
can anyone confirm this is not firefox bug at all?

Revision history for this message
Bernhard (b.a.koenig) wrote :

It isn't, happened to me with Epiphany (Gecko) as well. Btw, bug is really annoying, hope they merge the fix soon.

Revision history for this message
era (era) wrote :

The symptom could well be regarded as a bug in Firefox, why should a more or less innocent CSS hack trigger caret browsing?

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 107247] Re: Launchpad bug pages trigger caret browsing in Firefox and other Gecko browsers

era: That's why this bug is already open on Firefox as well as on
Launchpad. (See the table at the top of the bug's web page, or the
headers if you're receiving this by e-mail.)

Revision history for this message
Colin Watson (cjwatson) wrote :

Ah, sorry, I missed John's mail. I agree that this should be considered
as a bug in Firefox too.

Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 107247] Re: Launchpad bug pages trigger caret browsing in Firefox and other Gecko browsers

On Tue, Sep 08, 2009 at 02:09:10PM -0000, John Vivirito wrote:
> this sounds like firefox is at not at fault it seems to be LP and if edge fixed it than the fix will come with next version of Lp.
> can anyone confirm this is not firefox bug at all?
>

This _is_ a firefox bug. Which we might not be able to fix, because we
have no minimal testcase and the lanchpad bug will disappear soon (or
already disappeared).

 - Alexander

Revision history for this message
era (era) wrote :

Because Launchpad i sopen source now (yay!), somebody could download revision 8999 and set up a local instance as described in http://bazaar.launchpad.net/%7Elaunchpad-pqm/launchpad/devel/annotate/head%3A/doc/localdomain-setup.txt

However, that seems like a fair amount of of pain for uncertain gains, so if there are dumps of the problematic pre-revision 9000 pages on somebody's disk (Paul?) uploading those here would be a good thing.

Revision history for this message
Alexander Sack (asac) wrote :

On Wed, Sep 09, 2009 at 06:07:39PM -0000, era wrote:
> Because Launchpad i sopen source now (yay!), somebody could download
> revision 8999 and set up a local instance as described in
> http://bazaar.launchpad.net/%7Elaunchpad-
> pqm/launchpad/devel/annotate/head%3A/doc/localdomain-setup.txt
>
> However, that seems like a fair amount of of pain for uncertain gains,
> so if there are dumps of the problematic pre-revision 9000 pages on
> somebody's disk (Paul?) uploading those here would be a good thing.
>

I tried to save the page back then and open it, but that didnt trigger
the bug. So it seems its not as simple as that ...

 - Alexander

Changed in malone:
status: Fix Committed → Fix Released
Revision history for this message
In , Paul Brannan (curlypaul924) wrote :

I've been noticing this same behavior on linux when navigating through google search results with the keyboard. Pressing PgUp/PgDn sometimes enables caret browsing; the caret shows up (sometimes not immediately visible) and PgUp/PgDn stop functioning (movement of the caret with the cursor keys still works). Pressing F7 and selecting "No" restores PgUp/PgDn behavior to normal.

The caret seems to only be enabled for the tab with the search results; other tabs are unaffected. Switching tabs or windows and coming back to the search results is not sufficient to turn off caret browsing for that tab.

The problem is intermittent; I have not yet been able to reproduce it at will.

Revision history for this message
In , Keithm (keithm) wrote :

I also have occasionally had this issue. Happened again just today after a quick Google search, page down was no longer working and I discovered caret browsing had been enabled.

Pressing F7 results in the prompt box ("Pressing F7 ... Do you want to turn caret browsing on?") and I press no which causes it to disable and allows page up/down and the arrow keys to work once again.

I tried repeating my google search but it did not enable again the second time. I've not been able to reproduce it with any consistency but it does happen occasionally.

Changed in firefox:
importance: Unknown → Medium
Revision history for this message
In , Jruderman (jruderman) wrote :

Split from bug 549262.

1. Load the testcase, https://bugzilla.mozilla.org/attachment.cgi?id=459420
2. Press the down arrow key several times.

Result: scrolls to the top of the pink div and stops.

Revision history for this message
In , Xtc4uall (xtc4uall) wrote :

Happens on Windows too => OS = All.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Possibly even a dupe of bug 549262...

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to comment #2)
> Possibly even a dupe of bug 549262...

Oh, forget this comment, I was totally confused.

Boris, is it possible to specify a "fallback" action for the arrow keys?

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

I'm on fire today! Boris, see comment 3. :-)

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

I don't know offhand.... Neil might.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to comment #5)
> I don't know offhand.... Neil might.
I don't understand the question...

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

So, here is the problem. In platformHTMLBindings.xml, we define a VK_DOWN handler for caret navigation command so that you can go to the next line in editor by pressing down for example. If there is no editable element focused, we need the default behavior of scrolling the page down to take place, so we need some kind of a fallback event handler being bound to VK_DOWN. Is there any way to do that?

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to comment #7)
> So, here is the problem. In platformHTMLBindings.xml, we define a VK_DOWN
> handler for caret navigation command so that you can go to the next line in
> editor by pressing down for example. If there is no editable element
> focused, we need the default behavior of scrolling the page down to take
> place, so we need some kind of a fallback event handler being bound to
> VK_DOWN. Is there any way to do that?
There is a way to do that, but you have to bind your handlers and attach your controllers to the focused element rather than the window root as you currently do.

The second approach is to fix the editor's command controller to work with editable regions.

The third approach is to stop editor from handling the up and down arrow keys. If you look at the global window controller you'll see that if it thinks there's a caret then it will try to do caret movement instead of scrolling. I think the test detects design mode but not contentEditable regions, so it still tries to do scrolling in that case.

Revision history for this message
In , Josh Triplett (joshtriplett) wrote :

I just encountered this issue myself, on Planet Mozilla (planet.mozilla.org). I visited Planet Mozilla, and noticed that I couldn't seem to use the arrow keys to scroll. Poking at it further, I found that if I held down an arrow for a while, the page would start scrolling in that direction after a bit; if I stopped, and then pressed in the same direction, it would scroll in that direction immediately, but reversing direction required waiting a bit. This felt a lot like caret browsing; however, caret browsing was not actually turned on. I pressed F7 to turn on caret browsing, and after confirming that in the dialog, the caret appeared exactly where the scrolling behavior suggested it would. (For example, if I pressed down until the page started scrolling, then pressed up a couple of times, then turned on caret browsing, the caret would appear a couple of lines above the bottom of the window.)

Build identifier: Mozilla/5.0 (X11; Linux x86_64; rv:7.0a2) Gecko/20110715 Firefox/7.0a2

Revision history for this message
In , Josh Triplett (joshtriplett) wrote :

Just in case something changes, I'll attached a snapshot of Planet Mozilla. I've confirmed that the problem occurs with only the HTML present, without the CSS, scripts, images, or videos.

Revision history for this message
In , Josh Triplett (joshtriplett) wrote :

Created attachment 548844
Snapshot of Planet Mozilla from 2011-07-27, which triggers invisible Caret Browsing

Revision history for this message
In , Josh Triplett (joshtriplett) wrote :

And I can confirm that clicking on the attachment and browsing it here on Bugzilla still triggers the same behavior.

Revision history for this message
In , Enn (enndeakin) wrote :

Likely caused by the post that uses contenteditable.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to comment #23)
> Likely caused by the post that uses contenteditable.

Indeed.

*** This bug has been marked as a duplicate of bug 669026 ***

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

*** Bug 505732 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mats Palmgren (matspal) wrote :

I also noted that middle-clicking links on Planet Mozilla doesn't work.
Same bug?

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to comment #8)
> The third approach is to stop editor from handling the up and down arrow
> keys. If you look at the global window controller you'll see that if it
> thinks there's a caret then it will try to do caret movement instead of
> scrolling. I think the test detects design mode but not contentEditable
> regions, so it still tries to do scrolling in that case.
It does detect contentEditable regions. But some focus code to make link focusing work in caret browsing mode blurs the region :-( See nsSelectMoveScrollCommand::DoCommandBrowseWithCaretOn()

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Created attachment 548924
Patch (v1)

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

*** Bug 481626 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Created attachment 548949
Proof of concept

The editor-base.inc change remaps VK_UP to cmd_scrollLineUp because that was easier to prototype, but ideally it would be renamed back to cmd_linePrevious throughout the codebase. The editor command handler is ruled out of the equation, and that code should be removed. The nsGlobalWindowCommands already knows how to move a caret, so that doesn't change, but the focus manager has to be told not to blur a contenteditable region.

Note that even with caret browsing on, this code doesn't move focus in to a contenteditable region either. I don't know whether this is reasonable.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

I don't understand why the focus manager change there is OK...

Revision history for this message
In , Masayuki (masayuki) wrote :

Why don't you make nsEditor::IsActiveInDOMWindow() an insterface method of nsIEditor?

And, PageUp, PageDown, Home, End keys need to be handled too. (I'm not sure about Shift+Arrow or them)

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to comment #25)
> I also noted that middle-clicking links on Planet Mozilla doesn't work.
> Same bug?

No, please file one?

Revision history for this message
In , Mats Palmgren (matspal) wrote :

mbrubeck filed it: bug 674770

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

*** Bug 674860 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Comment on attachment 548949
Proof of concept

Well, I might as well ask for review on the nsFocusManager change, just in case... the point here is that we don't normally get here because the editor command handlers are active in contenteditable mode, but I want to be able to remove the editor motion command handlers because the global ones work anyway, except for the issue that they blur contenteditable regions, which is unwanted.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Ehsan, does Neil's approach sound better to you? It does to me.

Changed in firefox:
status: Confirmed → Invalid
Revision history for this message
In , Asa (asa) wrote :

Is this a regression in 6? How widespread is this likely to be? We're just a few days from the final Beta of 6.

Revision history for this message
In , Frédéric Buclin (lpsolit-deactivatedaccount) wrote :

(In reply to comment #19)
> Is this a regression in 6? How widespread is this likely to be? We're just a
> few days from the final Beta of 6.

This is not a regression in 6, from what Ehsan said on IRC, but e.g. planet.m.o is unusable using keys for several days now, due to this bug.

Revision history for this message
era (era) wrote :

The "Invalid" from "Bug Watch Updater" is wrong; the upstream status at https://bugzilla.mozilla.org/show_bug.cgi?id=505732 is RESOLVED [sic] DUPLICATE.

Temporarily removing link to upstream bug in order to reassign to https://bugzilla.mozilla.org/show_bug.cgi?id=669026

Changed in firefox:
importance: Medium → Undecided
status: Invalid → New
importance: Undecided → Unknown
status: New → Unknown
Changed in firefox:
importance: Unknown → Medium
status: Unknown → In Progress
Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to comment #20)
> (In reply to comment #19)
> > Is this a regression in 6? How widespread is this likely to be? We're just a
> > few days from the final Beta of 6.
>
> This is not a regression in 6, from what Ehsan said on IRC, but e.g.
> planet.m.o is unusable using keys for several days now, due to this bug.

While that is true, this bug has existed for ages (I think from Firefox 3+) and there is no good reason why we should track it for Firefox 6...

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to comment #18)
> Ehsan, does Neil's approach sound better to you? It does to me.

As I've said before, I don't understand the focus manager code, so if Neil (Deakin) vouches on that, I'd be fine with Neil's approach. I'm assuming that he's going to address the todo items in comment 13 once Neil reviews the focus manager change. Also, Neil, can you check to see if my test case passes successfully with your patch?

(In reply to comment #13)
> Note that even with caret browsing on, this code doesn't move focus in to a
> contenteditable region either. I don't know whether this is reasonable.

That's definitely not desired, but I tested it and we are doing the same thing right now even without this patch, so I don't think we need to worry about this problem here.

Revision history for this message
In , Enn (enndeakin) wrote :

Comment on attachment 548949
Proof of concept

The focus manager change looks ok, but the editor-base.inc change is not.

The former fixes an issue where there is a selection within the editable area, but the editable area is not focusable, then tab is pressed. (The removed code from nsFocusManager is only called when there is nothing focused).

The editor-base.inc change though makes scrolling occur in a number of situations where it shouldn't, for example, scrolling should not occur while caret browsing is on, nor while the caret is within the focused editable area.

Is the editor attaching it's command controller to the document and not the editable area?

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to comment #23)
> The former fixes an issue where there is a selection within the editable
> area, but the editable area is not focusable, then tab is pressed. (The
> removed code from nsFocusManager is only called when there is nothing
> focused).
I could only get that code to be hit when there was a caret. I'm not sure how to make an unfocusable editable area, but I guess it won't have a caret.

> The editor-base.inc change though makes scrolling occur in a number of
> situations where it shouldn't, for example, scrolling should not occur while
> caret browsing is on, nor while the caret is within the focused editable
> area.
The global window commands already know about caret browsing. (If you look at the browser-base.inc then you'll see the bindings are the same. At some point we may want to rename them back to reduce confusion.) And, except for the code block in the focus manager, its idea of a caret also applies to editable areas, which was why I wanted to remove the code block!

> Is the editor attaching it's command controller to the document and not the
> editable area?
Correct. There was some issue with attaching the commands to the editable area which ehsan has pointed me towards several times but I still forget the bug #.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to <email address hidden> from comment #24)
> > Is the editor attaching it's command controller to the document and not the
> > editable area?
> Correct. There was some issue with attaching the commands to the editable
> area which ehsan has pointed me towards several times but I still forget the
> bug #.

I tried very hard in bug 289384 to do that, but I failed miserably... Maybe because I didn't have a good idea what I'm doing. :/

Revision history for this message
In , Enn (enndeakin) wrote :

Comment on attachment 548949
Proof of concept

I'm not sure if something else is being asked of me here.

With this patch:
 1. Click in the editable area
 2. Press cursor up/down

Expected:
  The caret moves up/down a line
Actual:
  Page scrolls, so keyboard users cannot edit other lines.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to Neil Deakin from comment #26)
> Expected:
> The caret moves up/down a line
Well, that's what I get locally. Does caret browsing work in your build?

Revision history for this message
In , Enn (enndeakin) wrote :

I get the same whether caret browsing is enabled or not.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to Neil Deakin from comment #28)
> (In reply to <email address hidden> from comment #27)
> > (In reply to Neil Deakin from comment #26)
> > > Expected:
> > > The caret moves up/down a line
> > Well, that's what I get locally. Does caret browsing work in your build?
> I get the same whether caret browsing is enabled or not.
Sorry, I wasn't clear, I meant caret browsing in general, not just in editable areas.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Ping?

Revision history for this message
In , Dindog (dindog) wrote :

*** Bug 681418 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Dindog (dindog) wrote :

just in case, HOME/END key is breaks too...

Revision history for this message
In , Enn (enndeakin) wrote :

There seems to be some expectation that I respond here but I have nothing else to add. The patch creates an issue as described in comment 26. The same issue occurs with caret browsing enabled or disabled.

Revision history for this message
In , Enn (enndeakin) wrote :

Caret browsing doesn't work with this patch. The page scrolls when I try to move the caret up and down.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Created attachment 565950
Fixed proof of concept

Revision history for this message
In , Enn (enndeakin) wrote :

Comment on attachment 565950
Fixed proof of concept

Testing and debugging shows that this seems to work.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Neil, does your patch make the test part of attachment 548924 pass? If so, we can get them landed. :-)

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to Ehsan Akhgari from comment #37)
> If so, we can get them landed. :-)

Except it's very much proof of concept (although I wouldn't mind landing the nsFocusManager.cpp change which would be necessary anyway).

In particular, I'm not sure a) which keys need to be changed b) whether those keys should map to the same commands in textareas and browsers/editors c) how native Linux key bindings fit in.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Created attachment 569554
Proposed patch

The names of the commands are configured in three places:
* GTK2 Native keybindings
* Editor bindings (editor-base.inc and libeditor)
* Browser bindings (browser-base.inc and nsGlobalWindowCommands)
The browser bindings have six differences to the other two sets of bindings,
all cmd_scroll* names, which I have renamed for consistency.
The browser bindings were missing implementations for selecting by page.
The stubs also used the wrong command names, so I corrected that too.
This then allowed me to remove the editor implementation.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Comment on attachment 569554
Proposed patch

Review of attachment 569554:
-----------------------------------------------------------------

Looks very good!

Does my test case pass with this patch?

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to Ehsan Akhgari from comment #40)
> Does my test case pass with this patch?
Yes, it does.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

So, things didn't go quite as well as I'd hoped.

Text areas and input fields need to have the editor behaviour.
Design mode and contenteditable windows need to have the global behaviour.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Created attachment 570250
Fixed patch

So, I ended up having to separate the cursor movement commands into their own command table so that I could append that controller for textareas and inputs.

Revision history for this message
In , Dindog (dindog) wrote :

Neil, any news about this bug?
It affects Fx9+(current beta), if we don't fix it in Fx11, then user have to wait at least 3*6=18 weeks before thay can copy text in those page again...

Revision history for this message
In , Dindog (dindog) wrote :

Sorry, I mistaken this bug for bug 692153.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(In reply to dindog from comment #44)
> Neil, any news about this bug?
ehsan, should I be asking someone else for review?

> It affects Fx9+(current beta), if we don't fix it in Fx11, then user have to
> wait at least 3*6=18 weeks before thay can copy text in those page again...

(In reply to dindog from comment #45)
> Sorry, I mistaken this bug for bug 692153.
Actually it turned out to be fairly straightforward to adapt this patch to apply to Copy, but it won't help with the Select All case.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Comment on attachment 570250
Fixed patch

Review of attachment 570250:
-----------------------------------------------------------------

I'm not crazy about "editor" vs. "editing" controllers, but I couldn't really think of anything better, so r=me.

Thanks a lot for your work on this, Neil, and sorry that I did a very bad job at responding to the review request in time.

Revision history for this message
In , Release-a (release-a) wrote :

Try run for e3859a3ea446 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=e3859a3ea446
Results (out of 208 total builds):
    success: 144
    warnings: 50
    failure: 14
Builds (or logs if builds failed) available at:
http://<email address hidden>

Revision history for this message
In , Neil-httl (neil-httl) wrote :

test_showcaret.xul: uses cmd_scrollBottom, got renamed to cmd_moveBottom
test_selection_move_commands.xul: many renames...
test_movement_by_characters/word.html: rely on the buggy behaviour!

Revision history for this message
In , Neil-httl (neil-httl) wrote :

test_selection_move_commands actually tests for the broken commands. Sigh...

Revision history for this message
In , Neil-httl (neil-httl) wrote :

test_movement_by_characters.html's reliance on this bug is due to it failing to focus the content before performing the navigation.

test_movement_by_words.html has the above bug but did also find a real bug; with this patch, you can't move by words to the very end of a contenteditable area, because it tries to move right out of the contenteditable area...

Revision history for this message
In , Release-a (release-a) wrote :

Try run for 8c5b9300caf0 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=8c5b9300caf0
Results (out of 208 total builds):
    exception: 1
    success: 137
    warnings: 56
    failure: 14
Builds (or logs if builds failed) available at:
http://<email address hidden>

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Created attachment 584062
With test fixes (for check in)

Revision history for this message
In , Release-a (release-a) wrote :

Try run for f0084cbf3b9d is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=f0084cbf3b9d
Results (out of 206 total builds):
    success: 167
    warnings: 24
    failure: 15
Builds (or logs if builds failed) available at:
http://<email address hidden>

Revision history for this message
In , Neil-httl (neil-httl) wrote :

> warnings: 24
> failure: 15
Most of these are hidden; 3 randomorange show up on tbpl by default.
More oranges and the reds show up with noignore or via self-serve but they're all Lion, Tegra and/or Jetpack so nobody cares about them.

Revision history for this message
In , Dindog (dindog) wrote :

This bug is fixed in 20121224 nightly. Neil, would you please look into the copy menuitem too?

Ehsan, sorry again for the other day urge you to review this bug in IRC. I got a reason to worried. Two major sites in China use contenteditable element in part of there service, (In fact, they rank No.1 & No.2 in China and No.5 & No.10 all over the world in Alexa), both are popular things, try imagining as they are Chinese Facebook and Google group, you'll got the picture.

I heard complaint about unable to copy and scroll after Fx9.0 was released. I don't want Firefox losing users. I'll would be better have it fixed not only in nightly, but also beta, even release.

Revision history for this message
In , Dindog (dindog) wrote :

*It* 'll would be better have it fixed not only in nightly, but also beta, even release.

sorry for the misspell

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Pushed changeset 4d0391866459 to mozilla-central.

(In reply to dindog from comment #56)
> Neil, would you please look into the copy menuitem too?
Yes, I'll do copy (but not select all, because it's harder) in bug 692153.

Changed in firefox:
status: In Progress → Fix Released
Revision history for this message
In , Dietrich-mozilla (dietrich-mozilla) wrote :

"Dude, where's my commands?!" This change removed commands that have been around for many years, breaking add-ons: bug 714164.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

Neil, I think you need to add those commands back, and just make us not use them... :(

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Fair enough, and I can put the test back too, but I might as well use bug 714164.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

*** Bug 702064 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Akeybl (akeybl) wrote :

Bug 696020 appears to have exacerbated this problem in 10 (see bug 702064). The attached patch appears to be higher risk than we're comfortable for Beta (please correct me if I'm wrong), but I'm wondering if this is a good candidate for Aurora 11.

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to Alex Keybl [:akeybl] from comment #63)
> Bug 696020 appears to have exacerbated this problem in 10 (see bug 702064).
> The attached patch appears to be higher risk than we're comfortable for Beta
> (please correct me if I'm wrong), but I'm wondering if this is a good
> candidate for Aurora 11.

I'd be much more comfortable if we could back out bug 696020 from Aurora. smaug, can we do that?

Revision history for this message
In , R-bugs-h (r-bugs-h) wrote :

No. We were thinking to release 9.0.2 with bug 696020 fixed.

Revision history for this message
In , R-bugs-h (r-bugs-h) wrote :

Or if we do that, we need to backout all
bug 696020, bug 689564 and bug 659350.

Revision history for this message
In , Alice0775 (alice0775) wrote :

*** Bug 731924 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jfsworld (jfsworld) wrote :

If I could request a summary of the status, where are we on this bug now? dindog@163's saying that it's fixed in 20121224 nightly? How about in release? When is this going to be seen in a release, and when?

Revision history for this message
In , Neil-httl (neil-httl) wrote :

If I've done my sums right, you should find that it's currently available in Firefox Aurora, will become available in Beta on the 13th, and then released on the 24th of April. (If you think 17 weeks is a long time to wait, don't forget that Firefox 4 came out 14 months after Firefox 3.6!)

Revision history for this message
In , Garryb (garryb) wrote :

Woot, I see this now in Firefox 12. (This is the main reason we're still using a designMode iframe in G+)

Revision history for this message
In , Ehsan-mozilla (ehsan-mozilla) wrote :

(In reply to garryb from comment #70)
> Woot, I see this now in Firefox 12. (This is the main reason we're still
> using a designMode iframe in G+)

Great! Please file new bugs if you see more problems blocking you from moving to contenteditable elements.

Revision history for this message
In , E-yak (e-yak) wrote :

As of 13.0.1 this still hasn't been fixed. Please see attached example:
http://pastebin.com/WTiitrQy

Revision history for this message
In , Xtc4uall (xtc4uall) wrote :

(In reply to Jakub Ondrusek from comment #72)

Please file a new Report in the Core/Editor Component with your Testcase attached. Thanks!

Revision history for this message
Edward Donovan (edward.donovan) wrote :

This problem, or something very much like it, is newly hitting my Firefox 15 in Quantal lately. Is anyone else seeing that? Thanks!

no longer affects: firefox-3.0 (Ubuntu)
no longer affects: firefox-3.5 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.