⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 269805 in webkit


Ignore:
Timestamp:
Nov 13, 2020, 4:02:18 PM (6 years ago)
Author:
weinig@apple.com
Message:

Move some more WebKit and WebKitLegacy preferences bound to Settings to WebPreferences.yaml
https://bugs.webkit.org/show_bug.cgi?id=218914

Reviewed by Tim Horton.

Source/WebCore:

Moves AppleMailPaginationQuirkEnabled, ContentDispositionAttachmentSandboxEnabled and
UseImageDocumentForSubframePDF from Settings.yaml to WebPreferences.yaml and merges in
WebCore values for ScrollingPerformanceLoggingEnabled.

  • page/Settings.yaml:

Source/WebKit:

  • Shared/WebPageCreationParameters.cpp:

(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):

  • Shared/WebPageCreationParameters.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::creationParameters):

  • UIProcess/WebPageProxy.h:
  • UIProcess/mac/WebPageProxyMac.mm:

(WebKit::WebPageProxy::appleMailPaginationQuirkEnabled): Deleted.
(WebKit::WebPageProxy::appleMailLinesClampEnabled): Deleted.
Removes appleMailPaginationQuirkEnabled and appleMailLinesClampEnabled.
appleMailPaginationQuirkEnabled is now handled via the preferences infrastructure
and appleMailLinesClampEnabled was unused.

  • Shared/WebPreferencesDefaultValues.cpp:

(WebKit::defaultAppleMailPaginationQuirkEnabled):

  • Shared/WebPreferencesDefaultValues.h:

Adds default value for AppleMailPaginationQuirkEnabled, which is now in WebPreferences.yaml.
Moved from WebPageProxyMac.mm

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):
Removes explicit setting of setAppleMailPaginationQuirkEnabled, setContentDispositionAttachmentSandboxEnabled,
setScrollingPerformanceLoggingEnabled and setUseImageDocumentForSubframePDF which are all generated now.
LayoutViewportHeightExpansionFactor was already generated so this call was just redundant.

  • WebProcess/WebPage/WebPage.h:

(WebKit::WebPage::setScrollingPerformanceLoggingEnabled): Deleted.
It's also no longer necessary to store m_scrollingPerformanceLoggingEnabled as the value
can be extracted directly from the store in the one place it was read. setScrollingPerformanceLoggingEnabled
was never called, so has been removed.

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
Extract scrollingPerformanceLoggingEnabled directly from the store rather than having the page
set it just for this one place to read it.

Source/WebKitLegacy/mac:

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):
Remove explicit setting of Settings::setContentDispositionAttachmentSandboxEnabled as
it is now handled by the generated code. Merge together a few sequential #ifdefs while
in the area.

Source/WTF:

Moves AppleMailPaginationQuirkEnabled, ContentDispositionAttachmentSandboxEnabled and
UseImageDocumentForSubframePDF from Settings.yaml to WebPreferences.yaml. Merges in
WebCore values from ScrollingPerformanceLoggingEnabled and removes binding override
since it can now be fully generated.

  • Scripts/Preferences/WebPreferences.yaml:
Location:
trunk/Source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r269801 r269805  
     12020-11-13  Sam Weinig  <weinig@apple.com>
     2
     3        Move some more WebKit and WebKitLegacy preferences bound to Settings to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218914
     5
     6        Reviewed by Tim Horton.
     7
     8        Moves AppleMailPaginationQuirkEnabled, ContentDispositionAttachmentSandboxEnabled and
     9        UseImageDocumentForSubframePDF from Settings.yaml to WebPreferences.yaml. Merges in
     10        WebCore values from ScrollingPerformanceLoggingEnabled and removes binding override
     11        since it can now be fully generated.
     12
     13        * Scripts/Preferences/WebPreferences.yaml:
     14
    1152020-11-13  Xan López  <xan@igalia.com>
    216
  • trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml

    r269785 r269805  
    253253      default: true
    254254
     255AppleMailPaginationQuirkEnabled:
     256  type: bool
     257  defaultValue:
     258    WebKitLegacy:
     259      default: false
     260    WebKit:
     261      PLATFORM(MAC): WebKit::defaultAppleMailPaginationQuirkEnabled()
     262      default: false
     263    WebCore:
     264      default: false
     265
    255266# FIXME: Is this implemented for WebKitLegacy? If not, this should be excluded from WebKitLegacy entirely (though we should still set the default value to false when initializing settings).
    256267ApplePayCapabilityDisclosureAllowed:
     
    436447    WebCore:
    437448      "PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)": true
     449      default: false
     450
     451ContentDispositionAttachmentSandboxEnabled:
     452  comment: 'Some ports (e.g. iOS) might choose to display attachments inline, regardless
     453    of whether the response includes the HTTP header \"Content-Disposition: attachment\".
     454    This setting enables a sandbox around these attachments. The sandbox enforces
     455    all frame sandbox flags (see enum SandboxFlag in SecurityContext.h), and also
     456    disables <meta http-equiv> processing and subframe loading.'
     457  type: bool
     458  defaultValue:
     459    WebKitLegacy:
     460      default: true
     461    WebKit:
     462      PLATFORM(COCOA): true
     463      default: false
     464    WebCore:
    438465      default: false
    439466
     
    18241851  type: bool
    18251852  webcoreOnChange: scrollingPerformanceLoggingEnabledChanged
    1826   webcoreBinding: custom
    1827   defaultValue:
    1828     WebKitLegacy:
    1829       default: false
    1830     WebKit:
     1853  defaultValue:
     1854    WebKitLegacy:
     1855      default: false
     1856    WebKit:
     1857      default: false
     1858    WebCore:
    18311859      default: false
    18321860
     
    22792307      default: false
    22802308
     2309UseImageDocumentForSubframePDF:
     2310  type: bool
     2311  defaultValue:
     2312    WebKitLegacy:
     2313      PLATFORM(IOS_FAMILY): true
     2314      default: false
     2315    WebKit:
     2316      PLATFORM(IOS_FAMILY): true
     2317      default: false
     2318    WebCore:
     2319      PLATFORM(IOS_FAMILY): true
     2320      default: false
     2321
    22812322UseLegacyBackgroundSizeShorthandBehavior:
    22822323  type: bool
  • trunk/Source/WebCore/ChangeLog

    r269803 r269805  
     12020-11-13  Sam Weinig  <weinig@apple.com>
     2
     3        Move some more WebKit and WebKitLegacy preferences bound to Settings to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218914
     5
     6        Reviewed by Tim Horton.
     7
     8        Moves AppleMailPaginationQuirkEnabled, ContentDispositionAttachmentSandboxEnabled and
     9        UseImageDocumentForSubframePDF from Settings.yaml to WebPreferences.yaml and merges in
     10        WebCore values for ScrollingPerformanceLoggingEnabled.
     11
     12        * page/Settings.yaml:
     13
    1142020-11-13  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/page/Settings.yaml

    r269785 r269805  
    4242      default: false
    4343
    44 AppleMailPaginationQuirkEnabled:
    45   type: bool
    46   defaultValue:
    47     WebCore:
    48       default: false
    49 
    5044AudioPlaybackRequiresUserGesture:
    5145  type: bool
     
    8882    WebCore:
    8983      default: ClipboardAccessPolicy::RequiresUserGesture
    90 
    91 ContentDispositionAttachmentSandboxEnabled:
    92   comment: >-
    93     Some ports (e.g. iOS) might choose to display attachments inline, regardless of whether the
    94     response includes the HTTP header \"Content-Disposition: attachment\". This setting enables
    95     a sandbox around these attachments. The sandbox enforces all frame sandbox flags (see enum
    96     SandboxFlag in SecurityContext.h), and also disables <meta http-equiv> processing and subframe
    97     loading.
    98   type: bool
    99   defaultValue:
    100     WebCore:
    101       default: false
    10284
    10385CrossOriginCheckInGetMatchedCSSRulesDisabled:
     
    460442      default: false
    461443
    462 ScrollingPerformanceLoggingEnabled:
    463   type: bool
    464   webcoreOnChange: scrollingPerformanceLoggingEnabledChanged
    465   defaultValue:
    466     WebCore:
    467       default: false
    468 
    469444ScrollingTreeIncludesFrames:
    470445  type: bool
     
    590565    WebCore:
    591566      default: true
    592 
    593 UseImageDocumentForSubframePDF:
    594   type: bool
    595   defaultValue:
    596     WebCore:
    597       default: false
    598567
    599568UserInterfaceDirectionPolicy:
  • trunk/Source/WebKit/ChangeLog

    r269802 r269805  
     12020-11-13  Sam Weinig  <weinig@apple.com>
     2
     3        Move some more WebKit and WebKitLegacy preferences bound to Settings to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218914
     5
     6        Reviewed by Tim Horton.
     7
     8        * Shared/WebPageCreationParameters.cpp:
     9        (WebKit::WebPageCreationParameters::encode const):
     10        (WebKit::WebPageCreationParameters::decode):
     11        * Shared/WebPageCreationParameters.h:
     12        * UIProcess/WebPageProxy.cpp:
     13        (WebKit::WebPageProxy::creationParameters):
     14        * UIProcess/WebPageProxy.h:
     15        * UIProcess/mac/WebPageProxyMac.mm:
     16        (WebKit::WebPageProxy::appleMailPaginationQuirkEnabled): Deleted.
     17        (WebKit::WebPageProxy::appleMailLinesClampEnabled): Deleted.
     18        Removes appleMailPaginationQuirkEnabled and appleMailLinesClampEnabled.
     19        appleMailPaginationQuirkEnabled is now handled via the preferences infrastructure
     20        and appleMailLinesClampEnabled was unused.
     21
     22        * Shared/WebPreferencesDefaultValues.cpp:
     23        (WebKit::defaultAppleMailPaginationQuirkEnabled):
     24        * Shared/WebPreferencesDefaultValues.h:
     25        Adds default value for AppleMailPaginationQuirkEnabled, which is now in WebPreferences.yaml.
     26        Moved from WebPageProxyMac.mm
     27
     28        * WebProcess/WebPage/WebPage.cpp:
     29        (WebKit::WebPage::updatePreferences):
     30        Removes explicit setting of setAppleMailPaginationQuirkEnabled, setContentDispositionAttachmentSandboxEnabled,
     31        setScrollingPerformanceLoggingEnabled and setUseImageDocumentForSubframePDF which are all generated now.
     32        LayoutViewportHeightExpansionFactor was already generated so this call was just redundant.
     33
     34        * WebProcess/WebPage/WebPage.h:
     35        (WebKit::WebPage::setScrollingPerformanceLoggingEnabled): Deleted.
     36        It's also no longer necessary to store m_scrollingPerformanceLoggingEnabled as the value
     37        can be extracted directly from the store in the one place it was read. setScrollingPerformanceLoggingEnabled
     38        was never called, so has been removed.
     39
     40        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     41        (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
     42        Extract scrollingPerformanceLoggingEnabled directly from the store rather than having the page
     43        set it just for this one place to read it.
     44
    1452020-11-13  Geoffrey Garen  <ggaren@apple.com>
    246
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r269647 r269805  
    128128    encoder << nativeWindowHandle;
    129129#endif
    130     encoder << appleMailPaginationQuirkEnabled;
    131     encoder << appleMailLinesClampEnabled;
    132130    encoder << shouldScaleViewToFitDocument;
    133131    encoder << userInterfaceLayoutDirection;
     
    397395#endif
    398396
    399     if (!decoder.decode(parameters.appleMailPaginationQuirkEnabled))
    400         return WTF::nullopt;
    401 
    402     if (!decoder.decode(parameters.appleMailLinesClampEnabled))
    403         return WTF::nullopt;
    404 
    405397    if (!decoder.decode(parameters.shouldScaleViewToFitDocument))
    406398        return WTF::nullopt;
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.h

    r269647 r269805  
    187187    uint64_t nativeWindowHandle;
    188188#endif
    189     bool appleMailPaginationQuirkEnabled;
    190     bool appleMailLinesClampEnabled;
    191189    bool shouldScaleViewToFitDocument;
    192190
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp

    r269780 r269805  
    8383#endif
    8484
     85#if PLATFORM(MAC)
     86
     87bool defaultAppleMailPaginationQuirkEnabled()
     88{
     89    return WebCore::MacApplication::isAppleMail();
     90}
     91
     92#endif
    8593
    8694static bool defaultAsyncFrameAndOverflowScrollingEnabled()
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h

    r269780 r269805  
    5656#endif
    5757
     58#if PLATFORM(MAC)
     59bool defaultAppleMailPaginationQuirkEnabled();
     60#endif
     61
    5862#if !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS)
    5963bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload();
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r269802 r269805  
    78387838#endif
    78397839
    7840 #if PLATFORM(MAC)
    7841     parameters.appleMailPaginationQuirkEnabled = appleMailPaginationQuirkEnabled();
    7842 #else
    7843     parameters.appleMailPaginationQuirkEnabled = false;
    7844 #endif
    7845    
    7846 #if PLATFORM(MAC)
    7847     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
    7848     parameters.appleMailLinesClampEnabled = appleMailLinesClampEnabled();
    7849 #else
    7850     parameters.appleMailLinesClampEnabled = false;
    7851 #endif
    7852 
    78537840#if PLATFORM(COCOA)
    78547841    parameters.smartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r269802 r269805  
    21042104#endif
    21052105
    2106 #if PLATFORM(MAC)
    2107     bool appleMailPaginationQuirkEnabled();
    2108 #endif
    2109 
    2110 #if PLATFORM(MAC)
    2111     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
    2112     bool appleMailLinesClampEnabled();
    2113 #endif
    2114 
    21152106    // Spelling and grammar.
    21162107    void checkSpellingOfString(const String& text, CompletionHandler<void(int32_t misspellingLocation, int32_t misspellingLength)>&&);
  • trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm

    r267305 r269805  
    592592}
    593593
    594 bool WebPageProxy::appleMailPaginationQuirkEnabled()
    595 {
    596     return MacApplication::isAppleMail();
    597 }
    598 
    599 bool WebPageProxy::appleMailLinesClampEnabled()
    600 {
    601     return MacApplication::isAppleMail();
    602 }
    603 
    604594void WebPageProxy::updateEditorState(const EditorState& editorState)
    605595{
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r269785 r269805  
    725725        m_page->settings().setMediaKeysStorageDirectory(manager->mediaKeyStorageDirectory());
    726726#endif
    727     m_page->settings().setAppleMailPaginationQuirkEnabled(parameters.appleMailPaginationQuirkEnabled);
    728727   
    729728    if (parameters.viewScaleFactor != 1)
     
    733732
    734733#if PLATFORM(COCOA)
    735     m_page->settings().setContentDispositionAttachmentSandboxEnabled(true);
    736734    setSmartInsertDeleteEnabled(parameters.smartInsertDeleteEnabled);
    737735    WebCore::setAdditionalSupportedImageTypes(parameters.additionalSupportedImageTypes);
     
    37513749    m_artificialPluginInitializationDelayEnabled = store.getBoolValueForKey(WebPreferencesKey::artificialPluginInitializationDelayEnabledKey());
    37523750
    3753     m_scrollingPerformanceLoggingEnabled = store.getBoolValueForKey(WebPreferencesKey::scrollingPerformanceLoggingEnabledKey());
    3754     settings.setScrollingPerformanceLoggingEnabled(m_scrollingPerformanceLoggingEnabled);
    3755 
    37563751    bool isAppNapEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
    37573752    if (m_isAppNapEnabled != isAppNapEnabled) {
     
    37693764#if PLATFORM(IOS_FAMILY)
    37703765    setForceAlwaysUserScalable(m_forceAlwaysUserScalable || store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey()));
    3771 
    3772     settings.setUseImageDocumentForSubframePDF(true);
    37733766#if HAVE(AVKIT)
    37743767    DeprecatedGlobalSettings::setAVKitEnabled(true);
     
    37913784    }
    37923785#endif
    3793 
    3794     settings.setLayoutViewportHeightExpansionFactor(store.getDoubleValueForKey(WebPreferencesKey::layoutViewportHeightExpansionFactorKey()));
    37953786
    37963787#if ENABLE(APP_BOUND_DOMAINS)
     
    53895380}
    53905381
    5391 void WebPage::setScrollingPerformanceLoggingEnabled(bool enabled)
    5392 {
    5393     m_scrollingPerformanceLoggingEnabled = enabled;
    5394 
    5395     FrameView* frameView = m_mainFrame->coreFrame()->view();
    5396     if (!frameView)
    5397         return;
    5398 
    5399     frameView->setScrollingPerformanceLoggingEnabled(enabled);
    5400 }
    5401 
    54025382bool WebPage::canPluginHandleResponse(const ResourceResponse& response)
    54035383{
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r269785 r269805  
    10751075    void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
    10761076
    1077     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
    1078     void setScrollingPerformanceLoggingEnabled(bool);
    1079 
    10801077#if PLATFORM(COCOA)
    10811078    bool shouldUsePDFPlugin() const;
     
    18141811    bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
    18151812    bool m_artificialPluginInitializationDelayEnabled { false };
    1816     bool m_scrollingPerformanceLoggingEnabled { false };
    18171813    bool m_mainFrameIsScrollable { true };
    18181814
  • trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r268014 r269805  
    3939#import "WebPageCreationParameters.h"
    4040#import "WebPageProxyMessages.h"
     41#import "WebPreferencesKeys.h"
     42#import "WebPreferencesStore.h"
    4143#import "WebProcess.h"
    4244#import <pal/spi/cocoa/QuartzCoreSPI.h>
     
    214216}
    215217
    216 void TiledCoreAnimationDrawingArea::updatePreferences(const WebPreferencesStore&)
     218void TiledCoreAnimationDrawingArea::updatePreferences(const WebPreferencesStore& store)
    217219{
    218220    Settings& settings = m_webPage.corePage()->settings();
     
    220222#if ENABLE(ASYNC_SCROLLING)
    221223    if (AsyncScrollingCoordinator* scrollingCoordinator = downcast<AsyncScrollingCoordinator>(m_webPage.corePage()->scrollingCoordinator())) {
    222         bool scrollingPerformanceLoggingEnabled = m_webPage.scrollingPerformanceLoggingEnabled();
     224        bool scrollingPerformanceLoggingEnabled = store.getBoolValueForKey(WebPreferencesKey::scrollingPerformanceLoggingEnabledKey());
    223225       
    224226        RefPtr<ScrollingTree> scrollingTree = scrollingCoordinator->scrollingTree();
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r269785 r269805  
     12020-11-13  Sam Weinig  <weinig@apple.com>
     2
     3        Move some more WebKit and WebKitLegacy preferences bound to Settings to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218914
     5
     6        Reviewed by Tim Horton.
     7
     8        * WebView/WebView.mm:
     9        (-[WebView _commonInitializationWithFrameName:groupName:]):
     10        Remove explicit setting of Settings::setContentDispositionAttachmentSandboxEnabled as
     11        it is now handled by the generated code. Merge together a few sequential #ifdefs while
     12        in the area.
     13
    1142020-11-12  Darin Adler  <darin@apple.com>
    215
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r269760 r269805  
    16541654    WebInstallMemoryPressureHandler();
    16551655
    1656 #if !PLATFORM(IOS_FAMILY)
     1656#if PLATFORM(MAC)
    16571657    if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION)) {
    16581658        // Originally, we allowed all local loads.
     
    16631663        WebCore::SecurityPolicy::setLocalLoadPolicy(WebCore::SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
    16641664    }
    1665 #endif
    1666 
    1667 #if PLATFORM(MAC)
     1665
    16681666    if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS))
    16691667        WebCore::ResourceHandle::forceContentSniffing();
    16701668
    16711669    _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
    1672 #endif
    1673 
    1674 #if HAVE(OS_DARK_MODE_SUPPORT) && PLATFORM(MAC)
     1670
     1671#if HAVE(OS_DARK_MODE_SUPPORT)
    16751672    _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveUserInterfaceLevelIsElevated);
    16761673#endif
    16771674
    1678     _private->page->settings().setContentDispositionAttachmentSandboxEnabled(true);
    1679 
    1680 #if PLATFORM(MAC)
    16811675    [WebViewVisualIdentificationOverlay installForWebViewIfNeeded:self kind:@"WebView" deprecated:YES];
    16821676#endif
Note: See TracChangeset for help on using the changeset viewer.