Closed Bug 774190 Opened 12 years ago Closed 12 years ago

element.setCapture cease to work on device

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-basecamp:+)

RESOLVED WORKSFORME
blocking-basecamp +

People

(Reporter: timdream, Unassigned)

Details

Attachments

(1 file)

https://github.com/mozilla-b2g/gaia/issues/2447


https://developer.mozilla.org/en/DOM/element.setCapture

setCapture is a method to redirect mouse events to a specific target even if the cursor/finger had move out of the specified element.

For recent weeks this method failed to work on devices, resulting breakage of the lock screen unlock gesture, the utility tray, and card view.

STR:

1. turn on B2G with a fresh baked Gecko and Gaia
2. attempt to unlock the device by moving the handle, but don't move it to the unlock target
3. Move your finger out of the handle (e.g., move to the clock), and then stop touching the screen

Expected (B2G Desktop):

1. A mouseup event fired on the handle, resulting the handle bounce back to it's original place.

Actual (B2G devices, currently):

1. mouseup event fired on the actual visible element (e.g., clock), making the handle to stick on it's last place.
blocking-basecamp: --- → ?
OS: Mac OS X → Gonk
Hardware: x86 → ARM
I've removed setCapture from the lock screen, so people should find STR in the UI test app.
Asked in Gaia issue if we can ship the workaround or not. Leaving nominated until we get more information there.
I don't think setCapture is used a lot on the web, so might not be blocking. However I'm concerned that this might be used a lot in mobile websites which definitely would make it a blocker. I don't have any data or hunches either way.
Whiteboard: [blocked-on-product]
Whiteboard: [blocked-on-product]
Whiteboard: [blocked-on-input]
It's best for our Web-based phone behavior the same way as the real web.

The only thing in Gaia that cannot ship with the workaround is the pull down tray from the status bar (the Utility Tray), but strangely setCapture seems to be working on that particular part of Gaia for no reason... so I guess we are fine?
Web platform code should run in B2G browser just like our other browsers. Blocking+.
blocking-basecamp: ? → +
Whiteboard: [blocked-on-input]
We use it for the keyboard application and this is hard to do without it.
With a quick investigation mousemove events are dispatched correctly. It seems only mouseup is busted.
There is something weird with TouchEvents. If I disable them in widget/gonk/nsAppShell.cpp then it works again.
Attached patch PatchSplinter Review
This patch does not release capture when TOUCH_END is fired, only on mouse up.

I think this is fine per spec but I would like Jonas to confirm.
Attachment #647311 - Flags: review?(jonas)
Comment on attachment 647311 [details] [diff] [review]
Patch

Olli is a better reviewer for this stuff
Attachment #647311 - Flags: review?(jonas) → review?(bugs)
(In reply to Jonas Sicking (:sicking) from comment #3)
> I don't think setCapture is used a lot on the web, so might not be blocking.
> However I'm concerned that this might be used a lot in mobile websites which
> definitely would make it a blocker. I don't have any data or hunches either
> way.

IIRC setCapture is Trident/Gecko only.
So, is the problem that touchend releases capture so that mouseup ends up firing on a wrong target?
Comment on attachment 647311 [details] [diff] [review]
Patch

This should be ok, but needs tests.
Attachment #647311 - Flags: review?(bugs) → review+
Actually, wesj is about to fix this issue in another bug.
(In reply to Olli Pettay [:smaug] from comment #14)
> Actually, wesj is about to fix this issue in another bug.

Nice. Do you have the bug number handy?
Hmm, I think it got fixed already :) but I don't have the bug# here.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: