Changeset 277874 in webkit


Ignore:
Timestamp:
May 21, 2021 12:04:39 PM (14 months ago)
Author:
pvollan@apple.com
Message:

Accessibility caption styles does not always reflect the selection
https://bugs.webkit.org/show_bug.cgi?id=226084
<rdar://75426845>

Reviewed by Chris Fleizach.

Source/WebCore:

Export a soft linked constant.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/cf/MediaAccessibilitySoftLink.cpp:

Source/WebKit:

This is caused by a race between pushing the caption preference value to the WebContent process and receiving the notification in that process.
This patch addresses this by reposting the notification after having set the preference value in the WebContent process.

  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::captionProfilePreferenceKey):
(WebKit::dispatchSimulatedNotificationsForPreferenceChange):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r277868 r277874  
     12021-05-21  Per Arne  <pvollan@apple.com>
     2
     3        Accessibility caption styles does not always reflect the selection
     4        https://bugs.webkit.org/show_bug.cgi?id=226084
     5        <rdar://75426845>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        Export a soft linked constant.
     10
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * platform/cf/MediaAccessibilitySoftLink.cpp:
     13
    1142021-05-21  Rob Buis  <rbuis@igalia.com>
    215
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r277830 r277874  
    19951995                5CA1DEC61F71F1C700E71BD3 /* HTTPHeaderField.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19961996                5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */; };
    1997                 5CBC8DAD1AAA302200E1C803 /* MediaAccessibilitySoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC8DAB1AAA302200E1C803 /* MediaAccessibilitySoftLink.h */; };
     1997                5CBC8DAD1AAA302200E1C803 /* MediaAccessibilitySoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC8DAB1AAA302200E1C803 /* MediaAccessibilitySoftLink.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19981998                5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D2386227A077C000B9BDA /* CustomHeaderFields.cpp */; };
    19991999                5CCC270922D5483A00964FA0 /* AutofillElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CCC270622D53B6800964FA0 /* AutofillElements.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    43124312                CD336F6717FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */; };
    43134313                CD336F6817FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */; };
     4314                CD36C1622607E78600C8C529 /* AudioSessionIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = CD36C1612607E78600C8C529 /* AudioSessionIOS.h */; };
    43144315                CD36C16B260A65CC00C8C529 /* SharedRoutingArbitrator.h in Headers */ = {isa = PBXBuildFile; fileRef = CD36C168260A63D300C8C529 /* SharedRoutingArbitrator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4315                 CD36C1622607E78600C8C529 /* AudioSessionIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = CD36C1612607E78600C8C529 /* AudioSessionIOS.h */; };
    43164316                CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495617A9D01B00274E42 /* MediaSource.h */; };
    43174317                CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495917A9D01B00274E42 /* SourceBuffer.h */; };
     
    1485814858                CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoTrackPrivateAVFObjC.cpp; sourceTree = "<group>"; };
    1485914859                CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivateAVFObjC.h; sourceTree = "<group>"; };
     14860                CD36C15F26067C1F00C8C529 /* AudioSessionMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionMac.h; sourceTree = "<group>"; };
     14861                CD36C1612607E78600C8C529 /* AudioSessionIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionIOS.h; sourceTree = "<group>"; };
    1486014862                CD36C168260A63D300C8C529 /* SharedRoutingArbitrator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedRoutingArbitrator.h; sourceTree = "<group>"; };
    1486114863                CD36C169260A63D400C8C529 /* SharedRoutingArbitrator.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SharedRoutingArbitrator.mm; sourceTree = "<group>"; };
    14862                 CD36C15F26067C1F00C8C529 /* AudioSessionMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionMac.h; sourceTree = "<group>"; };
    14863                 CD36C1612607E78600C8C529 /* AudioSessionIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionIOS.h; sourceTree = "<group>"; };
    1486414864                CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DiagnosticLoggingKeys.cpp; sourceTree = "<group>"; };
    1486514865                CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingKeys.h; sourceTree = "<group>"; };
  • trunk/Source/WebCore/platform/cf/MediaAccessibilitySoftLink.cpp

    r273214 r277874  
    5656SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, MediaAccessibility, MAAudibleMediaCopyPreferredCharacteristics, CFArrayRef, (), ());
    5757SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, MediaAccessibility, MACaptionAppearanceCopyFontDescriptorWithStrokeForStyle, CTFontDescriptorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior, MACaptionAppearanceFontStyle fontStyle, CFStringRef trackLanguage, CGFloat darwingPointSize, CGFloat *strokeWidthPt), (domain, behavior, fontStyle, trackLanguage, darwingPointSize, strokeWidthPt));
    58 SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaAccessibility, kMAXCaptionAppearanceSettingsChangedNotification, CFStringRef)
     58SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(WebCore, MediaAccessibility, kMAXCaptionAppearanceSettingsChangedNotification, CFStringRef, WEBCORE_EXPORT)
    5959SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE(WebCore, MediaAccessibility, kMAAudibleMediaSettingsChangedNotification, CFStringRef)
    6060SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, MediaAccessibility, MAImageCaptioningCopyCaptionWithSource, CFStringRef, (CGImageSourceRef imageSource, CFErrorRef *error), (imageSource, error))
  • trunk/Source/WebKit/ChangeLog

    r277873 r277874  
     12021-05-21  Per Arne  <pvollan@apple.com>
     2
     3        Accessibility caption styles does not always reflect the selection
     4        https://bugs.webkit.org/show_bug.cgi?id=226084
     5        <rdar://75426845>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        This is caused by a race between pushing the caption preference value to the WebContent process and receiving the notification in that process.
     10        This patch addresses this by reposting the notification after having set the preference value in the WebContent process.
     11
     12        * WebProcess/cocoa/WebProcessCocoa.mm:
     13        (WebKit::captionProfilePreferenceKey):
     14        (WebKit::dispatchSimulatedNotificationsForPreferenceChange):
     15
    1162021-05-21  Myles C. Maxfield  <mmaxfield@apple.com>
    217
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r277564 r277874  
    146146#endif
    147147
     148#import <WebCore/MediaAccessibilitySoftLink.h>
    148149#import <pal/cf/AudioToolboxSoftLink.h>
    149150#import <pal/cocoa/AVFoundationSoftLink.h>
     
    10741075#endif
    10751076
     1077static const WTF::String& captionProfilePreferenceKey()
     1078{
     1079    static NeverDestroyed<WTF::String> key(MAKE_STATIC_STRING_IMPL("MACaptionActiveProfile"));
     1080    return key;
     1081}
     1082
    10761083static void dispatchSimulatedNotificationsForPreferenceChange(const String& key)
    10771084{
     
    10951102    }
    10961103#endif
     1104    if (key == captionProfilePreferenceKey()) {
     1105        auto notificationCenter = CFNotificationCenterGetLocalCenter();
     1106        CFNotificationCenterPostNotification(notificationCenter, kMAXCaptionAppearanceSettingsChangedNotification, nullptr, nullptr, true);
     1107    }
    10971108}
    10981109
Note: See TracChangeset for help on using the changeset viewer.