Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ec30fe66cd0d5a03489ab0d144b4ea5813b116c0
https://github.com/WebKit/WebKit/commit/ec30fe66cd0d5a03489ab0d144b4ea5813b116c0
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-11 (Sat, 11 Jul 2026)
Changed paths:
M Source/WebCore/html/track/VTTCue.cpp
Log Message:
-----------
Use a switch in VTTCue::calculateMaximumSize
https://bugs.webkit.org/show_bug.cgi?id=319157
rdar://181977661
Reviewed by Jer Noble.
calculateMaximumSize() mapped the computed position alignment to its spec
rule with a chain of if/else branches. Replace it with a switch on the
computed position alignment so the mapping from each alignment value to its
rule is explicit and exhaustive, with an ASSERT_NOT_REACHED() safety net in
the Auto case (which calculateComputedPositionAlignment() never returns).
As a drive-by, drop a redundant re-test in the process: the old final
center branch re-checked "positionAlignment == PositionAlignSetting::Center"
even though the earlier LineLeft/LineRight branches meant control could only
reach it when the alignment was already Center, so that check could never be
false. No change in behavior.
* Source/WebCore/html/track/VTTCue.cpp:
(WebCore::VTTCue::calculateMaximumSize const):
Canonical link: https://commits.webkit.org/316988@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications