Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 462ce69479bd73f3f956d26e627dfc494d2aa2f9
      
https://github.com/WebKit/WebKit/commit/462ce69479bd73f3f956d26e627dfc494d2aa2f9
  Author: Josh Hernandez <[email protected]>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M Source/WebKit/WebProcess/WebPage/FindController.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindInPage.mm

  Log Message:
  -----------
  Find the caption cue nearest video's playhead from selection
https://bugs.webkit.org/show_bug.cgi?id=319163
rdar://182001231

Reviewed by Andy Estes.

When a find starts from a selection, all of a video's matching cues
share the media element's document position, so the closest match
always resolved to the run's first/last cue.
Instead, pick the cue nearest the video's playhead in the search direction.

Added additional find-in-video navigation coverage on macOS, covering
both the new behavior and stepping through interleaved page text and
caption cues.

* Source/WebKit/WebProcess/WebPage/FindController.cpp:
(WebKit::cueIndexNearestPlayhead):
(WebKit::indexClosestToSelection):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindInPage.mm:
(configurationWithFindInVideoEnabled):
(waitForVideoCurrentTimeNear):
(TEST(WebKit, FindInPageVideoCaptionStepThroughCues)):
(TEST(WebKit, FindInPageVideoCaptionCueInSubframe)):
(seekAndPlaceCaretBeforeVideo):
(seekAndPlaceCaretAfterVideo):
(TEST(WebKit, FindInPageVideoCaptionNearestCueForward)):
(TEST(WebKit, FindInPageVideoCaptionNearestCueBackward)):
(TEST(WebKit, FindInPageVideoCaptionNearestCuePastAllForward)):
(TEST(WebKit, FindInPageVideoCaptionNearestCueBeforeAllBackward)):
(currentTimeAfterHighlighting):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to