Closed Bug 1206545 Opened 9 years ago Closed 9 years ago

AccessibleCaret and Copy & Paste feature in Telegram doesn't work

Categories

(Core :: DOM: Selection, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla45
Tracking Status
firefox45 --- fixed
b2g-v2.5 --- fixed

People

(Reporter: mihaibn, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

(Keywords: foxfood)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0
Build ID: 20150820202733

Steps to reproduce:

Copy a link from the Browser and try to paste it in Telegram


Actual results:

The paste button doesn't appear


Expected results:

I should be able to paste any text from the clipboard in the Telegram text box
Hi Sebastian

Can you please look into this?
Flags: needinfo?(sebasmagri)
Flags: needinfo?(igor.beatle)
I don't see any eMouseLongTap coming to AccessibleCaret when long pressing in Telegram app. Thus no caret or copy/paste menu is being triggered. Not sure if the touch events are handled by the app since I could only see obfuscated js code in WebIDE.
Did anything in the copy paste feature change since 2.2? Because it worked fine with 2.2
Keywords: foxfood
Component: Gaia::System → Selection
Product: Firefox OS → Core
Copy and paste feature was refactored in 2.5. If it worked in 2.2, this is a regression.
Assignee: nobody → tlin
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(sebasmagri)
Flags: needinfo?(igor.beatle)
Bug 1206545 - Store nsIPresShell pointer in constructor instead of Init(). r=roc

When constructing AccessibleCaretEventHub, bypass and store the
nsIPresShell pointer. This is a preparation for later patches.

Also, remove 'virtual' for Init() and Terminate() since the mock object
in gtest does not need to override them.
Attachment #8687846 - Flags: review?(roc)
Bug 1206545 - Initialize AccessibleCaretEventHub in nsCanvasFrame. r=roc

To properly initialize AccessibleCaretEventHub, both canvas frame and
its anonymous mCustomContentContainer are required to successfully
insert anonymous caret elements.

However, if <html> has "display: none",
nsCSSFrameConstructor::ConstructDocElementFrame() will return early in
[1] without constructing mCustomContentContainer. Thus,
AccessibleCaretEventHub will fail to initialize in [2] due to null
mCustomContentContainer.

By moving AccessibleCaretEventHub::Init() to
nsCanvasFrame::CreateAnonymousContent(), we can guarantee that
mCustomContentContainer is constructed before initializing
AccessibleCaretEventHub.

[1] https://dxr.mozilla.org/mozilla-central/rev/7cd2d806bd069c0260ff73f023ac85f892b863bf/layout/base/nsCSSFrameConstructor.cpp#2413-2416
[2] https://dxr.mozilla.org/mozilla-central/rev/7cd2d806bd069c0260ff73f023ac85f892b863bf/layout/base/nsPresShell.cpp#1682
Attachment #8687847 - Flags: review?(roc)
Bug 1206545 - Add a marionette test case. r=roc

Test AccessibleCaretEventHub is properly initialized if <html> has
"display: none" initially.
Attachment #8687848 - Flags: review?(roc)
Comment on attachment 8687846 [details]
MozReview Request: Bug 1206545 - Store nsIPresShell pointer in constructor instead of Init(). r=roc

https://reviewboard.mozilla.org/r/25253/#review22795
Attachment #8687846 - Flags: review?(roc) → review+
Comment on attachment 8687847 [details]
MozReview Request: Bug 1206545 - Initialize AccessibleCaretEventHub in nsCanvasFrame. r=roc

https://reviewboard.mozilla.org/r/25255/#review22797
Attachment #8687847 - Flags: review?(roc) → review+
[Blocking Requested - why for this release]: The caret and copy & paste feature does not work in Telegram app on v2.5, and it's working in v2.2.
blocking-b2g: --- → 2.5?
Summary: Paste Link from Browser in Telegram doesn't work → AccessibleCaret and Copy & Paste feature in Telegram doesn't work
Comment on attachment 8687846 [details]
MozReview Request: Bug 1206545 - Store nsIPresShell pointer in constructor instead of Init(). r=roc

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 1110039

User impact if declined: AccessibleCaret and copy & paste feature does not work in Telegram app or other apps with initialized <html> with "display: none".

Testing completed: Landed on m-c with a new marionette test case added.

Risk to taking this patch (and alternatives if risky): Low. This patch does not change functionality.
 
String or UUID changes made by this patch: None.
Attachment #8687846 - Flags: approval‑mozilla‑b2g44?
Comment on attachment 8687847 [details]
MozReview Request: Bug 1206545 - Initialize AccessibleCaretEventHub in nsCanvasFrame. r=roc

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 1110039

User impact if declined: AccessibleCaret and copy & paste feature does not work in Telegram app or other apps with initialized <html> with "display: none".

Testing completed: Landed on m-c with a new marionette test case added.

Risk to taking this patch (and alternatives if risky): Low. This patch delays the initialization until all the required resources are ready. If not taking this patch, apps will need to work around the issue by not using "display: none" on <html>
 
String or UUID changes made by this patch: None.
Attachment #8687847 - Flags: approval‑mozilla‑b2g44?
I just tried this with OTA 20151118030211 and it works
Status: RESOLVED → VERIFIED
Comment on attachment 8687846 [details]
MozReview Request: Bug 1206545 - Store nsIPresShell pointer in constructor instead of Init(). r=roc

Approved for 2.5 uplift.
Attachment #8687846 - Flags: approval‑mozilla‑b2g44? → approval‑mozilla‑b2g44+
Comment on attachment 8687847 [details]
MozReview Request: Bug 1206545 - Initialize AccessibleCaretEventHub in nsCanvasFrame. r=roc

Approved for 2.5 uplift

Thanks
Attachment #8687847 - Flags: approval‑mozilla‑b2g44? → approval‑mozilla‑b2g44+
Please help uplift the two patches marked approval‑mozilla‑b2g44+. Thanks.
blocking-b2g: 2.5? → ---
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: