Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1fb3367b0a4fb304a289c0f59ac61b6c85ab4101
      
https://github.com/WebKit/WebKit/commit/1fb3367b0a4fb304a289c0f59ac61b6c85ab4101
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-01-12 (Sun, 12 Jan 2025)

  Changed paths:
    A 
LayoutTests/fast/events/touch/ios/content-observation/mousemove-after-synthetic-click-quirk-expected.txt
    A 
LayoutTests/fast/events/touch/ios/content-observation/mousemove-after-synthetic-click-quirk.html
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [iPadOS/visionOS] YouTube media controls never dismiss after tapping to skip 
a preroll ad
https://bugs.webkit.org/show_bug.cgi?id=285821
rdar://108748685

Reviewed by Abrar Rahman Protyasha and Richard Robinson.

On youtube.com in visionOS and iPadOS, tapping the Skip button when a preroll 
ad is playing causes
the video player to get into a state where media controls stay visible, until 
the user taps anywhere
in the video player again. This is because YouTube has JavaScript that listens 
for mouseover events
that occur over the Skip button, which keeps the controls presented until the 
next mousemove or
mouseover event over the video. When this bug reproduces, a `mousemove` isn't 
dispatched over the
video player when tapping Skip, which causes YouTube's JavaScript to be stuck 
in a state where it
believes the media controls should stay presented, since the mouse is still 
over custom controls (in
this case, the Skip button).

When using a mouse pointer on trackpad on iPad or on Mac, this isn't a problem 
in practice because
the user would likely move the mouse anywhere over the video, immediately after 
clicking Skip.
However, this subsequent movement doesn't happen when performing a synthetic 
click.

To fix this, we augment an existing quirk (added in 
https://commits.webkit.org/209926@main) which
dispatches a synthetic `mouseout` after completing synthetic click, such that 
it additionally
dispatches a synthetic `mousemove` in the case where the synthetic `click` 
event caused the target
node to become unparented (i.e. in the case of the Skip button, which removes 
itself when clicked).
In doing so, this effectively updates the node under the (synthetic) mouse 
location before sending
a `mouseout` when tapping.

* 
LayoutTests/fast/events/touch/ios/content-observation/mousemove-after-synthetic-click-quirk-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/content-observation/mousemove-after-synthetic-click-quirk.html:
 Added.

Add a layout test to exercise this quirk on YouTube.

* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):

See above for more details.

Canonical link: https://commits.webkit.org/288780@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to