Changeset 269760 in webkit
- Timestamp:
- Nov 12, 2020 4:20:43 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r269757 r269760 1 2020-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 1 12 2020-11-12 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml
r269713 r269760 78 78 default: false 79 79 80 AllowContentSecurityPolicySourceStarToMatchAnyProtocol: 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 80 91 AllowCrossOriginSubresourcesToAskForCredentials: 81 92 type: bool … … 83 94 WebKitLegacy: 84 95 default: false 96 WebKit: 97 default: false 98 WebCore: 99 default: false 100 101 AllowDisplayOfInsecureContent: 102 type: bool 103 defaultValue: 104 WebKitLegacy: 105 default: WebKit::defaultAllowDisplayOfInsecureContent() 85 106 WebKit: 86 107 default: false … … 117 138 WebKitLegacy: 118 139 default: false 140 WebKit: 141 default: false 142 WebCore: 143 default: false 144 145 AllowRunningOfInsecureContent: 146 type: bool 147 defaultValue: 148 WebKitLegacy: 149 default: WebKit::defaultAllowRunningOfInsecureContent() 119 150 WebKit: 120 151 default: false … … 681 712 WebCore: 682 713 default: false 714 715 EnforceCSSMIMETypeInNoQuirksMode: 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 683 725 684 726 EnumeratingAllNetworkInterfacesEnabled: … … 1183 1225 default: true 1184 1226 1227 LoadDeferringEnabled: 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 1185 1238 # This only suppresses the network load of the image URL. A cached image will still be rendered if requested. 1186 1239 LoadsImagesAutomatically: … … 1462 1515 default: false 1463 1516 1517 NeedsAdobeFrameReloadingQuirk: 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 1531 NeedsFrameNameFallbackToIdQuirk: 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 1542 NeedsIsLoadingInAPISenseQuirk: 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 1554 NeedsKeyboardEventDisambiguationQuirks: 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 1464 1569 NeedsSiteSpecificQuirks: 1465 1570 type: bool … … 1820 1925 default: true 1821 1926 1927 ShouldConvertInvalidURLsToBlank: 1928 type: bool 1929 defaultValue: 1930 WebKitLegacy: 1931 default: WebKit::defaultShouldConvertInvalidURLsToBlank() 1932 WebKit: 1933 default: true 1934 WebCore: 1935 default: true 1936 1822 1937 ShouldConvertPositionStyleOnCopy: 1823 1938 type: bool … … 2183 2298 default: true 2184 2299 2300 TreatsAnyTextCSSLinkAsStylesheet: 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 2185 2311 UseGiantTiles: 2186 2312 type: bool … … 2193 2319 default: false 2194 2320 2321 UseLegacyBackgroundSizeShorthandBehavior: 2322 type: bool 2323 defaultValue: 2324 WebKitLegacy: 2325 default: WebKit::defaultUseLegacyBackgroundSizeShorthandBehavior() 2326 WebKit: 2327 default: false 2328 WebCore: 2329 default: false 2330 2195 2331 UseLegacyTextAlignPositionedElementBehavior: 2196 2332 type: bool 2197 2333 defaultValue: 2198 2334 WebKitLegacy: 2335 default: false 2336 WebKit: 2337 default: false 2338 WebCore: 2339 default: false 2340 2341 UsePreHTML5ParserQuirks: 2342 type: bool 2343 defaultValue: 2344 WebKitLegacy: 2345 PLATFORM(MAC): WebKit::defaultUsePreHTML5ParserQuirks() 2199 2346 default: false 2200 2347 WebKit: … … 2348 2495 default: false 2349 2496 2497 WindowFocusRestricted: 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 2350 2510 XSSAuditorEnabled: 2351 2511 type: bool -
trunk/Source/WebCore/ChangeLog
r269753 r269760 1 2020-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 1 12 2020-11-12 Said Abou-Hallawa <said@apple.com> 2 13 -
trunk/Source/WebCore/page/Settings.yaml
r269713 r269760 36 36 default: false 37 37 38 AllowContentSecurityPolicySourceStarToMatchAnyProtocol:39 type: bool40 defaultValue:41 WebCore:42 default: false43 44 AllowDisplayOfInsecureContent:45 type: bool46 defaultValue:47 WebCore:48 default: false49 50 AllowRunningOfInsecureContent:51 type: bool52 defaultValue:53 WebCore:54 default: false55 56 38 AnimatedImageDebugCanvasDrawingEnabled: 57 39 type: bool … … 175 157 default: EditingMacBehavior 176 158 177 EnforceCSSMIMETypeInNoQuirksMode:178 type: bool179 defaultValue:180 WebCore:181 default: true182 183 159 FixedBackgroundsPaintRelativeToDocument: 184 160 type: bool … … 355 331 WebCore: 356 332 default: false 357 358 LoadDeferringEnabled:359 type: bool360 defaultValue:361 WebCore:362 default: true363 333 364 334 LocalStorageDatabasePath: … … 431 401 default: 257*256 432 402 433 NeedsAdobeFrameReloadingQuirk:434 comment: >-435 FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it436 out once Adobe can fix the bug from their end.437 type: bool438 webcoreGetter: needsAcrobatFrameReloadingQuirk439 defaultValue:440 WebCore:441 default: false442 443 403 NeedsDeferKeyDownAndKeyPressTimersUntilNextEditingCommandQuirk: 444 404 comment: >- … … 454 414 default: false 455 415 456 NeedsFrameNameFallbackToIdQuirk:457 type: bool458 defaultValue:459 WebCore:460 default: false461 462 NeedsIsLoadingInAPISenseQuirk:463 comment: >-464 Some apps needs isLoadingInAPISense to account for active subresource loaders.465 type: bool466 defaultValue:467 WebCore:468 default: false469 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: bool476 defaultValue:477 WebCore:478 default: false479 480 416 ParserScriptingFlagPolicy: 481 417 type: uint32_t … … 552 488 WebCore: 553 489 default: StorageMap::noQuota 554 555 ShouldConvertInvalidURLsToBlank:556 type: bool557 defaultValue:558 WebCore:559 default: true560 490 561 491 ShouldDispatchSyntheticMouseEventsWhenModifyingSelection: … … 648 578 default: false 649 579 650 TreatsAnyTextCSSLinkAsStylesheet:651 type: bool652 defaultValue:653 WebCore:654 default: false655 656 580 UnhandledPromiseRejectionToConsoleEnabled: 657 581 type: bool … … 674 598 675 599 UseImageDocumentForSubframePDF: 676 type: bool677 defaultValue:678 WebCore:679 default: false680 681 UseLegacyBackgroundSizeShorthandBehavior:682 type: bool683 defaultValue:684 WebCore:685 default: false686 687 UsePreHTML5ParserQuirks:688 600 type: bool 689 601 defaultValue: … … 743 655 default: false 744 656 745 WindowFocusRestricted:746 comment: >-747 When enabled, window.blur() does not change focus, and748 window.focus() only changes focus when invoked from the context that749 created the window.750 type: bool751 defaultValue:752 WebCore:753 default: true754 755 657 YouTubeFlashPluginReplacementEnabled: 756 658 type: bool -
trunk/Source/WebKitLegacy/mac/ChangeLog
r269726 r269760 1 2020-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 1 47 2020-11-12 Zalan Bujtas <zalan@apple.com> 2 48 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
r269726 r269760 401 401 @(cacheModelForMainBundle([[NSBundle mainBundle] bundleIdentifier])), WebKitCacheModelPreferenceKey, 402 402 @YES, WebKitZoomsTextOnlyPreferenceKey, 403 @NO, WebKitUsePreHTML5ParserQuirksKey,404 403 [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota, 405 404 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h
r267689 r269760 61 61 bool defaultRequiresUserGestureToLoadVideo(); 62 62 bool defaultWebSQLEnabled(); 63 bool defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol(); 64 #endif 65 66 #if PLATFORM(MAC) 67 bool defaultLoadDeferringEnabled(); 68 bool defaultWindowFocusRestricted(); 69 bool defaultUsePreHTML5ParserQuirks(); 70 bool defaultNeedsAdobeFrameReloadingQuirk(); 71 bool defaultTreatsAnyTextCSSLinkAsStylesheet(); 72 bool defaultNeedsFrameNameFallbackToIdQuirk(); 73 bool defaultNeedsKeyboardEventDisambiguationQuirks(); 74 bool defaultEnforceCSSMIMETypeInNoQuirksMode(); 75 bool defaultNeedsIsLoadingInAPISenseQuirk(); 63 76 #endif 64 77 65 78 bool defaultAttachmentElementEnabled(); 66 79 bool defaultShouldRestrictBaseURLSchemes(); 80 bool defaultUseLegacyBackgroundSizeShorthandBehavior(); 81 bool defaultAllowDisplayOfInsecureContent(); 82 bool defaultAllowRunningOfInsecureContent(); 83 bool defaultShouldConvertInvalidURLsToBlank(); 67 84 68 85 } // namespace WebKit -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm
r267966 r269760 26 26 #import "WebPreferencesDefaultValues.h" 27 27 28 #import "WebKitVersionChecks.h" 28 29 #import <Foundation/NSBundle.h> 29 30 #import <WebCore/RuntimeApplicationChecks.h> 30 31 #import <WebCore/VersionChecks.h> 31 32 #import <mach-o/dyld.h> 33 #import <pal/spi/cf/CFUtilitiesSPI.h> 32 34 #import <pal/spi/cocoa/FeatureFlagsSPI.h> 33 35 #import <wtf/cocoa/RuntimeApplicationChecksCocoa.h> … … 75 77 76 78 #if HAVE(INCREMENTAL_PDF_APIS) 79 77 80 bool defaultIncrementalPDFEnabled() 78 81 { … … 83 86 return false; 84 87 } 88 85 89 #endif 86 90 … … 145 149 } 146 150 151 bool defaultAllowContentSecurityPolicySourceStarToMatchAnyProtocol() 152 { 153 static bool shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CONTENT_SECURITY_POLICY_SOURCE_STAR_PROTOCOL_RESTRICTION); 154 return shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol; 155 } 156 147 157 #endif // PLATFORM(IOS_FAMILY) 158 159 #if PLATFORM(MAC) 160 161 bool defaultLoadDeferringEnabled() 162 { 163 return !WebCore::MacApplication::isAdobeInstaller(); 164 } 165 166 bool defaultWindowFocusRestricted() 167 { 168 return !WebCore::MacApplication::isHRBlock(); 169 } 170 171 bool 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 188 bool 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 204 bool 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 211 bool defaultNeedsFrameNameFallbackToIdQuirk() 212 { 213 static bool needsQuirk = _CFAppVersionCheckLessThan(CFSTR("info.colloquy"), -1, 2.5); 214 return needsQuirk; 215 } 216 217 bool defaultNeedsKeyboardEventDisambiguationQuirks() 218 { 219 static bool needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH) && !WebCore::MacApplication::isSafari(); 220 return needsQuirks; 221 } 222 223 bool defaultEnforceCSSMIMETypeInNoQuirksMode() 224 { 225 static bool needsQuirk = !_CFAppVersionCheckLessThan(CFSTR("com.apple.iWeb"), -1, 2.1); 226 return needsQuirk; 227 } 228 229 bool defaultNeedsIsLoadingInAPISenseQuirk() 230 { 231 static bool needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.apple.iAdProducer"), -1, 2.1); 232 return needsQuirk; 233 } 234 235 #endif // PLATFORM(MAC) 148 236 149 237 bool defaultAttachmentElementEnabled() … … 162 250 } 163 251 252 bool 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 263 bool defaultAllowDisplayOfInsecureContent() 264 { 265 static bool shouldAllowDisplayOfInsecureContent = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING); 266 return shouldAllowDisplayOfInsecureContent; 267 } 268 269 bool defaultAllowRunningOfInsecureContent() 270 { 271 static bool shouldAllowRunningOfInsecureContent = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING); 272 return shouldAllowRunningOfInsecureContent; 273 } 274 275 bool 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 164 285 } // namespace WebKit -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r269713 r269760 1320 1320 } 1321 1321 1322 static bool shouldEnableLoadDeferring()1323 {1324 #if PLATFORM(IOS_FAMILY)1325 return true;1326 #else1327 return !WebCore::MacApplication::isAdobeInstaller();1328 #endif1329 }1330 1331 static bool shouldRestrictWindowFocus()1332 {1333 #if PLATFORM(IOS_FAMILY)1334 return true;1335 #else1336 return !WebCore::MacApplication::isHRBlock();1337 #endif1338 }1339 1340 1322 - (void)_dispatchPendingLoadRequests 1341 1323 { … … 1423 1405 static bool didOneTimeInitialization = false; 1424 1406 #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 #else1431 static bool shouldUseLegacyBackgroundSizeShorthandBehavior = WebCore::MacApplication::isVersions()1432 && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);1433 #endif1434 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 #else1449 return false;1450 #endif1451 }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 #else1460 static bool shouldConvertInvalidURLsToBlank = true;1461 #endif1462 1463 return shouldConvertInvalidURLsToBlank;1464 }1465 1407 1466 1408 #if ENABLE(GAMEPAD) … … 1633 1575 _private->page->setCanStartMedia([self window]); 1634 1576 _private->page->settings().setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); 1635 _private->page->settings().setUseLegacyBackgroundSizeShorthandBehavior(shouldUseLegacyBackgroundSizeShorthandBehavior());1636 1577 1637 1578 #if !PLATFORM(IOS_FAMILY) … … 2903 2844 #endif 2904 2845 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) 2948 2847 - (BOOL)_needsFrameLoadDelegateRetainQuirk 2949 2848 { … … 2957 2856 return needsQuirk; 2958 2857 } 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 2981 2859 2982 2860 - (void)_preferencesChangedNotification:(NSNotification *)notification … … 3042 2920 auto& settings = _private->page->settings(); 3043 2921 3044 // FIXME: Th isshould switch to using WebPreferences for storage and adopt autogeneration.2922 // FIXME: These should switch to using WebPreferences for storage and adopt autogeneration. 3045 2923 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. 3048 2927 settings.setStorageBlockingPolicy(core([preferences storageBlockingPolicy])); 3049 2928 settings.setEditableLinkBehavior(core([preferences editableLinkBehavior])); … … 3062 2941 _private->page->setSessionID([preferences privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID()); 3063 2942 _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());3073 2943 3074 2944 #if PLATFORM(MAC) … … 3079 2949 } else 3080 2950 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]);3088 2951 #endif 3089 2952 … … 5690 5553 --WebViewCount; 5691 5554 5692 #if !PLATFORM(IOS_FAMILY)5555 #if PLATFORM(MAC) 5693 5556 if ([self _needsFrameLoadDelegateRetainQuirk]) 5694 5557 [_private->frameLoadDelegate release]; … … 6095 5958 // was dealloc'ed before being cleared. 6096 5959 // This is an effort to keep such apps working for now. 6097 #if !PLATFORM(IOS_FAMILY)5960 #if PLATFORM(MAC) 6098 5961 if ([self _needsFrameLoadDelegateRetainQuirk]) { 6099 5962 [delegate retain]; -
trunk/Tools/ChangeLog
r269757 r269760 1 2020-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 1 12 2020-11-12 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r269713 r269760 886 886 [preferences setStandardFontFamily:@"Times"]; 887 887 [preferences setSubpixelAntialiasedLayerTextEnabled:NO]; 888 [preferences setUsePreHTML5ParserQuirks:NO];889 888 [preferences setVideoPlaybackRequiresUserGesture:NO]; 890 889 [preferences setWebAudioEnabled:YES];
Note: See TracChangeset
for help on using the changeset viewer.