Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 12ad3756dfcfcd9bf05eb81f17b803b9b2a6f041
https://github.com/WebKit/WebKit/commit/12ad3756dfcfcd9bf05eb81f17b803b9b2a6f041
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-12 (Sun, 12 Jul 2026)
Changed paths:
M Source/WebCore/platform/PODIntervalTree.h
M Tools/TestWebKitAPI/CMakeLists.txt
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WebCore/PODIntervalTree.cpp
Log Message:
-----------
PODIntervalTree::nextIntervalAfter can return a non-nearest following interval
https://bugs.webkit.org/show_bug.cgi?id=318575
rdar://181342988
Reviewed by Chris Dumez.
smallestNodeGreaterThanFrom() is meant to find the interval with the
smallest low endpoint strictly greater than the query point. The tree is
a binary search tree keyed by low endpoint, so when the point is below a
node's low, the node is a candidate but a still-smaller candidate can
only live in its left subtree. The code recursed into node->right()
instead — whose lows are all >= node.low and therefore never smaller —
so it overshot and returned a farther-following interval (or none). The
local was even named "left", confirming the intent.
This backs nextIntervalAfter(), used by HTMLMediaElement for next-text-
track-cue selection, so the wrong cue could be chosen.
Recurse into node->left().
Test: Tools/TestWebKitAPI/Tests/WebCore/PODIntervalTree.cpp
* Source/WebCore/platform/PODIntervalTree.h:
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/PODIntervalTree.cpp: Added.
(TestWebKitAPI::TEST(PODIntervalTree,
NextIntervalAfterReturnsNearestFollowing)):
(TestWebKitAPI::TEST(PODIntervalTree, NextIntervalAfterMatchesBruteForce)):
Canonical link: https://commits.webkit.org/317018@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications