Skip to content

c4c501a

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Dec 01:20

fix(web): Place the pointer rightly in an embedded page on Brave

Chromium gives pointerrawupdate in a frame the top-level page's client
coordinates, where pointermove has the frame's own. The client told the
two apart by where each put the viewport on the screen, but Brave
derives an event's screen coordinates from its client ones against
fingerprinting, so the misplaced positions agreed and the pointer sat
off by the frame's offset in its page.

Raw positions are now compared with pointermove's by sample: both events
carry a sample's time, and the samples either coalesced are looked at,
since on a busy page the two rarely end on the same one. Raw updates and
moves are kept per pointer until the other has passed them, so whichever
comes second is compared, a raw update before it is sent. Samples that
share a rounded time do not vouch for raw positions. Nothing is compared
under pointer lock, where both events repeat one frozen position that
vouched for misplaced ones once the lock ended.

The move that first vouches for raw positions now sends what a drag
coalesced, which no raw update had, and the check runs in the capture
phase, so a pen's handler has the decision when a frame moves
mid-stroke. Detaching forgets the events and the decision.