Bug 27330 - setCapture/releaseCapture/onlosecapture
Summary: setCapture/releaseCapture/onlosecapture
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-15 22:02 PDT by Ben Goodger
Modified: 2017-07-18 08:29 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Goodger 2009-07-15 22:02:49 PDT
It'd be useful for a JavaScript framework I'm developing if WebKit would implement the IE-specific setCapture/releaseCapture functions and the "losecapture" event.

These functions basically route all subsequent mouse events to an object until capture is lost. It is a fairly standard part of an OS UI toolkit, I believe the IE implementation is intended to clone the Windows API SetCapture/ReleaseCapture methods. Gtk has a similar concept called "grab".

See http://msdn.microsoft.com/en-us/library/ms536742(VS.85).aspx for more information.

Forgive me if this has already been discussed, I couldn't find anything in the bug system.
Comment 1 Erik Arvidsson 2009-07-16 09:15:19 PDT
I agree with Ben that this is really useful. Getting dragging to behave sane in the presence of iframes, windowed plugins and handling mouse releases outside the window is something 9 out of 10 web apps fail to do correctly today.

It also simplifies the event handling code a js author needs to write since they only have to listen to the initial target.
Comment 2 Ojan Vafai 2009-07-16 09:36:46 PDT
Relevant public-webapps thread: http://www.mail-archive.com/public-webapps@w3.org/msg01512.html

Ben, Erik, what do you think about Hixie's comment:
"Note that I don't think we'd need releaseCapture(); we should just say 
that capture is canceled when the mouse is released if it was captured. 
This gets around the problem of unbalanced set/release."
Comment 3 Erik Arvidsson 2009-07-16 10:54:51 PDT
(In reply to comment #2)
> Relevant public-webapps thread:
> http://www.mail-archive.com/public-webapps@w3.org/msg01512.html
> 
> Ben, Erik, what do you think about Hixie's comment:
> "Note that I don't think we'd need releaseCapture(); we should just say 
> that capture is canceled when the mouse is released if it was captured. 
> This gets around the problem of unbalanced set/release."

I think Hixie has a point but I don't think we should diverge from IE's API. It is just not worth it
Comment 4 Erik Arvidsson 2009-10-20 17:50:30 PDT
Firefox just added this.
Comment 5 Jeremy 2011-10-19 01:48:14 PDT
Any movement on this? ETA?
Comment 6 Bronislav Klucka 2012-03-18 01:29:09 PDT
Any movement on this?
Comment 7 Bronislav Klucka 2012-05-11 02:28:44 PDT
ANY plans here?
Comment 8 Bronislav Klucka 2013-03-04 20:16:37 PST
hi, any news?