Changeset 269760 in webkit


Ignore:
Timestamp:
Nov 12, 2020 4:20:43 PM (3 years ago)
Author:
weinig@apple.com
Message:

Move more WebKitLegacy specific settings usage to WebPreferences.yaml
https://bugs.webkit.org/show_bug.cgi?id=218852

Reviewed by Tim Horton.

Source/WebCore:

This batch focuses on settings with defaults based on SDK/host app conditions.

  • page/Settings.yaml:

Source/WebKitLegacy/mac:

This batch focuses on settings with defaults based on SDK/host app conditions.

  • WebView/WebPreferences.mm:

(+[WebPreferences initialize]):

  • WebView/WebPreferencesDefaultValues.h:
  • WebView/WebPreferencesDefaultValues.mm:

(WebKit::defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol):
(WebKit::defaultLoadDeferringEnabled):
(WebKit::defaultWindowFocusRestricted):
(WebKit::defaultUsePreHTML5ParserQuirks):
(WebKit::defaultNeedsAdobeFrameReloadingQuirk):
(WebKit::defaultTreatsAnyTextCSSLinkAsStylesheet):
(WebKit::defaultNeedsFrameNameFallbackToIdQuirk):
(WebKit::defaultNeedsKeyboardEventDisambiguationQuirks):
(WebKit::defaultEnforceCSSMIMETypeInNoQuirksMode):
(WebKit::defaultNeedsIsLoadingInAPISenseQuirk):
(WebKit::defaultUseLegacyBackgroundSizeShorthandBehavior):
(WebKit::defaultAllowDisplayOfInsecureContent):
(WebKit::defaultAllowRunningOfInsecureContent):
(WebKit::defaultShouldConvertInvalidURLsToBlank):

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):
(needsSelfRetainWhileLoadingQuirk):
(-[WebView _preferencesChanged:]):
(-[WebView dealloc]):
(-[WebView setFrameLoadDelegate:]):
(shouldEnableLoadDeferring): Deleted.
(shouldRestrictWindowFocus): Deleted.
(shouldUseLegacyBackgroundSizeShorthandBehavior): Deleted.
(shouldAllowDisplayAndRunningOfInsecureContent): Deleted.
(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol): Deleted.
(shouldConvertInvalidURLsToBlank): Deleted.
(-[WebView _needsAdobeFrameReloadingQuirk]): Deleted.
(-[WebView _needsLinkElementTextCSSQuirk]): Deleted.
(-[WebView _needsFrameNameFallbackToIdQuirk]): Deleted.
(-[WebView _needsIsLoadingInAPISenseQuirk]): Deleted.
(-[WebView _needsKeyboardEventDisambiguationQuirks]): Deleted.
(-[WebView _needsPreHTML5ParserQuirks]): Deleted.

Source/WTF:

This batch focuses on settings with defaults based on SDK/host app conditions.

  • Scripts/Preferences/WebPreferences.yaml:

Tools:

  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetWebPreferencesToConsistentValues):
Remove unnecessary call of [WebPreferences setUsePreHTML5ParserQuirks:NO] as this is the default.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r269757 r269760  
     12020-11-12  Sam Weinig  <weinig@apple.com>
     2
     3        Move more WebKitLegacy specific settings usage to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218852
     5
     6        Reviewed by Tim Horton.
     7
     8        This batch focuses on settings with defaults based on SDK/host app conditions.
     9
     10        * Scripts/Preferences/WebPreferences.yaml:
     11
    1122020-11-12  Devin Rousso  <drousso@apple.com>
    213
  • trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml

    r269713 r269760  
    7878      default: false
    7979
     80AllowContentSecurityPolicySourceStarToMatchAnyProtocol:
     81  type: bool
     82  defaultValue:
     83    WebKitLegacy:
     84      PLATFORM(IOS_FAMILY): WebKit::defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol()
     85      default: false
     86    WebKit:
     87      default: false
     88    WebCore:
     89      default: false
     90
    8091AllowCrossOriginSubresourcesToAskForCredentials:
    8192  type: bool
     
    8394    WebKitLegacy:
    8495      default: false
     96    WebKit:
     97      default: false
     98    WebCore:
     99      default: false
     100
     101AllowDisplayOfInsecureContent:
     102  type: bool
     103  defaultValue:
     104    WebKitLegacy:
     105      default: WebKit::defaultAllowDisplayOfInsecureContent()
    85106    WebKit:
    86107      default: false
     
    117138    WebKitLegacy:
    118139      default: false
     140    WebKit:
     141      default: false
     142    WebCore:
     143      default: false
     144
     145AllowRunningOfInsecureContent:
     146  type: bool
     147  defaultValue:
     148    WebKitLegacy:
     149      default: WebKit::defaultAllowRunningOfInsecureContent()
    119150    WebKit:
    120151      default: false
     
    681712    WebCore:
    682713      default: false
     714
     715EnforceCSSMIMETypeInNoQuirksMode:
     716  type: bool
     717  defaultValue:
     718    WebKitLegacy:
     719      PLATFORM(MAC): WebKit::defaultEnforceCSSMIMETypeInNoQuirksMode()
     720      default: true
     721    WebKit:
     722      default: true
     723    WebCore:
     724      default: true
    683725
    684726EnumeratingAllNetworkInterfacesEnabled:
     
    11831225      default: true
    11841226
     1227LoadDeferringEnabled:
     1228  type: bool
     1229  defaultValue:
     1230    WebKitLegacy:
     1231      PLATFORM(MAC): WebKit::defaultLoadDeferringEnabled()
     1232      default: true
     1233    WebKit:
     1234      default: true
     1235    WebCore:
     1236      default: true
     1237
    11851238# This only suppresses the network load of the image URL. A cached image will still be rendered if requested.
    11861239LoadsImagesAutomatically:
     
    14621515      default: false
    14631516
     1517NeedsAdobeFrameReloadingQuirk:
     1518  comment: 'FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need
     1519    to phase it out once Adobe can fix the bug from their end.'
     1520  type: bool
     1521  webcoreGetter: needsAcrobatFrameReloadingQuirk
     1522  defaultValue:
     1523    WebKitLegacy:
     1524      PLATFORM(MAC): WebKit::defaultNeedsAdobeFrameReloadingQuirk()
     1525      default: false
     1526    WebKit:
     1527      default: false
     1528    WebCore:
     1529      default: false
     1530
     1531NeedsFrameNameFallbackToIdQuirk:
     1532  type: bool
     1533  defaultValue:
     1534    WebKitLegacy:
     1535      PLATFORM(MAC): WebKit::defaultNeedsFrameNameFallbackToIdQuirk()
     1536      default: false
     1537    WebKit:
     1538      default: false
     1539    WebCore:
     1540      default: false
     1541
     1542NeedsIsLoadingInAPISenseQuirk:
     1543  comment: Some apps needs isLoadingInAPISense to account for active subresource loaders.
     1544  type: bool
     1545  defaultValue:
     1546    WebKitLegacy:
     1547      PLATFORM(MAC): WebKit::defaultNeedsIsLoadingInAPISenseQuirk()
     1548      default: false
     1549    WebKit:
     1550      default: false
     1551    WebCore:
     1552      default: false
     1553
     1554NeedsKeyboardEventDisambiguationQuirks:
     1555  comment: This is a quirk we are pro-actively applying to old applications. It changes
     1556    keyboard event dispatching, making keyIdentifier available on keypress events,
     1557    making charCode available on keydown/keyup events, and getting keypress dispatched
     1558    in more cases.
     1559  type: bool
     1560  defaultValue:
     1561    WebKitLegacy:
     1562      PLATFORM(MAC): WebKit::defaultNeedsKeyboardEventDisambiguationQuirks()
     1563      default: false
     1564    WebKit:
     1565      default: false
     1566    WebCore:
     1567      default: false
     1568
    14641569NeedsSiteSpecificQuirks:
    14651570  type: bool
     
    18201925      default: true
    18211926
     1927ShouldConvertInvalidURLsToBlank:
     1928  type: bool
     1929  defaultValue:
     1930    WebKitLegacy:
     1931      default: WebKit::defaultShouldConvertInvalidURLsToBlank()
     1932    WebKit:
     1933      default: true
     1934    WebCore:
     1935      default: true
     1936
    18221937ShouldConvertPositionStyleOnCopy:
    18231938  type: bool
     
    21832298      default: true
    21842299
     2300TreatsAnyTextCSSLinkAsStylesheet:
     2301  type: bool
     2302  defaultValue:
     2303    WebKitLegacy:
     2304      PLATFORM(MAC): WebKit::defaultTreatsAnyTextCSSLinkAsStylesheet()
     2305      default: false
     2306    WebKit:
     2307      default: false
     2308    WebCore:
     2309      default: false
     2310
    21852311UseGiantTiles:
    21862312  type: bool
     
    21932319      default: false
    21942320
     2321UseLegacyBackgroundSizeShorthandBehavior:
     2322  type: bool
     2323  defaultValue:
     2324    WebKitLegacy:
     2325      default: WebKit::defaultUseLegacyBackgroundSizeShorthandBehavior()
     2326    WebKit:
     2327      default: false
     2328    WebCore:
     2329      default: false
     2330
    21952331UseLegacyTextAlignPositionedElementBehavior:
    21962332  type: bool
    21972333  defaultValue:
    21982334    WebKitLegacy:
     2335      default: false
     2336    WebKit:
     2337      default: false
     2338    WebCore:
     2339      default: false
     2340
     2341UsePreHTML5ParserQuirks:
     2342  type: bool
     2343  defaultValue:
     2344    WebKitLegacy:
     2345      PLATFORM(MAC): WebKit::defaultUsePreHTML5ParserQuirks()
    21992346      default: false
    22002347    WebKit:
     
    23482495      default: false
    23492496
     2497WindowFocusRestricted:
     2498  comment: When enabled, window.blur() does not change focus, and window.focus() only
     2499    changes focus when invoked from the context that created the window.
     2500  type: bool
     2501  defaultValue:
     2502    WebKitLegacy:
     2503      PLATFORM(MAC): WebKit::defaultWindowFocusRestricted()
     2504      default: true
     2505    WebKit:
     2506      default: true
     2507    WebCore:
     2508      default: true
     2509
    23502510XSSAuditorEnabled:
    23512511  type: bool
  • trunk/Source/WebCore/ChangeLog

    r269753 r269760  
     12020-11-12  Sam Weinig  <weinig@apple.com>
     2
     3        Move more WebKitLegacy specific settings usage to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218852
     5
     6        Reviewed by Tim Horton.
     7
     8        This batch focuses on settings with defaults based on SDK/host app conditions.
     9
     10        * page/Settings.yaml:
     11
    1122020-11-12  Said Abou-Hallawa  <said@apple.com>
    213
  • trunk/Source/WebCore/page/Settings.yaml

    r269713 r269760  
    3636      default: false
    3737
    38 AllowContentSecurityPolicySourceStarToMatchAnyProtocol:
    39   type: bool
    40   defaultValue:
    41     WebCore:
    42       default: false
    43 
    44 AllowDisplayOfInsecureContent:
    45   type: bool
    46   defaultValue:
    47     WebCore:
    48       default: false
    49 
    50 AllowRunningOfInsecureContent:
    51   type: bool
    52   defaultValue:
    53     WebCore:
    54       default: false
    55 
    5638AnimatedImageDebugCanvasDrawingEnabled:
    5739  type: bool
     
    175157      default: EditingMacBehavior
    176158
    177 EnforceCSSMIMETypeInNoQuirksMode:
    178   type: bool
    179   defaultValue:
    180     WebCore:
    181       default: true
    182 
    183159FixedBackgroundsPaintRelativeToDocument:
    184160  type: bool
     
    355331    WebCore:
    356332      default: false
    357 
    358 LoadDeferringEnabled:
    359   type: bool
    360   defaultValue:
    361     WebCore:
    362       default: true
    363333
    364334LocalStorageDatabasePath:
     
    431401      default: 257*256
    432402
    433 NeedsAdobeFrameReloadingQuirk:
    434   comment: >-
    435     FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it
    436     out once Adobe can fix the bug from their end.
    437   type: bool
    438   webcoreGetter: needsAcrobatFrameReloadingQuirk
    439   defaultValue:
    440     WebCore:
    441       default: false
    442 
    443403NeedsDeferKeyDownAndKeyPressTimersUntilNextEditingCommandQuirk:
    444404  comment: >-
     
    454414      default: false
    455415
    456 NeedsFrameNameFallbackToIdQuirk:
    457   type: bool
    458   defaultValue:
    459     WebCore:
    460       default: false
    461 
    462 NeedsIsLoadingInAPISenseQuirk:
    463   comment: >-
    464     Some apps needs isLoadingInAPISense to account for active subresource loaders.
    465   type: bool
    466   defaultValue:
    467     WebCore:
    468       default: false
    469 
    470 NeedsKeyboardEventDisambiguationQuirks:
    471   comment: >-
    472     This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
    473     making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
    474     and getting keypress dispatched in more cases.
    475   type: bool
    476   defaultValue:
    477     WebCore:
    478       default: false
    479 
    480416ParserScriptingFlagPolicy:
    481417  type: uint32_t
     
    552488    WebCore:
    553489      default: StorageMap::noQuota
    554 
    555 ShouldConvertInvalidURLsToBlank:
    556   type: bool
    557   defaultValue:
    558     WebCore:
    559       default: true
    560490
    561491ShouldDispatchSyntheticMouseEventsWhenModifyingSelection:
     
    648578      default: false
    649579
    650 TreatsAnyTextCSSLinkAsStylesheet:
    651   type: bool
    652   defaultValue:
    653     WebCore:
    654       default: false
    655 
    656580UnhandledPromiseRejectionToConsoleEnabled:
    657581  type: bool
     
    674598
    675599UseImageDocumentForSubframePDF:
    676   type: bool
    677   defaultValue:
    678     WebCore:
    679       default: false
    680 
    681 UseLegacyBackgroundSizeShorthandBehavior:
    682   type: bool
    683   defaultValue:
    684     WebCore:
    685       default: false
    686 
    687 UsePreHTML5ParserQuirks:
    688600  type: bool
    689601  defaultValue:
     
    743655      default: false
    744656
    745 WindowFocusRestricted:
    746   comment: >-
    747     When enabled, window.blur() does not change focus, and
    748     window.focus() only changes focus when invoked from the context that
    749     created the window.
    750   type: bool
    751   defaultValue:
    752     WebCore:
    753       default: true
    754 
    755657YouTubeFlashPluginReplacementEnabled:
    756658  type: bool
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r269726 r269760  
     12020-11-12  Sam Weinig  <weinig@apple.com>
     2
     3        Move more WebKitLegacy specific settings usage to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218852
     5
     6        Reviewed by Tim Horton.
     7
     8        This batch focuses on settings with defaults based on SDK/host app conditions.
     9
     10        * WebView/WebPreferences.mm:
     11        (+[WebPreferences initialize]):
     12        * WebView/WebPreferencesDefaultValues.h:
     13        * WebView/WebPreferencesDefaultValues.mm:
     14        (WebKit::defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol):
     15        (WebKit::defaultLoadDeferringEnabled):
     16        (WebKit::defaultWindowFocusRestricted):
     17        (WebKit::defaultUsePreHTML5ParserQuirks):
     18        (WebKit::defaultNeedsAdobeFrameReloadingQuirk):
     19        (WebKit::defaultTreatsAnyTextCSSLinkAsStylesheet):
     20        (WebKit::defaultNeedsFrameNameFallbackToIdQuirk):
     21        (WebKit::defaultNeedsKeyboardEventDisambiguationQuirks):
     22        (WebKit::defaultEnforceCSSMIMETypeInNoQuirksMode):
     23        (WebKit::defaultNeedsIsLoadingInAPISenseQuirk):
     24        (WebKit::defaultUseLegacyBackgroundSizeShorthandBehavior):
     25        (WebKit::defaultAllowDisplayOfInsecureContent):
     26        (WebKit::defaultAllowRunningOfInsecureContent):
     27        (WebKit::defaultShouldConvertInvalidURLsToBlank):
     28        * WebView/WebView.mm:
     29        (-[WebView _commonInitializationWithFrameName:groupName:]):
     30        (needsSelfRetainWhileLoadingQuirk):
     31        (-[WebView _preferencesChanged:]):
     32        (-[WebView dealloc]):
     33        (-[WebView setFrameLoadDelegate:]):
     34        (shouldEnableLoadDeferring): Deleted.
     35        (shouldRestrictWindowFocus): Deleted.
     36        (shouldUseLegacyBackgroundSizeShorthandBehavior): Deleted.
     37        (shouldAllowDisplayAndRunningOfInsecureContent): Deleted.
     38        (shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol): Deleted.
     39        (shouldConvertInvalidURLsToBlank): Deleted.
     40        (-[WebView _needsAdobeFrameReloadingQuirk]): Deleted.
     41        (-[WebView _needsLinkElementTextCSSQuirk]): Deleted.
     42        (-[WebView _needsFrameNameFallbackToIdQuirk]): Deleted.
     43        (-[WebView _needsIsLoadingInAPISenseQuirk]): Deleted.
     44        (-[WebView _needsKeyboardEventDisambiguationQuirks]): Deleted.
     45        (-[WebView _needsPreHTML5ParserQuirks]): Deleted.
     46
    1472020-11-12  Zalan Bujtas  <zalan@apple.com>
    248
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm

    r269726 r269760  
    401401        @(cacheModelForMainBundle([[NSBundle mainBundle] bundleIdentifier])), WebKitCacheModelPreferenceKey,
    402402        @YES, WebKitZoomsTextOnlyPreferenceKey,
    403         @NO, WebKitUsePreHTML5ParserQuirksKey,
    404403        [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
    405404
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h

    r267689 r269760  
    6161bool defaultRequiresUserGestureToLoadVideo();
    6262bool defaultWebSQLEnabled();
     63bool defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol();
     64#endif
     65
     66#if PLATFORM(MAC)
     67bool defaultLoadDeferringEnabled();
     68bool defaultWindowFocusRestricted();
     69bool defaultUsePreHTML5ParserQuirks();
     70bool defaultNeedsAdobeFrameReloadingQuirk();
     71bool defaultTreatsAnyTextCSSLinkAsStylesheet();
     72bool defaultNeedsFrameNameFallbackToIdQuirk();
     73bool defaultNeedsKeyboardEventDisambiguationQuirks();
     74bool defaultEnforceCSSMIMETypeInNoQuirksMode();
     75bool defaultNeedsIsLoadingInAPISenseQuirk();
    6376#endif
    6477
    6578bool defaultAttachmentElementEnabled();
    6679bool defaultShouldRestrictBaseURLSchemes();
     80bool defaultUseLegacyBackgroundSizeShorthandBehavior();
     81bool defaultAllowDisplayOfInsecureContent();
     82bool defaultAllowRunningOfInsecureContent();
     83bool defaultShouldConvertInvalidURLsToBlank();
    6784
    6885} // namespace WebKit
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm

    r267966 r269760  
    2626#import "WebPreferencesDefaultValues.h"
    2727
     28#import "WebKitVersionChecks.h"
    2829#import <Foundation/NSBundle.h>
    2930#import <WebCore/RuntimeApplicationChecks.h>
    3031#import <WebCore/VersionChecks.h>
    3132#import <mach-o/dyld.h>
     33#import <pal/spi/cf/CFUtilitiesSPI.h>
    3234#import <pal/spi/cocoa/FeatureFlagsSPI.h>
    3335#import <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
     
    7577
    7678#if HAVE(INCREMENTAL_PDF_APIS)
     79
    7780bool defaultIncrementalPDFEnabled()
    7881{
     
    8386    return false;
    8487}
     88
    8589#endif
    8690
     
    145149}
    146150
     151bool defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol()
     152{
     153    static bool shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CONTENT_SECURITY_POLICY_SOURCE_STAR_PROTOCOL_RESTRICTION);
     154    return shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol;
     155}
     156
    147157#endif // PLATFORM(IOS_FAMILY)
     158
     159#if PLATFORM(MAC)
     160
     161bool defaultLoadDeferringEnabled()
     162{
     163    return !WebCore::MacApplication::isAdobeInstaller();
     164}
     165
     166bool defaultWindowFocusRestricted()
     167{
     168    return !WebCore::MacApplication::isHRBlock();
     169}
     170
     171bool defaultUsePreHTML5ParserQuirks()
     172{
     173    // AOL Instant Messenger and Microsoft My Day contain markup incompatible
     174    // with the new HTML5 parser. If these applications were linked against a
     175    // version of WebKit prior to the introduction of the HTML5 parser, enable
     176    // parser quirks to maintain compatibility. For details, see
     177    // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
     178    // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
     179    static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
     180        && (WebCore::MacApplication::isAOLInstantMessenger() || WebCore::MacApplication::isMicrosoftMyDay());
     181
     182    // Mail.app must continue to display HTML email that contains quirky markup.
     183    static bool isAppleMail = WebCore::MacApplication::isAppleMail();
     184
     185    return isApplicationNeedingParserQuirks || isAppleMail;
     186}
     187
     188bool defaultNeedsAdobeFrameReloadingQuirk()
     189{
     190    static bool needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.adobe.Acrobat"), -1, 9.0)
     191        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Acrobat.Pro"), -1, 9.0)
     192        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Reader"), -1, 9.0)
     193        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.distiller"), -1, 9.0)
     194        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Contribute"), -1, 4.2)
     195        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.dreamweaver-9.0"), -1, 9.1)
     196        || _CFAppVersionCheckLessThan(CFSTR("com.macromedia.fireworks"), -1, 9.1)
     197        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.InCopy"), -1, 5.1)
     198        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.InDesign"), -1, 5.1)
     199        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Soundbooth"), -1, 2);
     200
     201    return needsQuirk;
     202}
     203
     204bool defaultTreatsAnyTextCSSLinkAsStylesheet()
     205{
     206    static bool needsQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK)
     207        && _CFAppVersionCheckLessThan(CFSTR("com.e-frontier.shade10"), -1, 10.6);
     208    return needsQuirk;
     209}
     210
     211bool defaultNeedsFrameNameFallbackToIdQuirk()
     212{
     213    static bool needsQuirk = _CFAppVersionCheckLessThan(CFSTR("info.colloquy"), -1, 2.5);
     214    return needsQuirk;
     215}
     216
     217bool defaultNeedsKeyboardEventDisambiguationQuirks()
     218{
     219    static bool needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH) && !WebCore::MacApplication::isSafari();
     220    return needsQuirks;
     221}
     222
     223bool defaultEnforceCSSMIMETypeInNoQuirksMode()
     224{
     225    static bool needsQuirk = !_CFAppVersionCheckLessThan(CFSTR("com.apple.iWeb"), -1, 2.1);
     226    return needsQuirk;
     227}
     228
     229bool defaultNeedsIsLoadingInAPISenseQuirk()
     230{
     231    static bool needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.apple.iAdProducer"), -1, 2.1);
     232    return needsQuirk;
     233}
     234
     235#endif // PLATFORM(MAC)
    148236
    149237bool defaultAttachmentElementEnabled()
     
    162250}
    163251
     252bool defaultUseLegacyBackgroundSizeShorthandBehavior()
     253{
     254#if PLATFORM(IOS_FAMILY)
     255    static bool shouldUseLegacyBackgroundSizeShorthandBehavior = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
     256#else
     257    static bool shouldUseLegacyBackgroundSizeShorthandBehavior = WebCore::MacApplication::isVersions()
     258        && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
     259#endif
     260    return shouldUseLegacyBackgroundSizeShorthandBehavior;
     261}
     262
     263bool defaultAllowDisplayOfInsecureContent()
     264{
     265    static bool shouldAllowDisplayOfInsecureContent = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING);
     266    return shouldAllowDisplayOfInsecureContent;
     267}
     268
     269bool defaultAllowRunningOfInsecureContent()
     270{
     271    static bool shouldAllowRunningOfInsecureContent = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING);
     272    return shouldAllowRunningOfInsecureContent;
     273}
     274
     275bool defaultShouldConvertInvalidURLsToBlank()
     276{
     277#if PLATFORM(IOS_FAMILY)
     278    static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_10_0;
     279#else
     280    static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= DYLD_MACOSX_VERSION_10_12;
     281#endif
     282    return shouldConvertInvalidURLsToBlank;
     283}
     284
    164285} // namespace WebKit
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r269713 r269760  
    13201320}
    13211321
    1322 static bool shouldEnableLoadDeferring()
    1323 {
    1324 #if PLATFORM(IOS_FAMILY)
    1325     return true;
    1326 #else
    1327     return !WebCore::MacApplication::isAdobeInstaller();
    1328 #endif
    1329 }
    1330 
    1331 static bool shouldRestrictWindowFocus()
    1332 {
    1333 #if PLATFORM(IOS_FAMILY)
    1334     return true;
    1335 #else
    1336     return !WebCore::MacApplication::isHRBlock();
    1337 #endif
    1338 }
    1339 
    13401322- (void)_dispatchPendingLoadRequests
    13411323{
     
    14231405static bool didOneTimeInitialization = false;
    14241406#endif
    1425 
    1426 static bool shouldUseLegacyBackgroundSizeShorthandBehavior()
    1427 {
    1428 #if PLATFORM(IOS_FAMILY)
    1429     static bool shouldUseLegacyBackgroundSizeShorthandBehavior = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
    1430 #else
    1431     static bool shouldUseLegacyBackgroundSizeShorthandBehavior = WebCore::MacApplication::isVersions()
    1432         && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
    1433 #endif
    1434     return shouldUseLegacyBackgroundSizeShorthandBehavior;
    1435 }
    1436 
    1437 static bool shouldAllowDisplayAndRunningOfInsecureContent()
    1438 {
    1439     static bool shouldAllowDisplayAndRunningOfInsecureContent = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING);
    1440     return shouldAllowDisplayAndRunningOfInsecureContent;
    1441 }
    1442 
    1443 static bool shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol()
    1444 {
    1445 #if PLATFORM(IOS_FAMILY)
    1446     static bool shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CONTENT_SECURITY_POLICY_SOURCE_STAR_PROTOCOL_RESTRICTION);
    1447     return shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol;
    1448 #else
    1449     return false;
    1450 #endif
    1451 }
    1452 
    1453 static bool shouldConvertInvalidURLsToBlank()
    1454 {
    1455 #if PLATFORM(IOS_FAMILY)
    1456     static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_10_0;
    1457 #elif PLATFORM(MAC)
    1458     static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= DYLD_MACOSX_VERSION_10_12;
    1459 #else
    1460     static bool shouldConvertInvalidURLsToBlank = true;
    1461 #endif
    1462 
    1463     return shouldConvertInvalidURLsToBlank;
    1464 }
    14651407
    14661408#if ENABLE(GAMEPAD)
     
    16331575    _private->page->setCanStartMedia([self window]);
    16341576    _private->page->settings().setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
    1635     _private->page->settings().setUseLegacyBackgroundSizeShorthandBehavior(shouldUseLegacyBackgroundSizeShorthandBehavior());
    16361577
    16371578#if !PLATFORM(IOS_FAMILY)
     
    29032844#endif
    29042845
    2905 #if !PLATFORM(IOS_FAMILY)
    2906 - (BOOL)_needsAdobeFrameReloadingQuirk
    2907 {
    2908     static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.adobe.Acrobat"), -1, 9.0)
    2909         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Acrobat.Pro"), -1, 9.0)
    2910         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Reader"), -1, 9.0)
    2911         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.distiller"), -1, 9.0)
    2912         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Contribute"), -1, 4.2)
    2913         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.dreamweaver-9.0"), -1, 9.1)
    2914         || _CFAppVersionCheckLessThan(CFSTR("com.macromedia.fireworks"), -1, 9.1)
    2915         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.InCopy"), -1, 5.1)
    2916         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.InDesign"), -1, 5.1)
    2917         || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Soundbooth"), -1, 2);
    2918 
    2919     return needsQuirk;
    2920 }
    2921 
    2922 - (BOOL)_needsLinkElementTextCSSQuirk
    2923 {
    2924     static BOOL needsQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK)
    2925         && _CFAppVersionCheckLessThan(CFSTR("com.e-frontier.shade10"), -1, 10.6);
    2926     return needsQuirk;
    2927 }
    2928 
    2929 - (BOOL)_needsFrameNameFallbackToIdQuirk
    2930 {
    2931     static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("info.colloquy"), -1, 2.5);
    2932     return needsQuirk;
    2933 }
    2934 
    2935 - (BOOL)_needsIsLoadingInAPISenseQuirk
    2936 {
    2937     static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.apple.iAdProducer"), -1, 2.1);
    2938 
    2939     return needsQuirk;
    2940 }
    2941 
    2942 - (BOOL)_needsKeyboardEventDisambiguationQuirks
    2943 {
    2944     static BOOL needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH) && !WebCore::MacApplication::isSafari();
    2945     return needsQuirks;
    2946 }
    2947 
     2846#if PLATFORM(MAC)
    29482847- (BOOL)_needsFrameLoadDelegateRetainQuirk
    29492848{
     
    29572856    return needsQuirk;
    29582857}
    2959 #endif // !PLATFORM(IOS_FAMILY)
    2960 
    2961 - (BOOL)_needsPreHTML5ParserQuirks
    2962 {
    2963 #if !PLATFORM(IOS_FAMILY)
    2964     // AOL Instant Messenger and Microsoft My Day contain markup incompatible
    2965     // with the new HTML5 parser. If these applications were linked against a
    2966     // version of WebKit prior to the introduction of the HTML5 parser, enable
    2967     // parser quirks to maintain compatibility. For details, see
    2968     // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
    2969     // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
    2970     static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
    2971         && (WebCore::MacApplication::isAOLInstantMessenger() || WebCore::MacApplication::isMicrosoftMyDay());
    2972 
    2973     // Mail.app must continue to display HTML email that contains quirky markup.
    2974     static bool isAppleMail = WebCore::MacApplication::isAppleMail();
    2975 
    2976     return isApplicationNeedingParserQuirks || isAppleMail || [[self preferences] usePreHTML5ParserQuirks];
    2977 #else
    2978     return [[self preferences] usePreHTML5ParserQuirks];
    2979 #endif
    2980 }
     2858#endif
    29812859
    29822860- (void)_preferencesChangedNotification:(NSNotification *)notification
     
    30422920    auto& settings = _private->page->settings();
    30432921   
    3044     // FIXME: This should switch to using WebPreferences for storage and adopt autogeneration.
     2922    // FIXME: These should switch to using WebPreferences for storage and adopt autogeneration.
    30452923    settings.setInteractiveFormValidationEnabled([self interactiveFormValidationEnabled]);
    3046 
    3047     // FIXME: We should make autogeneration smart enough to deal with core/kit conversions of enums.
     2924    settings.setValidationMessageTimerMagnification([self validationMessageTimerMagnification]);
     2925
     2926    // FIXME: Autogeneration should be smart enough to deal with core/kit conversions and validation of non-primitive types like enums, URLs and Seconds.
    30482927    settings.setStorageBlockingPolicy(core([preferences storageBlockingPolicy]));
    30492928    settings.setEditableLinkBehavior(core([preferences editableLinkBehavior]));
     
    30622941    _private->page->setSessionID([preferences privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID());
    30632942    _private->group->storageNamespaceProvider().setSessionIDForTesting([preferences privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID());
    3064 
    3065     settings.setLoadDeferringEnabled(shouldEnableLoadDeferring());
    3066     settings.setWindowFocusRestricted(shouldRestrictWindowFocus());
    3067     settings.setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
    3068     settings.setValidationMessageTimerMagnification([self validationMessageTimerMagnification]);
    3069     settings.setAllowDisplayOfInsecureContent(shouldAllowDisplayAndRunningOfInsecureContent());
    3070     settings.setAllowRunningOfInsecureContent(shouldAllowDisplayAndRunningOfInsecureContent());
    3071     settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol());
    3072     settings.setShouldConvertInvalidURLsToBlank(shouldConvertInvalidURLsToBlank());
    30732943
    30742944#if PLATFORM(MAC)
     
    30792949    } else
    30802950        settings.setUserStyleSheetLocation([NSURL URLWithString:@""]);
    3081 
    3082     settings.setNeedsAdobeFrameReloadingQuirk([self _needsAdobeFrameReloadingQuirk]);
    3083     settings.setTreatsAnyTextCSSLinkAsStylesheet([self _needsLinkElementTextCSSQuirk]);
    3084     settings.setNeedsFrameNameFallbackToIdQuirk([self _needsFrameNameFallbackToIdQuirk]);
    3085     settings.setNeedsKeyboardEventDisambiguationQuirks([self _needsKeyboardEventDisambiguationQuirks]);
    3086     settings.setEnforceCSSMIMETypeInNoQuirksMode(!_CFAppVersionCheckLessThan(CFSTR("com.apple.iWeb"), -1, 2.1));
    3087     settings.setNeedsIsLoadingInAPISenseQuirk([self _needsIsLoadingInAPISenseQuirk]);
    30882951#endif
    30892952
     
    56905553            --WebViewCount;
    56915554
    5692 #if !PLATFORM(IOS_FAMILY)
     5555#if PLATFORM(MAC)
    56935556        if ([self _needsFrameLoadDelegateRetainQuirk])
    56945557            [_private->frameLoadDelegate release];
     
    60955958    // was dealloc'ed before being cleared.
    60965959    // This is an effort to keep such apps working for now.
    6097 #if !PLATFORM(IOS_FAMILY)
     5960#if PLATFORM(MAC)
    60985961    if ([self _needsFrameLoadDelegateRetainQuirk]) {
    60995962        [delegate retain];
  • trunk/Tools/ChangeLog

    r269757 r269760  
     12020-11-12  Sam Weinig  <weinig@apple.com>
     2
     3        Move more WebKitLegacy specific settings usage to WebPreferences.yaml
     4        https://bugs.webkit.org/show_bug.cgi?id=218852
     5
     6        Reviewed by Tim Horton.
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (resetWebPreferencesToConsistentValues):
     10        Remove unnecessary call of [WebPreferences setUsePreHTML5ParserQuirks:NO] as this is the default.
     11
    1122020-11-12  Devin Rousso  <drousso@apple.com>
    213
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r269713 r269760  
    886886    [preferences setStandardFontFamily:@"Times"];
    887887    [preferences setSubpixelAntialiasedLayerTextEnabled:NO];
    888     [preferences setUsePreHTML5ParserQuirks:NO];
    889888    [preferences setVideoPlaybackRequiresUserGesture:NO];
    890889    [preferences setWebAudioEnabled:YES];
Note: See TracChangeset for help on using the changeset viewer.