Closed Bug 835710 Opened 13 years ago Closed 12 years ago

Homescreen not preventing BrowserElementScrolling code from running

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g18+ fixed, b2g18-v1.0.1 fixed)

RESOLVED FIXED
blocking-b2g -
Tracking Status
b2g18 + fixed
b2g18-v1.0.1 --- fixed

People

(Reporter: cjones, Assigned: crdlc)

References

Details

(Whiteboard: [FFOS_perf])

Attachments

(1 file, 2 obsolete files)

+++ This bug was initially created as a clone of Bug #834996 +++ Behavior seen in profile of Homescreen app - user puts finger down - touchstart handled by grid.js - homescreen *does not* and call evt.stopPropagation() - BrowserElementScrolling processes onTouchStart() and does 20-25ms unnecessary work We shouldn't run BES code when we're panning the homescreen. I'm not sure yet if this 20-25ms is on the critical startup path yet, but at any rate it's wasted CPU time. It looks like bug 831656 removed the stopPropagation() call that bug 834996 was filed about not working correctly. Intentional?
No longer depends on: 834996
Component: Gaia → Gaia::Homescreen
Assignee: nobody → crdlc
Status: NEW → ASSIGNED
Attached file Added stopPropagation (obsolete) —
NOTE: If blocking-basecamp+ is set, just land it for now. [Approval Request Comment] Bug caused by (feature/regressing bug #): User impact if declined: Testing completed: Risk to taking this patch (and alternatives if risky):
Attachment #707523 - Flags: review?(jones.chris.g)
Attachment #707523 - Flags: approval-gaia-v1?(21)
Attachment #707523 - Attachment description: Added preventDefault → Added stopPropagation
sorry for the mistake!
Comment on attachment 707523 [details] Added stopPropagation No more BrowserElementScrolling in the profile.
Attachment #707523 - Flags: review?(jones.chris.g) → review+
Comment on attachment 707523 [details] Added stopPropagation Approved for v1.0.0
Attachment #707523 - Flags: approval-gaia-v1?(21) → approval-gaia-v1+
It sounds like this fix works. I wonder, though... would preventDefault() also work? It seems like that would be the more appropriate thing to prevent this kind of default action
No, that would incidentally block the contextmenu event.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
(In reply to Jonas Sicking (:sicking) from comment #4) > Comment on attachment 707523 [details] > Added stopPropagation > > Approved for v1.0.0 Heh, was just about to request this. For posterity: this is a zero-risk patch that gets samples off the critical app startup path, and seems to alleviate a bit of lag on touchstart when panning.
I guess that this patch breaks the 'active' pseudo class in the list of items
I HAVE to eliminate this commit from master because there two regressions: 1) No active pseudo class on icons 2) No tap on everything.me categories
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
How can we back out the commit form master?
Flags: needinfo?(21)
Attached file Revert change due to regressions (obsolete) —
NOTE: If blocking-basecamp+ is set, just land it for now. [Approval Request Comment] Bug caused by (feature/regressing bug #): User impact if declined: Testing completed: Risk to taking this patch (and alternatives if risky):
Attachment #708530 - Flags: review?(jones.chris.g)
Attachment #708530 - Flags: approval-gaia-v1?(jonas)
Flags: needinfo?(21)
Attachment #708530 - Attachment mime type: text/plain → text/html
Does calling stopPropagation() on the touchmove event solve the bug without introducing new ones? If not, does preventDefault() work to solve the bug? Chris says that will break the contextmenu event. But you could simulate that easily by starting a timer on touchstart if you had to.
Comment on attachment 708530 [details] Revert change due to regressions Just back out the earlier commit. It's kind of bogus to rely on :active with touch events. It works without the patch here because gecko is trying hard to preserve compat, but the stopPropagation() will stop that compat code from running. The best thing to do here is for the homescreen to set a CSS class manually.
Attachment #708530 - Flags: review?(jones.chris.g)
Attachment #708530 - Flags: approval-gaia-v1?(jonas)
(In reply to David Flanagan [:djf] from comment #13) > Does calling stopPropagation() on the touchmove event solve the bug without > introducing new ones? > It doesn't, sadly: the vast majority of the BES overhead here is on touchstart. > If not, does preventDefault() work to solve the bug? Chris says that will > break the contextmenu event. But you could simulate that easily by starting > a timer on touchstart if you had to. That's an option but (i) less trivial; (ii) homescreen doesn't know the platform contextmenu timeout so has to invent its own. That's not necessarily a bad thing; UX wanted that, I think.
ok with active, but ev.me is listen to mouse events and with this commit ev.me is broken
ev.me categories are broken with this commit, any idea Ran? Are you using click event? thanks just in case I have the revert here https://github.com/mozilla-b2g/gaia/pull/7898
Flags: needinfo?(ran)
Hi Chiris, Here [1] we have a simple solution to stop the propagation of the touchstart event in all pages except ev.me due to event collisions very hard to solve according to ranbena. The other problem about active pseudo class is more complicated to solve. 1) We could only active this class when the tap is performed [2] (different behavior) or... 2) If we want to simulate the same behavior til now, we should implement it on touchstart and touchend handlers checking if the touchstart target is an icon . So we set or remove a CSS class manually. But my concern here: is it (check if the target is an icon ) faster than do not stop propagation? [1] https://github.com/crdlc/gaia/commit/3313801cfee954f4f14e5cf65c0518b004d9a16c [2] https://github.com/crdlc/gaia/blob/bug-835710-v2/apps/homescreen/js/page.js#L641
Flags: needinfo?(ran) → needinfo?(jones.chris.g)
upps sorry Chiris = Chris
The big win here comes from stopPropagation() on touchstart events where the target is an icon (to prevent relatively expensive BrowserElementScrolling code from running). It's cheap to check whether the event target is an icon.
Flags: needinfo?(jones.chris.g)
OK I have a patch. IMHO we can ask for approval v1 because it is interesting to have on v1, are you ok? thanks Chris
Yes please, the homescreen lagging on pans and creating overhead on taps is a big complaint right now.
OK, thanks, today I have a meeting during all day. I will try to create the patch today......
Attached file Patch v1
This patch implements: * Stop propagations on all pages except ev.me (collisions) * Active class is defined manually NOTE: If blocking-basecamp+ is set, just land it for now. [Approval Request Comment] Bug caused by (feature/regressing bug #): User impact if declined: more lag on panning Testing completed: crdlc tested as developer, maybe the reviewer could test too Risk to taking this patch (and alternatives if risky): low
Attachment #707523 - Attachment is obsolete: true
Attachment #708530 - Attachment is obsolete: true
Attachment #711213 - Flags: review?(21)
Attachment #711213 - Flags: approval-gaia-v1?
Comment on attachment 711213 [details] Patch v1 But please do not declare too many variables at the top of the function. That ends up in ugly files :) Removing approval? request and let's see if this get a tef+ since this is a perf bug on the homescreen panning. Triagers the risk for this bug is to have a regression in the active state of icons (the blue glow stuff over icons). It is buggy right now and this patch should help with that too so that's not a big risk imho.
Attachment #711213 - Flags: review?(21)
Attachment #711213 - Flags: review+
Attachment #711213 - Flags: approval-gaia-v1?
blocking-b2g: --- → tef?
Whiteboard: [FFOS_perf]
Vivien, all comments have been addressed. Thanks
Not a blocker, but definitely tracking. We'll approve for uplift to v1.0.1.
blocking-b2g: tef? → -
tracking-b2g18: --- → +
Attachment #711213 - Flags: approval-gaia-v1+
Status: REOPENED → RESOLVED
Closed: 13 years ago12 years ago
Resolution: --- → FIXED
v1-train: 18a5933140d843872683d1c5c983c6e0c9b17679
Batch edit: bugs fixed on b2g18 since 1/25 branch of v1.0 are fixed on v1.0.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: