Closed Bug 1068461 Opened 10 years ago Closed 10 years ago

[Text Selection] Text selection and copy paste bubble is hard to trigger in rocket bar

Categories

(Core :: DOM: Selection, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: howie, Assigned: pchang)

References

Details

Attachments

(1 file, 4 obsolete files)

[Steps To Reproduce]
1. Type some words in rocket bar
2. Try to trigger the text selection and copy paste bubble

[Actual Result]
Text selection and bubble is shown for user to perform cut copy paste

[Expected Result]
It's hard to trigger text selection and bubble
Priority: -- → P1
I've change the z-index and the bubble can display as expected. However, the long tap function doesn't work. I'm still investigating.
Assignee: nobody → gduan
Actually Gecko received a selection change with mouse_up reason, but the collapsed flag was false. Therefore, user can't see the selection caret on rocket bar. Checking the collapse falg now....
Thanks Peter!
set ni to you if you have any further infomation.
Flags: needinfo?(pchang)
Take this bug because it looks like related to the wrong frame selected from SelectionCarets::SelectWord.
Assignee: gduan → pchang
Flags: needinfo?(pchang)
To select the word, gecko tries to select the frame from the root (CanvasFrame) with the latest touch point. 

  For rocket bar, gecko will get the div frame, but not the text frame of the address bar. It is because the keyboard app is full screen with half transparent area. Therefore, the iframe of keyboard is overlapped the text frame of address bar. Therefore, gecko will match the keryboard iframe(FrameOuter) first and can't select it because it is not a text frame.
If I cache the frame during nsPresShell::HandleEvent(when touch happens), you can select the words in rocket bar by searching from this frame with latest touch point.
If we search the text frame from Viewport frame instead of canvas frame, we could select word from rocket bar.

Will check the difference between using viewport frame and canvas frame.
BTW, I found the drag in rocket bar is very slow. I will fire another bug to track it.
Blocks: 1083009
(In reply to peter chang[:pchang][:peter] from comment #8)
> Created attachment 8505231 [details] [diff] [review]
> 0001-Bug-1068461-Search-text-frame-from-viewport-frame-to.patch
> 
> If we search the text frame from Viewport frame instead of canvas frame, we
> could select word from rocket bar.
> 
> Will check the difference between using viewport frame and canvas frame.

The input for rocket bar is using position with fixed style.
According to frame tree, the text frame belong to the rocket bar input couldn't be located if you search from canvas frame.

And I could easy reproduce this issue by using the following link.
http://people.mozilla.org/~pchang/select2.html
Attached patch WIP v2 (obsolete) — Splinter Review
Drag the caret also has the same problem, change to viewport frame for SelectionCarets::DragSelection.
Attachment #8505231 - Attachment is obsolete: true
Attachment #8505365 - Flags: review?(roc)
Comment on attachment 8505365 [details] [diff] [review]
WIP v2

Review of attachment 8505365 [details] [diff] [review]:
-----------------------------------------------------------------

Fix commit message... don't need anything but the bug number and a description of what the patch does.
Attachment #8505365 - Flags: review?(roc) → review+
Attached patch WIP v3 (obsolete) — Splinter Review
Remove unnecessary info from commit message.

And paste the try link.
https://tbpl.mozilla.org/?tree=Try&rev=109ed9e2a01b
Attachment #8505365 - Attachment is obsolete: true
Attachment #8506766 - Flags: review+
(In reply to peter chang[:pchang][:peter] from comment #13)
> Created attachment 8506766 [details] [diff] [review]
> WIP v3
> 
> Remove unnecessary info from commit message.
> 
> And paste the try link.
> https://tbpl.mozilla.org/?tree=Try&rev=109ed9e2a01b

The try server result is positive and the failed item is also failed in others' try run.
Keywords: checkin-needed
Hi Peter,

the patch failed to apply cleanly see:

renamed 1068461 -> bug_1068461.patch
applying bug_1068461.patch
patching file layout/base/SelectionCarets.cpp
Hunk #1 FAILED at 508
Hunk #2 FAILED at 613

could you take a look, thanks!
Flags: needinfo?(pchang)
Keywords: checkin-needed
Attached patch WIP v4 (obsolete) — Splinter Review
Rebase with latest gecko
Attachment #8506766 - Attachment is obsolete: true
Flags: needinfo?(pchang)
Attachment #8509188 - Flags: review+
Keywords: checkin-needed
Attached patch WIP v5Splinter Review
Align the offset of selectcaret with canvasFrame, not the rootFrame.
Attachment #8509188 - Attachment is obsolete: true
Attachment #8509282 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/fcac94993c1c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: