Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 41e9a94793ef26fa41fd5eaee3da722803f4d3ed
      
https://github.com/WebKit/WebKit/commit/41e9a94793ef26fa41fd5eaee3da722803f4d3ed
  Author: Dana Estra <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M Source/WebCore/rendering/RenderVTTCue.cpp
    M Source/WebCore/rendering/RenderVTTCue.h

  Log Message:
  -----------
  VTT cue positioning algorithm should use floats instead of ints
https://bugs.webkit.org/show_bug.cgi?id=319433
rdar://182250995

Reviewed by Eric Carlson.

Currently, WebKit fails WebVTT WPT 2_cues_overlapping_partially_move_up.html
and 2_cues_overlapping_partially_move_down.html. These tests check that when
a VTT file uses the line setting to position cues such that they overlap,
the browser moves the second cue as minimally as possible so that they do not 
overlap.

The rendered cues' top and bottom edges should be flush with each other, since 
the spec
expects the cue to be moved minimally and makes no indication that we should be
rounding to the nearest integer. However, WebKit's rendering of these vtt files
puts a gap between the two cues. This is caused by our use of integers in 
RenderVTTCue.
We should instead use floats.

No new test expectations due to bugs in the wpt tests that cause us to still 
fail them.
One a future patch fixes the tests the expectations will be updated.

* Source/WebCore/rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::unroundedAbsoluteBoundingBoxRect):
(WebCore::RenderVTTCue::isOutside const):
(WebCore::RenderVTTCue::rectIsWithinContainer const):
(WebCore::RenderVTTCue::overlappingObject const):
(WebCore::RenderVTTCue::overlappingObjectForRect const):
(WebCore::RenderVTTCue::moveIfNecessaryToKeepWithinContainer):
(WebCore::RenderVTTCue::findNonOverlappingPosition const):
(WebCore::RenderVTTCue::repositionCueSnapToLinesNotSet):
* Source/WebCore/rendering/RenderVTTCue.h:

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



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

Reply via email to