Closed Bug 980906 Opened 10 years ago Closed 9 years ago

apz is incompatible with content that is zoomed via toolkit's ZoomManager

Categories

(Core :: Panning and Zooming, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jimm, Unassigned)

References

Details

(Whiteboard: [metro] [gfx])

Looks like there are a number of issues to solve. Applying font inflation can result in heavy checker boarding when panning, infinite loops and stack overflow crashes in apzc code.
Please note that font inflation and "full zoom" are different things. "Font inflation" just increases the size of the text without affecting any other layout properties and should be completely independent of APZ. Full zoom increases the size of everything by adjusting the ratio of app units to layout device pixels; this has a similar effect as adjusting the widget scale which is DPI-based in that it affects text, images, and layout dimensions.
Also, the infinite loops and stack overflows sound scary. Can you post stacktraces?
The stack overflows are in APZCTreeManager::GetAPZCAtPoint, the infinite loops are APZCTreeManager::GetInputTransforms.

STR for the infinite loop:

1) apply the patch in bug 946970
2) open a page and zoom in a few wheel clicks
3) pinch zoom out

result: browser freezes

xul.dll!mozilla::layers::APZCTreeManager::GetInputTransforms(mozilla::layers::AsyncPanZoomController * aApzc=0x073fa7f8, gfx3DMatrix & aTransformToApzcOut={...}, gfx3DMatrix & aTransformToGeckoOut={...}) Line 1040	C++
xul.dll!mozilla::layers::APZCTreeManager::ProcessTouchEvent(const mozilla::WidgetTouchEvent & aEvent={...}, mozilla::layers::ScrollableLayerGuid * aOutTargetGuid=0x00000000, mozilla::WidgetTouchEvent * aOutEvent=0x0f6a88c8) Line 497	C++
xul.dll!mozilla::layers::APZCTreeManager::ReceiveInputEvent(mozilla::WidgetInputEvent & aEvent={...}, mozilla::layers::ScrollableLayerGuid * aOutTargetGuid=0x00000000) Line 615	C++
xul.dll!mozilla::widget::winrt::APZController::ReceiveInputEvent(mozilla::WidgetInputEvent * aEvent=0x0f6a88c8, mozilla::layers::ScrollableLayerGuid * aOutTargetGuid=0x00000000) Line 193	C++

we're stuck in the for loop in GetInputTransforms.

The crash is a little harder to reproduce but it's probably related to the above issue.
This smells like new and exciting layer tree bustage. Do you see any of the NS_ERROR messages from Layers.cpp before this happens? I believe the messages are only printed in debug mode.
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #4)
> This smells like new and exciting layer tree bustage. Do you see any of the
> NS_ERROR messages from Layers.cpp before this happens? I believe the
> messages are only printed in debug mode.

I'm working with a release build at the moment but I can check in a bit.

I think this stems from the issue of being able to apz zoom content beyond its bounds. For example if I just open a page and pinch in (zoom out) I can't because I'm at the bounds of the page. But if I zoom in first using full zoom, then try to pinch out, I can. What I get is the page bounds inset within the visible area of the screen.

On this page - 

http://www.mathies.com/mozilla/colorpage.html

I end up with a yellow rect in the upper left hand side of the view. At which point I'm stuck in the infinite loop I previously mentioned.
Blocks: metrobacklog
Whiteboard: [metro] [gfx]
(In reply to Jim Mathies [:jimm] from comment #5)
> I think this stems from the issue of being able to apz zoom content beyond
> its bounds. For example if I just open a page and pinch in (zoom out) I
> can't because I'm at the bounds of the page. But if I zoom in first using
> full zoom, then try to pinch out, I can. What I get is the page bounds inset
> within the visible area of the screen.

I don't think this behaviour should cause infinite loops or stack overflows in the APZCTreeManager code you pointed to. They might both have the same underlying cause though (a bad or incomplete layer tree). It's also possible that this zooming problem is just a legitimate bug in the APZ code. I'd rather eliminate the layer tree problems first and then see if this still happens.
On windows desktop apzc seems to be working fine with "desktop zoom" (i.e. run latest nightly with layers.async-pan-zoom.enabled set to true, dom.w3c_touch_events.enabled set to 1, load a page and scroll/zoom). If the infinite loop described above shows up in any other scenarios we can tackle it then.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.