haikuwebkit/Source/WebCore/html/shadow
Devin Rousso 1c5615ec80 [iOS] REGRESSION(r279720): changing Subtitles to Off doesn't hide them or do anything
https://bugs.webkit.org/show_bug.cgi?id=227937
<rdar://problem/79069662>

Reviewed by Eric Carlson.

r279720 made it so that `CaptionUserPreferencesMediaAF::setCaptionDisplayMode` no longer
directly modifies `kMACaptionAppearanceDomainUser` in the WebProcess, using a cached value
as a way of preventing the WebProcess from trying to read back that value after it's set,
instead having the UIProcess send `Messages::WebProcess::SetMediaAccessibilityPreferences`
whenever this changes to update that cached value. Unfortunately, because the WebProcess
needs to read this value immediately after changing it, this IPC round trip causes the
WebProcess to read the old value, which results in no observable changes. In order to fix
this, notify `CaptionUserPreferences` that `captionPreferencesChanged` when the above IPC
message is received (which will also handle cases when the value changes outside WebKit).

Source/WebCore:

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::sortedTrackListForMenu):
(WebCore::MediaControlsHost::displayNameForTrack):
(WebCore::MediaControlsHost::captionDisplayMode const):
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
* dom/Document.cpp:
(WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack):
(WebCore::HTMLMediaElement::configureTextTrackGroup):
(WebCore::HTMLMediaElement::setSelectedTextTrack):
(WebCore::HTMLMediaElement::captionPreferencesChanged):
(WebCore::HTMLMediaElement::captionDisplayMode):
(WebCore::HTMLMediaElement::mediaPlayerPreferredAudioCharacteristics const):
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
* page/PageGroup.h:
(WebCore::PageGroup::captionPreferences const): Added.
* page/PageGroup.cpp:
(WebCore::PageGroup::ensureCaptionPreferences): Added.
(WebCore::PageGroup::captionPreferences): Deleted.
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
(WebCore::PlaybackSessionModelMediaElement::audioMediaSelectionOptions const):
(WebCore::PlaybackSessionModelMediaElement::legibleMediaSelectionOptions const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setShouldDisplayTrackKind):
(WebCore::InternalSettings::shouldDisplayTrackKind):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::Internals):
(WebCore::Internals::userPreferredAudioCharacteristics const):
(WebCore::Internals::setUserPreferredAudioCharacteristic):
(WebCore::Internals::captionsStyleSheetOverride):
(WebCore::Internals::setCaptionsStyleSheetOverride):
(WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
(WebCore::Internals::setCaptionDisplayMode):
Rename `PageGroup::captionPreferences` to `PageGroup::ensureCaptionPreferences` so that it's
possible to get the `CaptionUserPreferences` without always creating it.

Source/WebKit:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::setMediaAccessibilityPreferences):
Make sure to also update every `CaptionUserPreferences` once the cached preference values
are saved so that any active media can update accordingly.


Canonical link: https://commits.webkit.org/239663@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-14 18:39:14 +00:00
..
AutoFillButtonElement.cpp
AutoFillButtonElement.h
DataListButtonElement.cpp
DataListButtonElement.h
DateTimeEditElement.cpp
DateTimeEditElement.h
DateTimeFieldElement.cpp Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
DateTimeFieldElement.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
DateTimeFieldElements.cpp
DateTimeFieldElements.h
DateTimeNumericFieldElement.cpp Next step toward using std::optional directly instead of through WTF::Optional typedef 2021-05-28 01:26:23 +00:00
DateTimeNumericFieldElement.h
DateTimeSymbolicFieldElement.cpp Add preliminary support for specifying a color space for 2D canvas 2021-05-05 16:36:55 +00:00
DateTimeSymbolicFieldElement.h
DetailsMarkerControl.cpp
DetailsMarkerControl.h
MediaControlTextTrackContainerElement.cpp [iOS] REGRESSION(r279720): changing Subtitles to Off doesn't hide them or do anything 2021-07-14 18:39:14 +00:00
MediaControlTextTrackContainerElement.h Reduce use of legacy EventLoopEventQueue and EventLoopTaskQueue 2021-06-06 19:13:07 +00:00
ProgressShadowElement.cpp
ProgressShadowElement.h
SliderThumbElement.cpp Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
SliderThumbElement.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
SpinButtonElement.cpp
SpinButtonElement.h
TextControlInnerElements.cpp Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
TextControlInnerElements.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
TextPlaceholderElement.cpp
TextPlaceholderElement.h
YouTubeEmbedShadowElement.cpp
YouTubeEmbedShadowElement.h
imageOverlay.css Live Text should not be visible in video thumbnail images behind "Skip Ad" button on YouTube 2021-07-06 00:56:02 +00:00
meterElementShadow.css