Skip to content

Commit

Permalink
Cherry-pick 6ce6126. rdar://123848733
Browse files Browse the repository at this point in the history
    [Lockdown Mode] Lockdown Mode Safe Font feature flag gets stuck, cannot be enabled in some cases

    https://bugs.webkit.org/show_bug.cgi?id=270307
    rdar://123848733

    Reviewed by Brent Fulgham.

    Due to a logic error, when the Lockdown Mode Safe Font feature flag goes to
    `DownloadableBinaryFontTrustedTypes::Restricted` or `...::FallbackParser`, it
    gets stuck in that state and can't progress to the other. This makes the
    "Lockdown Mode Safe Font" setting toggle ineffective.

    This change addresses the issue by allowing state transitions from any
    `DownloadableBinaryFontTrustedTypes` state except `...::None`.

    * Source/WebKit/WebProcess/WebPage/WebPage.cpp:
    (WebKit::adjustSettingsForLockdownMode):

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

Canonical link: https://commits.webkit.org/274941.64@safari-7619.1.5-branch
  • Loading branch information
apple-fcloutier authored and Dan Robson committed Mar 3, 2024
1 parent ffebbc3 commit 1ceb04c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4511,17 +4511,11 @@ static void adjustSettingsForLockdownMode(Settings& settings, const WebPreferenc
#if ENABLE(WEB_AUDIO)
settings.setWebAudioEnabled(false);
#endif
switch (settings.downloadableBinaryFontTrustedTypes()) {
case DownloadableBinaryFontTrustedTypes::Any:
if (settings.downloadableBinaryFontTrustedTypes() != DownloadableBinaryFontTrustedTypes::None) {
settings.setDownloadableBinaryFontTrustedTypes(
settings.lockdownFontParserEnabled()
? DownloadableBinaryFontTrustedTypes::FallbackParser
: DownloadableBinaryFontTrustedTypes::Restricted);
break;
case DownloadableBinaryFontTrustedTypes::FallbackParser:
case DownloadableBinaryFontTrustedTypes::Restricted:
case DownloadableBinaryFontTrustedTypes::None:
break;
}
#if ENABLE(WEB_CODECS)
settings.setWebCodecsVideoEnabled(false);
Expand Down

0 comments on commit 1ceb04c

Please sign in to comment.