Closed Bug 782691 Opened 12 years ago Closed 11 years ago

Text selection shouldn't happen on text not currently visible.

Categories

(Firefox for Android Graveyard :: Text Selection, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox15-)

RESOLVED FIXED
Tracking Status
firefox15 - ---

People

(Reporter: yannbreliere, Unassigned)

References

()

Details

Since recent nightlies, text selection has been added to fennec (android native).

Since then, when I long press an empty area (to start scrolling slowly), the browser jumps to the top of the page (scrolls up) and a word somewhere at the top is selected.

I guess it's trying to select the nearest text of the div where the finger press occured, but as it was not a visible text, and not anywhere near my finger (only "near" in the DOM, I guess), it should not happen.
If I wanted to highlight text there, I would scroll and long-tap on it. Here, I'm just long-pressing to scroll slowly (or I paused during a long scroll of a page), so it is very frustrating that it makes me go somewhere unrelated.
Hardware: x86 → ARM
I remember Chris filing a bug at one point about long tapping in blank areas triggering text selection, but I can't find it now. However, I believe the decision in that bug is that it's just too hard to try to distinguish between when the user intends to start text selection or not.

However, I don't think the page should start scrolling when text selection begins, so that seems like a separate issue. Can you share a URL for a webpage where this always happens?
Margaret, I reported bug 772280.
+1 on this bug, it's quite annoying. I was seeing it on http://www.cnn.com/2012/08/14/health/texas-quintuplets/index.html?hpt=hp_c1 on the Galaxy Tab. Load the page, double-tap on the article to zoom in, and then scroll down like you're reading it. There seem to be a number of spots near the right edge of the visible area where holding a finger down will make the page jump back up to the top and highlight the "CNN Health" header, the year from the byline, or some other part of the page.

One thing that we could do is check to see if the piece of text being selected is contained (or intersects) the currently visible viewport. Since the user shouldn't be able to select off-screen text, and selecting on-screen text shouldn't trigger a scroll, this check should be sufficient to fix the problem.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Won't hold a release for this, seems like a nice-to-have.  We can look at uplifting patches when there's something ready.
Sorry for the late reply...

(In reply to Margaret Leibovic [:margaret] from comment #1)
> However, I don't think the page should start scrolling when text selection
> begins, so that seems like a separate issue. Can you share a URL for a
> webpage where this always happens?
This happens on any page, for example this one, when long pressing a blank area (on the right of the comments, for example).

(In reply to Kartikaya Gupta (:kats) from comment #3)
> http://www.cnn.com/2012/08/14/health/texas-quintuplets/index.html?hpt=hp_c1
> on the Galaxy Tab. Load the page, double-tap on the article to zoom in, and
> then scroll down like you're reading it. There seem to be a number of spots
> near the right edge of the visible area where holding a finger down will
> make the page jump back up to the top and highlight the "CNN Health" header,
> the year from the byline, or some other part of the page.
Yes, it's even more anoying when it thinks I'm long-tapping while I'm just scrolling.

> One thing that we could do is check to see if the piece of text being
> selected is contained (or intersects) the currently visible viewport. Since
> the user shouldn't be able to select off-screen text, and selecting
> on-screen text shouldn't trigger a scroll, this check should be sufficient
> to fix the problem.
Yes, this would be a perfect solution.
(In reply to Yann Brelière from comment #5)
> Yes, it's even more anoying when it thinks I'm long-tapping while I'm just
> scrolling.
Ok, this seems to be Bug 769049. This bug should just cover not selecting text outside of the viewport.
Bug 783531 adds a new platform text-selection API that might help with this problem.
Depends on: 783531
Deviant Art's main page has a good example of this happening. Scrolling down the page then clicking anywhere that is not an image or link will scroll you to the top of the page.

Still reproducible on today's (2012-10-23) nightly.
Fixed by bug 772280.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.