Press and hold on empty space brings up nonsensical selection

RESOLVED INCOMPLETE

Status

defect
P2
normal
RESOLVED INCOMPLETE
6 years ago
2 years ago

People

(Reporter: jimm, Unassigned)

Tracking

Trunk
x86_64
Windows 8.1
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [selection] p=8)

Attachments

(3 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
str:

- press hold on background content 

result: 
- selection monocles are displayed bordering nonsensical content
- context menu is displayed with 'copy' and pointless 'search bing for ""' options

expected:
- nothing should happen
Defect for it5?
Blocks: 831952
No longer blocks: metrov1triage
Flags: needinfo?(asa)
Moving to iteration #5 for consideration as a defect.
Blocks: metrov1it5
Flags: needinfo?(asa)
Priority: -- → P1
QA Contact: jbecerra
Summary: Press and hold on empty space brings up nonsensical context menu options → Defect - Press and hold on empty space brings up nonsensical context menu options
Whiteboard: feature=defect c=Context_menus u=metro_firefox_user p=tbd
(Reporter)

Updated

6 years ago
Assignee: nobody → jmathies
(Reporter)

Comment 3

6 years ago
Posted image example regions
I'm not sure how to solve this. What we want to be able to do in ContextMenuHandler is make a smart choice about whether or not the user intended to invoke selection on underlying text content.

http://mxr.mozilla.org/mozilla-central/source/browser/metro/base/content/contenthandlers/ContextMenuHandler.js#220

The popup dom node is commonly an element type. If we instance of test it it can be anything depending on the underlying content. I have a test case where I have form inputs that run down the left side of a page an if I press-hold in the empty content to the right, I get a form element. In the test case pictured here I get a div. So I don't think the element type is of much help.

What I need to be able to do is ask the dom "hey, is there selectable content near this point?" but afaik we don't have anything like that available.

cc'ing a few folks who might have some ideas.
My plan for Fennec was to do something like:

if (DOMWindowUtils.selectAtPoint()) {
  var rects = getSelection().getRangeAt(0).getBoundingClientRect(); // I hope this is a 0x0 rect at some point?
  // if point is near rects, continue selection, otherwise cancel it
}
(Reporter)

Comment 5

6 years ago
(In reply to Wesley Johnston (:wesj) from comment #4)
> My plan for Fennec was to do something like:
> 
> if (DOMWindowUtils.selectAtPoint()) {
>   var rects = getSelection().getRangeAt(0).getBoundingClientRect(); // I
> hope this is a 0x0 rect at some point?
>   // if point is near rects, continue selection, otherwise cancel it
> }

That would work in the test case I have, although I think you might see a brief flash of selection rendered after calling selectAtPoint. In the screenshot I posted, the selection would be some random chunk of the text to the left of where you placed your finger.
(Reporter)

Comment 6

6 years ago
Maybe selectAtPoint can be trained to be more 'selective' than this. Although I'd prefer to find a solution that doesn't involve mucking with c++ selection code. :)
(Reporter)

Updated

6 years ago
Attachment #730814 - Attachment is patch: false
Attachment #730814 - Attachment mime type: text/plain → image/png
True. In fennec, our selection starts by positioning the cursor with a mouse click, which is horrible, but also invisible (and hopefully all those hacks are going away). I assumed nothing would show.
(Reporter)

Updated

6 years ago
Whiteboard: feature=defect c=Context_menus u=metro_firefox_user p=tbd → feature=defect c=Context_menus u=metro_firefox_user p=8
Status: NEW → ASSIGNED
(Reporter)

Updated

6 years ago
Summary: Defect - Press and hold on empty space brings up nonsensical context menu options → Defect - Press and hold on empty space brings up nonsensical selection
(Reporter)

Comment 8

6 years ago
Posted patch forms fix (obsolete) — Splinter Review
We can avoid this in certain cases (like my test case) by being more careful about when we call selectAtPoint.
(Reporter)

Comment 9

6 years ago
Posted patch forms fixSplinter Review
Attachment #735215 - Attachment is obsolete: true
Blocks: metrov1it6
No longer blocks: metrov1it5
Point Estimate = 8.
Blocks: metrov1defect&change
No longer blocks: metrov1it6
Whiteboard: feature=defect c=Context_menus u=metro_firefox_user p=8 → feature=defect c=Context_menus u=metro_firefox_user p=0
Assignee: jmathies → nobody
Priority: P1 → --
(Reporter)

Updated

6 years ago
Priority: -- → P4
Priority: P4 → --
(Reporter)

Updated

6 years ago
Whiteboard: feature=defect c=Context_menus u=metro_firefox_user p=0 → [selection] feature=defect c=Context_menus u=metro_firefox_user p=0
No longer blocks: metrov2defect&change
Summary: Defect - Press and hold on empty space brings up nonsensical selection → Press and hold on empty space brings up nonsensical selection
Whiteboard: [selection] feature=defect c=Context_menus u=metro_firefox_user p=0 → [selection] [defect] p=0
Blocks: 957244
No longer blocks: 831952
Status: ASSIGNED → NEW
(Reporter)

Updated

5 years ago
Whiteboard: [selection] [defect] p=0 → [selection] [defect] p=8
Priority: -- → P2
Whiteboard: [selection] [defect] p=8 → [selection] p=8
QA Contact: jbecerra
OS: Windows 8 Metro → Windows 8.1
Mass close of bugs in obsolete product https://bugzilla.mozilla.org/show_bug.cgi?id=1350354
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.