Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a49bc829b01fb9a65b70bbb70cef5dcc7d287bcd
      
https://github.com/WebKit/WebKit/commit/a49bc829b01fb9a65b70bbb70cef5dcc7d287bcd
  Author: Ada Chan <[email protected]>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/media/caption-mirroring-quirk-external-playback-expected.txt
    A LayoutTests/media/caption-mirroring-quirk-external-playback.html
    A LayoutTests/media/caption-mirroring-quirk-unrelated-host-expected.txt
    A LayoutTests/media/caption-mirroring-quirk-unrelated-host.html
    M LayoutTests/platform/visionos/TestExpectations
    M Source/WebCore/Modules/modern-media-controls/media/CNNCaptionQuirk.js
    M Source/WebCore/Modules/modern-media-controls/media/YouTubeCaptionQuirk.js
    M Source/WebCore/dom/EventNames.json
    M Source/WebCore/html/HTMLVideoElement.cpp
    M Source/WebCore/html/HTMLVideoElement.h
    M Source/WebCore/html/HTMLVideoElement.idl
    M Source/WebCore/page/Quirks.cpp
    M Source/WebCore/page/Quirks.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  Caption mirroring quirk does not activate when a video enters external 
playback
https://bugs.webkit.org/show_bug.cgi?id=322762
rdar://178344691

Reviewed by Andy Estes.

The caption mirroring quirks work by scraping a site’s in-page captions to add 
to
a “forced” text track so WebKit can render it in out-of-page presentations. This
already works with fullscreen and pip. We need to get this working for the 
external
playback case as well. To fix that, we expose the “is in external playback” 
state in
HTMLVideoElement that is quirk-gated, plus a “webkitexternalplaybackchanged”
event dispatched only when Quirks::needsCaptionMirroringQuirk() is set. Then we
can fix the YouTube and CNN caption quirks to use them to set up the caption
mirroring for the external playback case, similar to the presentation mode case.

Tests: media/caption-mirroring-quirk-external-playback.html
       media/caption-mirroring-quirk-unrelated-host.html

* LayoutTests/TestExpectations:
* LayoutTests/media/caption-mirroring-quirk-external-playback-expected.txt: 
Added.
* LayoutTests/media/caption-mirroring-quirk-external-playback.html: Added.
* LayoutTests/media/caption-mirroring-quirk-unrelated-host-expected.txt: Added.
* LayoutTests/media/caption-mirroring-quirk-unrelated-host.html: Added.
* LayoutTests/platform/visionos/TestExpectations:
* Source/WebCore/Modules/modern-media-controls/media/CNNCaptionQuirk.js:
(CaptionMirror):
(CaptionMirror.prototype.invalidate):
(CaptionMirror.prototype._getIsInline):
(CaptionMirror.prototype._handlePresentationModeChanged):
* Source/WebCore/Modules/modern-media-controls/media/YouTubeCaptionQuirk.js:
(CaptionMirror):
(CaptionMirror.prototype.invalidate):
(CaptionMirror.prototype._getIsInline):
* Source/WebCore/dom/EventNames.json:
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::scheduleExternalPlaybackChangedEventIfNeeded):
(WebCore::HTMLVideoElement::didEnterExternalPlayback):
(WebCore::HTMLVideoElement::didExitExternalPlayback):
* Source/WebCore/html/HTMLVideoElement.h:
* Source/WebCore/html/HTMLVideoElement.idl:
* Source/WebCore/page/Quirks.cpp:
* Source/WebCore/page/Quirks.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setVideoInExternalPlayback):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

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



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

Reply via email to