Closed
Bug 745381
Opened 13 years ago
Closed 13 years ago
We send a lot of touch events during panning of http://people.mozilla.org/~jrosevear/color-test.html
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(blocking-fennec1.0 +)
RESOLVED
FIXED
Firefox 14
Tracking | Status | |
---|---|---|
blocking-fennec1.0 | --- | + |
People
(Reporter: jrmuizel, Assigned: wesj)
References
Details
(Whiteboard: [mtd][inbound])
Attachments
(2 files)
1.10 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
3.99 KB,
patch
|
Details | Diff | Splinter Review |
This means we end up calling GetFrameForPoint which can be expensive on complex pages.
Assignee | ||
Comment 1•13 years ago
|
||
One really easy optimization here, we don't actually need to refind target's for touch events. They're always dispatched to the original target. We can probably just skip GetFrameForPoint for anything but touchstart events.
Comment 2•13 years ago
|
||
Also something to consider: https://bugzilla.mozilla.org/show_bug.cgi?id=743736#c4
OS: Linux → Android
Hardware: x86_64 → All
Assignee | ||
Comment 3•13 years ago
|
||
There's also a bug(?) in:
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsGfxScrollFrame.cpp#2169
which causes us to use the entire displayport when building a list for hit testing in Fennec (note that should be true for mouse events as well, since I assume elementFromPoint and nodesFromRect take this same code path).
Comment 4•13 years ago
|
||
Brian - Is this optimization the same as bug 743736? If not, let's impl it. If it is, let's dupe it.
Assignee: nobody → bnicholson
blocking-fennec1.0: ? → +
Comment 5•13 years ago
|
||
(In reply to Wesley Johnston (:wesj) from comment #3)
> There's also a bug(?) in:
>
> http://mxr.mozilla.org/mozilla-central/source/layout/generic/
> nsGfxScrollFrame.cpp#2169
>
> which causes us to use the entire displayport when building a list for hit
> testing in Fennec (note that should be true for mouse events as well, since
> I assume elementFromPoint and nodesFromRect take this same code path).
Should this be a separate bug?
Assignee | ||
Comment 6•13 years ago
|
||
Yep. Filed bug 745936.
Assignee | ||
Comment 7•13 years ago
|
||
Sorry to steal this back. I'm digging through all this code anyway. Easy fix.
I'm not sure this will fix this bug. We still send tons of touch events. Just faster. Fingers jitter on the screen, and in addition we send them if your pressure or the radius of the touch changes.
If this isn't enough, we could try smoothing some of that data and only sending events from java if there is a significant delta between the last one. But I wanted to avoid that and give pages access to as close to the raw data as we can (our data is already filtered by android to some extent).
Assignee: bnicholson → wjohnston
Attachment #615513 -
Flags: review?(bugs)
Comment 8•13 years ago
|
||
This patch is a bigger hammer to fix this nail; it will just not send the touch events at all if the page isn't listening for them. From what I can tell, the dom-touch-listener-added will always get called if a page registered a touch listener, so this should always be correct. It may be the case that the page unregisters its touch listeners and there we will keep firing events. (Also if this patch lands then bug 744518 should be marked as WONTFIX because that will render this patch moot by adding a touchstart listener on every page, effectively).
Attachment #615557 -
Flags: review?(wjohnston)
Updated•13 years ago
|
Blocks: checkerboarding
Comment 9•13 years ago
|
||
Comment on attachment 615513 [details] [diff] [review]
Patch
So where do we get the right target?
Assignee | ||
Comment 10•13 years ago
|
||
For anything that's not a touch move, we are caching the target (on a per touch basis) and redispatching to it here:
http://mxr.mozilla.org/mozilla-beta/source/layout/base/nsPresShell.cpp#6725
This code (the code we're skipping around with this patch) currently fails for touchmove/touchend/touchcancel because the refpoint for those points is (0,0) (inherited from nsEvent). We special cased TOUCH_DOWN slightly above this so that it returns the "correct" refpoint.
Updated•13 years ago
|
Attachment #615513 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 11•13 years ago
|
||
After much hg fail, pushed with the wrong bug number (argh. I'm done with inbound for the day I think):
https://hg.mozilla.org/integration/mozilla-inbound/rev/d07b72d4865d
Assignee | ||
Comment 12•13 years ago
|
||
Marking mtd for the inbound people. I still need to look at kat's patch here. Truthfully, I don't want to do that, and would like to see where we are after this before we take a bigger hammer to it.
If we want to clear the blocker, we can move that to a different bug?
Whiteboard: [mtd][inbound]
Comment 13•13 years ago
|
||
Feel free to r- the patch and if we need it later we can file a new bug and grab the patch from here.
Comment 14•13 years ago
|
||
(In reply to Kartikaya Gupta (:kats) from comment #13)
> Feel free to r- the patch and if we need it later we can file a new bug and
> grab the patch from here.
Let's file a new bug and move the patch, especially if the risks are different.
Assignee | ||
Comment 15•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Attachment #615557 -
Flags: review?(wjohnston)
Updated•13 years ago
|
Target Milestone: --- → Firefox 14
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•