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

RESOLVED FIXED

Status

()

RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: yannbreliere, Unassigned)

Tracking

Trunk
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox15-)

Details

(URL)

(Reporter)

Description

6 years ago
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.
(Reporter)

Updated

6 years ago
Blocks: 695173

Updated

6 years ago
Hardware: x86 → ARM

Comment 1

6 years ago
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
tracking-firefox15: --- → ?
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.
tracking-firefox15: ? → -
(Reporter)

Comment 5

6 years ago
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.
(Reporter)

Comment 6

6 years ago
(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.
Duplicate of this bug: 788542
Bug 783531 adds a new platform text-selection API that might help with this problem.
Depends on: 783531
Duplicate of this bug: 798788
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.
Duplicate of this bug: 808578
Fixed by bug 772280.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.