Open Bug 1774519 Opened 3 years ago Updated 2 years ago

The initial key event isn't going to be handled by APZ

Categories

(Core :: Panning and Zooming, defect, P5)

defect

Tracking

()

People

(Reporter: hiro, Unassigned)

Details

A way to see this issue reliably is;

  1. MOZ_LOG="apz.focusstate:5,apz.key:5" ./mach run gfx/layers/apz/test/mochitest/helper_tall.html
  2. Press arrow down key on the launched Firefox window

You will get a log something like this;

D/apz.key Skipping key input with no shortcut
D/apz.focusstate Checking IsCurrent() with cseq=0, aseq=3
D/apz.focusstate Focus changing event incremented aseq to 4
D/apz.key Marking input with type=6 as focus changing with seq=4

D/apz.focusstate Checking IsCurrent() with cseq=0, aseq=4
D/apz.key Skipping key input with no current focus target
D/apz.focusstate Focus changing event incremented aseq to 5
D/apz.key Marking input with type=6 as focus changing with seq=5

D/apz.focusstate Update with rlt=4294967297, olt=4294967298, ft=(ScrollTargets, 5)
D/apz.focusstate Looking for target in lt=4294967298
D/apz.focusstate Setting target to h=0, v=2, and seq=5

D/apz.key Skipping key input with no shortcut
D/apz.focusstate Checking IsCurrent() with cseq=5, aseq=5
D/apz.key Marking input with type=6 as non focus changing with seq=5

The first chunk of the above log is a key down event of the arrow down key, it was skipped because our keyboard shortcuts are corresponding to key press events rather then key down events.

The second chunk is a key press event which is one of shortcuts we are going to scroll driven by an APZC, but unfortunately the scroll didn't happen due to mismatch of the focus sequence numbers (cseq != aseq)

The third chunk is a place where the sequence numbers are in-sync (which, I suppose, was triggered by the key press event above)

I don't think this issue is a big deal in the wild, but it's a bit annoying in automated tests. We somehow need to make the sequence numbers be in-sync before sending native key events.

You need to log in before you can comment on or make changes to this bug.