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)
Tracking
(blocking-b2g:-, b2g18+ fixed, b2g18-v1.0.1 fixed)
RESOLVED
FIXED
blocking-b2g | - |
People
(Reporter: cjones, Assigned: crdlc)
References
Details
(Whiteboard: [FFOS_perf])
Attachments
(1 file, 2 obsolete files)
188 bytes,
text/html
|
vingtetun
:
review+
akeybl
:
approval-gaia-v1+
|
Details |
+++ 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?
Updated•13 years ago
|
Component: Gaia → Gaia::Homescreen
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → crdlc
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•13 years ago
|
||
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)
Assignee | ||
Updated•13 years ago
|
Attachment #707523 -
Attachment description: Added preventDefault → Added stopPropagation
Assignee | ||
Comment 2•13 years ago
|
||
sorry for the mistake!
Reporter | ||
Comment 3•13 years ago
|
||
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+
Comment 5•13 years ago
|
||
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
Reporter | ||
Comment 6•13 years ago
|
||
No, that would incidentally block the contextmenu event.
Assignee | ||
Comment 7•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 8•13 years ago
|
||
(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.
Assignee | ||
Comment 9•13 years ago
|
||
I guess that this patch breaks the 'active' pseudo class in the list of items
Assignee | ||
Comment 10•13 years ago
|
||
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 → ---
Assignee | ||
Comment 12•13 years ago
|
||
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)
Assignee | ||
Updated•13 years ago
|
Attachment #708530 -
Attachment mime type: text/plain → text/html
Comment 13•13 years ago
|
||
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.
Reporter | ||
Comment 14•13 years ago
|
||
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)
Reporter | ||
Comment 15•13 years ago
|
||
(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.
Assignee | ||
Comment 16•13 years ago
|
||
ok with active, but ev.me is listen to mouse events and with this commit ev.me is broken
Assignee | ||
Comment 17•13 years ago
|
||
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)
Assignee | ||
Comment 18•13 years ago
|
||
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)
Assignee | ||
Comment 19•13 years ago
|
||
upps sorry Chiris = Chris
Assignee | ||
Comment 20•13 years ago
|
||
Active simulation manually in this commit
https://github.com/crdlc/gaia/commit/60f55578bf69957e8ab1d0a7ab2e45f6d52c5c6a
Reporter | ||
Comment 21•13 years ago
|
||
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)
Assignee | ||
Comment 22•13 years ago
|
||
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
Reporter | ||
Comment 23•13 years ago
|
||
Yes please, the homescreen lagging on pans and creating overhead on taps is a big complaint right now.
Assignee | ||
Comment 24•13 years ago
|
||
OK, thanks, today I have a meeting during all day. I will try to create the patch today......
Assignee | ||
Comment 25•13 years ago
|
||
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 26•13 years ago
|
||
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]
Assignee | ||
Comment 27•13 years ago
|
||
Vivien, all comments have been addressed. Thanks
Comment 28•12 years ago
|
||
Not a blocker, but definitely tracking. We'll approve for uplift to v1.0.1.
blocking-b2g: tef? → -
tracking-b2g18:
--- → +
Updated•12 years ago
|
Attachment #711213 -
Flags: approval-gaia-v1+
Assignee | ||
Comment 29•12 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 13 years ago → 12 years ago
Resolution: --- → FIXED
Comment 30•12 years ago
|
||
v1-train: 18a5933140d843872683d1c5c983c6e0c9b17679
status-b2g18:
--- → fixed
status-b2g18-v1.0.1:
--- → fixed
Comment 31•12 years ago
|
||
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.
Description
•