Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 53b6a4522e456da88f5fde66f7687d2f24335994
      
https://github.com/WebKit/WebKit/commit/53b6a4522e456da88f5fde66f7687d2f24335994
  Author: Jer Noble <jer.no...@apple.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    A LayoutTests/media/content/test-inband-captions.mp4
    A LayoutTests/media/track/track-in-band-layout-expected.txt
    A LayoutTests/media/track/track-in-band-layout.html
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/html/track/InbandGenericTextTrack.cpp
    M Source/WebCore/html/track/TextTrackCueGeneric.cpp
    M Source/WebCore/html/track/TextTrackCueGeneric.h
    M Source/WebCore/html/track/VTTCue.h
    M Source/WebCore/platform/graphics/InbandGenericCue.cpp
    M Source/WebCore/platform/graphics/InbandGenericCue.h
    M 
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  REGRESSION(265596@main): [Cocoa] In-band captions generate large, 
line-wrapped cues
https://bugs.webkit.org/show_bug.cgi?id=265635
rdar://119024855

Reviewed by Eric Carlson.

When modernizing VTTCue, TextTrackCueGeneric was not sufficiently updated to 
take advantage
of the correct layout implemented by VTTCue. Specifically, TextTrackCueGeneric 
still queried
VTTCueBox::fontSizeFromCaptionUserPrefs(), which was no longer set, and caused 
the cue width
to be incorrectly set to zero.

Remove that dead method, and remove most of the implementation of
TextTrackCueGenericBoxElement::applyCSSProperties, relying instead upon 
VTTCueBoxElement's
implementation.

In order to correctly position TextTrackCueGeneric objects created from 
AVFoundation, set
the resulting cue's positionAlign() to "Center" by way of GenericCueData. This 
causes VTTCue
to position the cue relative to the cue's center point, which is the same way 
AVFoundation
represents the cue's position.

* LayoutTests/media/content/test-inband-captions.mp4: Added.
* LayoutTests/media/track/track-in-band-layout-expected.txt: Added.
* LayoutTests/media/track/track-in-band-layout.html: Added.
* Source/WebCore/html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::updateCueFromCueData):
* Source/WebCore/html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
(WebCore::TextTrackCueGeneric::setBaseFontSizeRelativeToVideoHeight):
(WebCore::TextTrackCueGeneric::setFontSizeMultiplier):
(WebCore::TextTrackCueGeneric::setFontSize): Deleted.
* Source/WebCore/html/track/TextTrackCueGeneric.h:
* Source/WebCore/html/track/VTTCue.h:
(WebCore::VTTCueBox::setFontSizeFromCaptionUserPrefs): Deleted.
(WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const): Deleted.
* Source/WebCore/platform/graphics/InbandGenericCue.cpp:
(WebCore::InbandGenericCue::toJSONString const):
* Source/WebCore/platform/graphics/InbandGenericCue.h:
(WebCore::GenericCueData::GenericCueData):
(WebCore::InbandGenericCue::positionAlign const):
(WebCore::InbandGenericCue::setPositionAlign):
* Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to