Closed
Bug 685702
Opened 14 years ago
Closed 13 years ago
investigate responsiveness gap between mouse & drag events
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Core
DOM: Copy & Paste and Drag & Drop
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: fryn, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [snappy])
Attachments
(3 files)
The primary reason for using mouse events in the current implementation of tab animations is their superior responsiveness. However, it has become apparent that drag events have enough useful properties that make rewriting tab animations with them a worthwhile endeavor. If the responsiveness gap between the two sets of events can be closed, we can have the best of both worlds.
I've created two simple testcases: one using plain mouse events and the other using drag events. I will upload these shortly. If you could look into why the gap exists and how it could be mitigated or even eliminated, it will be much appreciated.
If this bug is in the wrong component, feel free to move it.
| Reporter | ||
Comment 1•14 years ago
|
||
Here's the testcase with mouse events. It's superior in responsiveness and in the ability to detect drags over a window's titlebar and anywhere outside of the document.
| Reporter | ||
Comment 2•14 years ago
|
||
Here's the testcase that uses drag events. Notice that it is slower to respond and seems to stutter more with a lower frame rate. Also, when the XUL document is being rendered as a top-level window, no dragover events are fired while over the titlebar.
I have to use `dragover` events instead of `drag` events, because screen coordinates are not provided for `drag` events (see bug 505521), which is very problematic for tab animations.
Updated•14 years ago
|
Component: General → Drag and Drop
Product: Toolkit → Core
QA Contact: general → drag-drop
Comment 3•14 years ago
|
||
Both these testcases show smooth performance to me. I tested on a debug build on Ubuntu.
(In reply to Neil Deakin from comment #3)
> Both these testcases show smooth performance to me. I tested on a debug
> build on Ubuntu.
Same here (Win7 x64).
I wondered if perhaps I wasn't using the test cases correctly or if it was just me. This was particularly due to fryn mentioning "It's superior in [...] the ability to detect drags over a window's titlebar". I can't seem to do any interactions like that, only drag the tabs horizontally.
| Reporter | ||
Comment 5•14 years ago
|
||
(In reply to Lozzy from comment #4)
> I wondered if perhaps I wasn't using the test cases correctly or if it was
> just me. This was particularly due to fryn mentioning "It's superior in
> [...] the ability to detect drags over a window's titlebar". I can't seem to
> do any interactions like that, only drag the tabs horizontally.
Because I can't use a `drag` event handler, I'm using a `dragover` event handler, which means that I can't detect when a drag moves over the titlebar of the document's window on OS X and Ubuntu. This is problematic because there should be a vertical threshold for tab detaching, and I can't implement that without the ability to get screen coordinates for `drag` events. See bug 505521.
Neil, any ideas on how we could get screen coordinates for `drag` events?
Comment 6•14 years ago
|
||
It requires an answer to https://bugzilla.mozilla.org/show_bug.cgi?id=505521#c6
| Reporter | ||
Comment 7•14 years ago
|
||
(In reply to Neil Deakin from comment #6)
> It requires an answer to
> https://bugzilla.mozilla.org/show_bug.cgi?id=505521#c6
My answer is that the coordinates should be given relative to the window containing the element that is the target of the drag event. More precisely, this window is the window whose top-left corner is used for calculating element.boxObject.screenX/Y, where element is the target of the drag event.
| Reporter | ||
Comment 8•14 years ago
|
||
(In reply to Frank Yan [:fryn] from comment #7)
Correction: By window, I meant screen.
Comment 9•14 years ago
|
||
(In reply to Neil Deakin from comment #3)
> Both these testcases show smooth performance to me. I tested on a debug
> build on Ubuntu.
Ditto. Tested with my old netbook on Win XP.
Comment 10•14 years ago
|
||
the mouse events one is a bit less stuttering on my system (i7, win7 x64), but it's pretty much subtle, likely most users would not notice, but I wonder if it would be more visible on slower systems.
Comment 11•14 years ago
|
||
Drag events are much worse for me on OS X, at least.
Testing Frank's new tab dragging patch on a latest-gen MacBook Air (Intel Core i7, Intel HD 3000 graphics), and it's noticably slower than the previous implementation that used mouse events.
| Reporter | ||
Updated•13 years ago
|
Blocks: 783282
Keywords: regression
Summary: Investigate responsiveness gap between mouse events and drag events → Make tab dragging smoother (less janky); alternately, investigate responsiveness gap between mouse & drag events
Whiteboard: [snappy]
| Reporter | ||
Comment 13•13 years ago
|
||
Justin Lebar [:jlebar] wrote his original filing of bug 801509:
> Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/19.0 Firefox/19.0
>
> Like bug 786397, but that seems to have fixed itself.
>
> STR: Drag a tab around the tab bar. It janks.
>
> Profiling coming in a moment.
> perf shows that we're spending a lot of time in malloc and free, which is
> interesting. It seems to be coming from layout?
See bug 801509 comment #1 for a partial report.
> It's not all from layout; 50% of malloc calls are coming from g_malloc,
> which I can't see past in the stacktrace.
>
> Here are the top few functions and abbreviated stack traces from perf. I'll
> attach the full perf report in a moment, but it's not fun to read. Note
> that all the arena_ functions are part of malloc or free.
See bug 801509 comment #2 for a partial report.
| Reporter | ||
Comment 14•13 years ago
|
||
Thanks for profiling this, Justin!
| Reporter | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Keywords: regression
Resolution: --- → INCOMPLETE
Summary: Make tab dragging smoother (less janky); alternately, investigate responsiveness gap between mouse & drag events → investigate responsiveness gap between mouse & drag events
You need to log in
before you can comment on or make changes to this bug.
Description
•