Closed Bug 898075 Opened 11 years ago Closed 9 years ago

Remove the mozbrowserasyncscroll event

Categories

(Core :: Panning and Zooming, defect)

23 Branch
All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

In the world prior to multi-apzc, the mozbrowserasyncscroll event was only dispatched on the top-level window (i.e. the one associated with the APZC). In the world with multi-apzc, the event should be updated to indicate which window or subframe is actually scrolling.

Filing this as a placeholder bug. For now my plan is that in bug 866232 each APZC will be calling the GeckoContentController::SendAsyncScrollDOMEvent callback with the scroll id, and the RenderFrameParent will only dispatch as events the ones corresponding to ROOT_SCROLL_ID. This maintains backwards compatibility with the gaia browser which uses these events to show/hide the toolbar.
Actually once the new dynamic toolbar for b2g is in place we shouldn't need the mozbrowserasyncscroll event at all.
Component: Graphics: Layers → Panning and Zooming
Summary: mozbrowserasyncscroll should indicate what it's scrolling → Remove the mozbrowserasyncscroll event
No longer blocks: multi-apzc
Since bug 943849 changed the scroll events to fire every 40ms I think we should change the browser app to also use the regular scroll event instead of mozbrowserasyncscroll. That is the only user of this event, and then we can get rid of the event entirely. At this point I'm not convinced that the mozbrowserasyncscroll event fires any more often than the scroll event so it shouldn't make a noticeable difference in the browser addressbar hiding. Ben, any thoughts?
Flags: needinfo?(bfrancis)
I didn't think we added the asyncscroll event because it fired more often, it was because it fired in sync with the kinetic scrolling or something. There were bugs when using the normal scroll events. I could be wrong though!

We shouldn't need this from Firefox OS 1.4 as the UI design is changing, so could we perhaps keep this around until 1.4 has reached code complete and we are sure?
Flags: needinfo?(bfrancis)
(In reply to Ben Francis [:benfrancis] from comment #3)
> I didn't think we added the asyncscroll event because it fired more often,
> it was because it fired in sync with the kinetic scrolling or something.
> There were bugs when using the normal scroll events. I could be wrong though!

There's no way it can actually be in sync because the scrolling happens on the compositor thread and the asynsc-scroll event (by definition) is read in the content thread so there is inherently a disconnect there.

> We shouldn't need this from Firefox OS 1.4 as the UI design is changing, so
> could we perhaps keep this around until 1.4 has reached code complete and we
> are sure?

I suppose so. Is there a meta-bug or something for the 1.4 changes that can I make this depend on?
Yes, bug 945259 is the system browser MVP meta bug which will determine whether we can ship the system browser and turn off the current app.
Depends on: browser-chrome-mvp
Assignee: nobody → bugmail.mozilla
Attachment #8683677 - Flags: review?(bfrancis)
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

This is all just straightforward code deletion. r?sicking because I touched a .webidl file.
Attachment #8683701 - Flags: review?(jonas)
Attachment #8683701 - Flags: review?(botond)
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Putting this on hold for a bit, discussion on IRC with ben francis indicates this might still be needed.
Attachment #8683701 - Flags: review?(jonas)
Attachment #8683701 - Flags: review?(botond)
(In reply to Ben Francis [:benfrancis] from comment #11)
> Comment on attachment 8683677 [details] [review]
> [gaia] staktrace:noasync > mozilla-b2g:master
> 
> The scroll event is still used by AppChrome, please don't remove it.
> 
> https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/app_chrome.
> js#L278
> https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/app_chrome.
> js#L625
> https://github.com/mozilla-b2g/gaia/blame/master/apps/system/js/app_window.
> js#L1192

I don't think that scroll handler is attached to that scroll event - Pretty sure that handler is attached to the scroll events of the scrollgrab container.
Just to confirm: https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/app_chrome.js#L710

I think this is safe to remove. n?benfrancis+kats to confirm.
Flags: needinfo?(bugmail.mozilla)
Flags: needinfo?(bfrancis)
I also tested the scenario that Ben pointed out on IRC:

"Pinned sites have pinned chrome which doesn't expand/collapse on scroll. It will collapse after being manually expanded but not expand again. So load a website in a browser window, pin the site (via the browser menu) and observed collapsed & "pinned" chrome no longer expands/collapses on scroll. Manually expand by tapping the collapsed chrome, then scroll to collapse it again."

and this works fine both with and without my gaia patch.
Flags: needinfo?(bugmail.mozilla)
Comment on attachment 8683677 [details] [review]
[gaia] staktrace:noasync > mozilla-b2g:master

Yep, my bad.

We use the same event name but it seems the event being listened to here is actually a "scroll" DOM event from the "scrollable" div, not the "scroll" event we publish on AppWindow. It used to listen to the Browser API scroll events but it doesn't any more :)

https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/app_chrome.js#L710

Sorry for the confusion.
Flags: needinfo?(bfrancis)
Attachment #8683677 - Flags: review- → review+
Thanks. Flagging as checkin-needed for the gaia PR; leave-open for the gecko side
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Kan-Ru, do you see any problem with removing the mozbrowserasyncscroll event? Ben said on IRC that you were the module owner for the browser API. This event is not used in Gaia anymore and I would like to remove it because it's not really a reliable indicator of scroll position; it is no more "async" than regular scroll events.
Attachment #8683701 - Flags: feedback?(kchen)
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Review of attachment 8683701 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for doing this!
Attachment #8683701 - Flags: feedback?(kchen) → feedback+
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Thanks! Restoring original review request as in comment 8.
Attachment #8683701 - Flags: review?(jonas)
Attachment #8683701 - Flags: review?(botond)
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Review of attachment 8683701 [details] [diff] [review]:
-----------------------------------------------------------------

Burn it with fire :)
Attachment #8683701 - Flags: review?(botond) → review+
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Review of attachment 8683701 [details] [diff] [review]:
-----------------------------------------------------------------

r=me on the webidl change. Didn't look at any other parts.
Attachment #8683701 - Flags: review?(jonas) → review+
Comment on attachment 8683701 [details] [diff] [review]
Gecko patch

Review of attachment 8683701 [details] [diff] [review]:
-----------------------------------------------------------------

Actually I could r+ the browser-element part.
https://hg.mozilla.org/mozilla-central/rev/0d3a6fcb8687
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: