Closed
Bug 1175564
Opened 10 years ago
Closed 10 years ago
APZC: vertical scrolling has no momentum or is blocked (horizontal scroll works properly)
Categories
(Core :: Panning and Zooming, defect)
Core
Panning and Zooming
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: paul, Assigned: paul)
References
Details
(Whiteboard: gfx-noted)
Attachments
(2 files, 1 obsolete file)
864.65 KB,
video/mp4
|
Details | |
1.27 KB,
patch
|
paul
:
review+
|
Details | Diff | Splinter Review |
On OSX, with B2G desktop, with APZC enabled, scrolling in an iframe behaves in one of these ways:
1) scroll properly, with momentum (doesn't happen often)
2) scroll, but there's no momentum (happens often)
3) doesn't scroll (happens often, but not as much as 2)
Scrolling horizontally works properly (smooth with momentum).
When 3) happens, I get this warning in the terminal (many of them):
> 0xXXXXXXX replacing unconfirmed target 0xYYYYYYYY with real target 0x0
This happens with pages as simple as a big image:
> <iframe mozbrowser=true remote=true src=http://i.imgur.com/HHBRUKO.png>
Any idea how I can debug that?
Assignee | ||
Comment 1•10 years ago
|
||
Behavior 2) is really what happens most of the time. See attachment.
Comment 3•10 years ago
|
||
I'm going to move this to Panning and Zooming but it might be cocoa/e10s style issue. FWIW I notice the same thing using the trackpad with e10s so it might be the same issue as e10s but I don't know for sure.
Component: Graphics: Layers → Panning and Zooming
Whiteboard: gfx-noted
Comment 4•10 years ago
|
||
Loading this page in OS X desktop with APZ enabled works fine:
data:text/html,<iframe mozbrowser=true remote=true src=http://i.imgur.com/HHBRUKO.png>
Unless this affects OS X desktop or B2G on a device it's not going to be very high priority, sorry.
Flags: needinfo?(dvander)
Assignee | ||
Comment 5•10 years ago
|
||
Any pointer? Anything that I could try to log/enable/disable that would help me understand what's going on?
The fact it works for horizontal scrolling but not for vertical scrolling might help understand what could go wrong.
Assignee | ||
Comment 6•10 years ago
|
||
It only happens if the page can scroll horizontally.
If the page is not larger (width) than the viewport, scrolling works as expected.
Assignee | ||
Comment 7•10 years ago
|
||
Scrolling in a larger-than-viewport iframe triggers crash after a while:
[Child 25943] ###!!! ABORT: ActorDestroy by IPC channel failure at LayerTransactionChild: file /Users/paul/mozilla/src/gfx/layers/ipc/LayerTransactionChild.cpp, line 121
#01: mozilla::ipc::ProcessLink::OnChannelError()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x49fc28]
#01: mozilla::layers::PCompositorChild::DestroySubtree(mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>::ActorDestroyReason)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x79d318]
#02: IPC::Channel::ChannelImpl::OnFileCanReadWithoutBlocking(int)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x47e019]
#02: mozilla::layers::PCompositorChild::OnChannelError()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x79d613]
#03: event_base_loop[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x4600df]
#03: mozilla::ipc::MessageChannel::NotifyMaybeChannelError()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x49def7]
#04: base::MessagePumpLibevent::Run(base::MessagePump::Delegate*)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x46c685]
#04: MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask const&)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x46b1bd]
#05: MessageLoop::Run()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x46a85c]
#05: MessageLoop::DoWork()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x46b4fb]
#06: base::Thread::ThreadMain()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x47565d]
#06: mozilla::ipc::DoWorkRunnable::Run()[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x4a07c5]
#07: ThreadFunc(void*)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x47576a]
#07: nsThread::ProcessNextEvent(bool, bool*)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0xe1c55]
#08: _pthread_body[/usr/lib/system/libsystem_pthread.dylib +0x3268]
#08: NS_ProcessPendingEvents(nsIThread*, unsigned int)[/Users/paul/mozilla/src/obj.debug.noindex/dist/B2GDebug.app/Contents/MacOS/XUL +0x11aa1f]
#09: _pthread_body[/usr/lib/system/libsystem_pthread.dylib +0x31e5]
[Child 25943] ###!!! ABORT: Aborting on channel error.: file /Users/paul/mozilla/src/ipc/glue/MessageChannel.cpp, line 1662
Hit MOZ_CRASH() at /Users/paul/mozilla/src/memory/mozalloc/mozalloc_abort.cpp:33
Assignee | ||
Comment 8•10 years ago
|
||
Crash is most likely related to bug 1161166.
Assignee | ||
Comment 9•10 years ago
|
||
We must do something in the wheel code to cancel out tiny horizontal movements when doing "big" vertical movement to have a perfectly straight scrolling. The lack of momentum happens when the horizontal movement is very tiny, when the cancelling happen. When there's enough horizontal movement, momentum works (and scrolling is not exactly straight).
Assignee | ||
Comment 10•10 years ago
|
||
I'm wrong. I don't see any horizontal scrolling happening. Momentum happens on horizontal and diagonal scrolling. If vertical movement is much larger than horizontal movement, then momentum doesn't happen.
Assignee | ||
Comment 11•10 years ago
|
||
Note: the apzctreemanager gets the momentum events.
Assignee | ||
Comment 12•10 years ago
|
||
Scrolling stop because we end up here:
http://hg.mozilla.org/mozilla-central/file/2694ff2ace6a/gfx/layers/apz/src/AsyncPanZoomController.cpp#l1515
Assignee | ||
Comment 13•10 years ago
|
||
Note: mY.CanScroll(aDelta.y) returns false. It I force it to return true, momentum works as expected.
Assignee | ||
Comment 14•10 years ago
|
||
mY->mAxisLocked is true.
Assignee | ||
Comment 15•10 years ago
|
||
Commenting this line:
http://hg.mozilla.org/mozilla-central/file/2694ff2ace6a/gfx/layers/apz/src/AsyncPanZoomController.cpp#l1934
Fixes the momentum issue.
What is cross_slide?
Comment 16•10 years ago
|
||
Cross-slide is a gesture in windows [1] that we added APZ support for, when the metro browser was still a thing. We can remove cross-slide support although I'm not convinced doing that will fix this problem. If you are hitting the line 1934 as in your previous comment that means the scroll delta is almost completely horizontal. Can you log the steam of scroll deltas coming into the wheel events (which get translated to touch events) and check that they reflect your finger movements on the trackpad?
And thanks for digging through the code!
[1] https://msdn.microsoft.com/en-us/library/windows/apps/hh465299.aspx
Assignee | ||
Comment 17•10 years ago
|
||
So the issue is that when momentum scrolling starts, and new pan is started. It starts with a displacement of x:0,y:0. When the angle of the pan is calculated, we end up with and angle of 0 (which make no sense), which is considered as close to horizontal panning, locking the y axis.
In HandlePanning, `IsCloseToHorizontal(aAngle, gfxPrefs::APZAxisLockAngle())` is true because angle is 0.
I hope that makes sense :)
Attachment #8624699 -
Flags: review?(bugmail.mozilla)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → paul
Comment 18•10 years ago
|
||
Ah, nice find! That does seem like a bug. I think the more correct solution would be to land the patch in bug 1156606 but apparently that caused tests to fail and needs some work. In the meantime I think your patch should be fine, since OnPanBegin is only ever called from the instant-scroll wheel handler now. On OSX we might get pan-gesture events, but only if layers.async-pan-zoom.separate-event-thread is set to true, which is not the default case. And even then I don't think this patch would break anything there.
See Also: → 1156606
Comment 19•10 years ago
|
||
Comment on attachment 8624699 [details] [diff] [review]
v1
Review of attachment 8624699 [details] [diff] [review]:
-----------------------------------------------------------------
s/block/lock/ in the commit message. rest looks good.
Attachment #8624699 -
Flags: review?(bugmail.mozilla) → review+
Assignee | ||
Comment 20•10 years ago
|
||
Attachment #8624745 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Attachment #8624699 -
Attachment is obsolete: true
Comment 21•10 years ago
|
||
Also for the record the reason this doesn't happen on OS X desktop is because GetAxisLockMode() == FREE on desktop but B2G desktop picks up b2g prefs which include axis locking.
Assignee | ||
Comment 22•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 23•10 years ago
|
||
Keywords: checkin-needed
Comment 24•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•