Closed Bug 1230552 Opened 9 years ago Closed 9 years ago

[apz] Flinging subframe flings parent when subframe ends

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

defect
Not set
normal

Tracking

(firefox46 fixed)

RESOLVED FIXED
Firefox 46
Tracking Status
firefox46 --- fixed

People

(Reporter: snorp, Assigned: botond)

References

()

Details

Attachments

(7 files, 3 obsolete files)

40 bytes, text/x-review-board-request
kats
: review+
Details
40 bytes, text/x-review-board-request
kats
: review+
Details
40 bytes, text/x-review-board-request
kats
: review+
Details
40 bytes, text/x-review-board-request
kats
: review+
Details
40 bytes, text/x-review-board-request
kats
: review+
Details
40 bytes, text/x-review-board-request
kats
: review+
Details
40 bytes, text/x-review-board-request
kats
: review+
Details
If you fling a subframe, and it hits the end of that document, any remaining velocity is applied to the parent document and the fling continues (starts?) there. I hate it.
Probably gonna WONTFIX this but I guess we should UX decide.
This was done on purpose back in bug 965871.
(In reply to Botond Ballo [:botond] from comment #2) > This was done on purpose back in bug 965871. Though, to be fair, the primary motivation at the time was B2G, where the structure of the dynamic toolbar meant we needed this to be able to fling the page at all.
Anthony, need some UX guidance here My problem with the current behavior is that when you're flinging, you can easily hit the end of the frame and then it's quickly not even on the screen. I think it should be prefable if you need it for the b2g browser.
Flags: needinfo?(alam)
snorp, can you also provide some sample URLs where you ran into this issue? Might make it easier for Anthony to try it out and decide.
Thanks! Yeah this is weird - I don't think I've really seen other apps do this before. If B2G needs this, we could make it prefable as snorp said, but I don't think this should be the behaviour of Fennec right now.
Flags: needinfo?(alam)
What about panning with the finger down (as opposed to flinging, where the finger is lifted and scrolling continues)? Fennec with the old JPZC code wouldn't hand that off either (you can see the behaviour in Aurora/Beta/Release). Do we want to restore that behaviour as well?
Assignee: nobody → snorp
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #8) > What about panning with the finger down (as opposed to flinging, where the > finger is lifted and scrolling continues)? Fennec with the old JPZC code > wouldn't hand that off either (you can see the behaviour in > Aurora/Beta/Release). Do we want to restore that behaviour as well? I personally don't care so much about that case. Anthony?
Flags: needinfo?(alam)
That patch is probably wrong, and misses some other cases, but does 'fix' it. I'm working on a better version.
I like this patch better, but not sure if it will end up breaking a bunch of other stuff.
Attachment #8696083 - Flags: review?(bugmail.mozilla)
Attachment #8696069 - Attachment is obsolete: true
Attachment #8696069 - Flags: review?(bugmail.mozilla)
Comment on attachment 8696083 [details] [diff] [review] Add preference for APZ overscroll handoff and disable everywhere except B2G Review of attachment 8696083 [details] [diff] [review]: ----------------------------------------------------------------- Botond should review the actual change. ::: modules/libpref/init/all.js @@ +606,5 @@ > pref("apz.y_skate_highmem_adjust", "2.5"); > #else > // Mobile prefs > +#if defined(MOZ_WIDGET_GONK) > +pref("apz.fling_allow_handoff", true); You should default this to true and make it false for fennec in mobile/android/app/mobile.js
Attachment #8696083 - Flags: review?(bugmail.mozilla) → review?(botond)
Chrome's behavior is to disallow panning/fling handoff unless you are at the edge of the document. That seems sensible to me, so let's try to do that.
Comment on attachment 8696083 [details] [diff] [review] Add preference for APZ overscroll handoff and disable everywhere except B2G Review of attachment 8696083 [details] [diff] [review]: ----------------------------------------------------------------- As discussed on IRC, this would disable handoff completely, even in cases where the child scroll frame is already scrolled to its end, but we do want handoff to work in that case. I had suggested trying to condition handoff in AttemptScroll() on whether the current scroll frame has been scrolled by a nonzero amount, but I since realized that wouldn't do what we want, because that would make the decision per-{touch move}, so we could still get handoff in the middle of a single pan gesture. We need the decision to be per-{input block} instead. I also realized that we need fling handoff to work in the above scenario, too, because if you start a pan from a child scroll frame scrolled to its end and scroll its parent, when you let go the fling still starts from the child's APZC, so we need that to be handed off to the parent.
Attachment #8696083 - Flags: review?(botond) → review-
Here's an outline of how this could be done: - Have each input block store a "scrolled APZC" property which represents the first APZC to actually scroll for that input block. - The first time an APZC is actually scrolled during an input block, set the "scrolled APZC" property on the input block. - Add a pref "apz.allow_immediate_handoff" which would be true on B2G and false on Fennec. - If the pref is not set, prevent handoff _beyond_ the the input block's "scrolled APZC". This would ensure that on setups where the pref is not set, a single input block only scrolls a single APZC.
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #9) > (In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #8) > > What about panning with the finger down (as opposed to flinging, where the > > finger is lifted and scrolling continues)? Fennec with the old JPZC code > > wouldn't hand that off either (you can see the behaviour in > > Aurora/Beta/Release). Do we want to restore that behaviour as well? > > I personally don't care so much about that case. Anthony? Not quite following, but did we cover this in our session this week Snorp? If not, whats the best way to test this?
Flags: needinfo?(alam) → needinfo?(snorp)
(In reply to Anthony Lam (:antlam) from comment #17) > > Not quite following, but did we cover this in our session this week Snorp? > If not, whats the best way to test this? I think we showed you and talked about it, yeah. The idea here is that a single fling will only scroll *one* frame. If you get to the end of a subframe and fling again, it will allow a handoff at the beginning.
Flags: needinfo?(snorp)
I had some spare time today so I put together the beginnings of a patch that implements the strategy outlined in comment 16. It's not tested and doesn't handle flings, but it can be used as a starting point for further work.
Ended up finishing this on the plane. Still haven't tested it on a device, but I will before landing.
Bug 1230552 - Update some out-of-date comments and remove an old #undef. r=kats
Attachment #8697798 - Flags: review?(bugmail.mozilla)
Bug 1230552 - Const-correctness improvements. r=kats
Attachment #8697799 - Flags: review?(bugmail.mozilla)
Bug 1230552 - Introduce a helper AsyncPanZoomController::CurrentInputBlock(). r=kats
Attachment #8697800 - Flags: review?(bugmail.mozilla)
Bug 1230552 - Make immediate scroll handoff for panning prefable. r=kats Immediate handoff is the current behaviour. The alternative is to only allow a single input block to scroll a single APZC.
Attachment #8697801 - Flags: review?(bugmail.mozilla)
Bug 1230552 - Introduce a structure to group fling handoff state. r=kats This patch also cleans up APZCTreeManager::DispatchFling() a bit.
Attachment #8697802 - Flags: review?(bugmail.mozilla)
Bug 1230552 - Extend the immediate scroll handoff pref to apply to flings. r=kats
Attachment #8697803 - Flags: review?(bugmail.mozilla)
Bug 1230552 - Disallow immediate scroll handoff on Fennec. r=kats
Attachment #8697804 - Flags: review?(bugmail.mozilla)
Attachment #8696083 - Attachment is obsolete: true
Attachment #8697657 - Attachment is obsolete: true
Assignee: snorp → botond
Nice, thanks for handling this Botond.
Comment on attachment 8697798 [details] MozReview Request: Bug 1230552 - Update some out-of-date comments and remove an old #undef. r=kats https://reviewboard.mozilla.org/r/27713/#review24955
Attachment #8697798 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8697799 [details] MozReview Request: Bug 1230552 - Const-correctness improvements. r=kats https://reviewboard.mozilla.org/r/27715/#review24957
Attachment #8697799 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8697800 [details] MozReview Request: Bug 1230552 - Introduce a helper AsyncPanZoomController::CurrentInputBlock(). r=kats https://reviewboard.mozilla.org/r/27717/#review24959
Attachment #8697800 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8697801 [details] MozReview Request: Bug 1230552 - Make immediate scroll handoff for panning prefable. r=kats https://reviewboard.mozilla.org/r/27719/#review24961 ::: gfx/layers/apz/src/InputBlockState.h:52 (Diff revision 1) > + mScrolledApzc = aApzc; I'd prefer having these function bodies in the .cpp file even though they're trivial. Also would it make sense to MOZ_ASSERT(!mScrolledApzc) at the top of the setter function?
Attachment #8697801 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8697802 [details] MozReview Request: Bug 1230552 - Introduce a structure to group fling handoff state. r=kats https://reviewboard.mozilla.org/r/27721/#review24965 Nice!
Attachment #8697802 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8697803 [details] MozReview Request: Bug 1230552 - Extend the immediate scroll handoff pref to apply to flings. r=kats https://reviewboard.mozilla.org/r/27723/#review24967
Attachment #8697803 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8697804 [details] MozReview Request: Bug 1230552 - Disallow immediate scroll handoff on Fennec. r=kats https://reviewboard.mozilla.org/r/27725/#review24969 Nice set of patches, thanks for splitting them up so cleanly! ::: mobile/android/app/mobile.js:574 (Diff revision 1) > +pref("apz.allow_immediate_handoff", false); Move this up into the MOZ_ANDROID_APZ block. It doesn't really matter now but eventually we'll remove that #ifdef and use the prefs unconditionally, and if you move it now they'll stay alpha-ordered.
Attachment #8697804 - Flags: review?(bugmail.mozilla) → review+
I addressed review comments locally, and tested this on a device. Seems to be working as intended!
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #32) > Also would it make sense to MOZ_ASSERT(!mScrolledApzc) at the top of the setter function? I just realized, I forgot about this comment. However, I don't think we can do this. We call the setter on every touch-move event that scrolls by a non-zero amount, so subsequent touch-moves in a single input block would trip it.
(In reply to Pulsebot from comment #39) > https://hg.mozilla.org/integration/mozilla-inbound/rev/1c7bebd09158 This is a small follow-up to change an EXPECT_EQ in the gtest to an ASSERT_NEAR, to account for a fact that a fling can end leaving an scroll frame within COORDINATE_EPSILON of the end of its scroll range, rather than right at the end. (The assertion was passing for me locally, but failing in automation.)
(In reply to Botond Ballo [:botond] from comment #38) > > However, I don't think we can do this. We call the setter on every > touch-move event that scrolls by a non-zero amount, so subsequent > touch-moves in a single input block would trip it. How about MOZ_ASSERT(!mScrolledApzc || mScrolledApzc == aApzc)?
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #41) > (In reply to Botond Ballo [:botond] from comment #38) > > > > However, I don't think we can do this. We call the setter on every > > touch-move event that scrolls by a non-zero amount, so subsequent > > touch-moves in a single input block would trip it. > > How about MOZ_ASSERT(!mScrolledApzc || mScrolledApzc == aApzc)? That should work. Thanks for suggesting it! Added it in a follow-up: https://hg.mozilla.org/integration/mozilla-inbound/rev/08dca8061836
Depends on: 1247964
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: