Changeset 223624 in webkit
- Timestamp:
- Oct 18, 2017 1:18:38 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223622 r223624 1 2017-10-18 Sam Weinig <sam@webkit.org> 2 3 [Settings] Move remaining simple settings to Settings.in 4 https://bugs.webkit.org/show_bug.cgi?id=177730 5 <rdar://problem/34763346> 6 7 Reviewed by Daniel Bates. 8 9 * Scripts/GenerateSettings/Settings.py: 10 (Setting.__init__): 11 (Setting.__str__): 12 (Setting.getterFunctionName): 13 (parseInput): 14 15 Add support for parsing the 'getter' option. 16 17 * page/Settings.in: 18 19 Migrate simple settings from SettingsBase to here. 20 21 * page/SettingsBase.cpp: 22 (WebCore::SettingsBase::SettingsBase): 23 (WebCore::SettingsBase::setJavaEnabled): Deleted. 24 (WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted. 25 (WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted. 26 (WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted. 27 (WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted. 28 (WebCore::SettingsBase::setFontRenderingMode): Deleted. 29 (WebCore::SettingsBase::fontRenderingMode const): Deleted. 30 (WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted. 31 (WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted. 32 * page/SettingsBase.h: 33 (WebCore::SettingsBase::isJavaEnabled const): Deleted. 34 (WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted. 35 (WebCore::SettingsBase::preferMIMETypeForImages const): Deleted. 36 (WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted. 37 (WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted. 38 (WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted. 39 (WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted. 40 (WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted. 41 (WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted. 42 (WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted. 43 (WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted. 44 (WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted. 45 (WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted. 46 (WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted. 47 (WebCore::SettingsBase::applePayEnabled const): Deleted. 48 (WebCore::SettingsBase::setApplePayEnabled): Deleted. 49 (WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted. 50 (WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted. 51 (WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted. 52 53 Remove simple settings. 54 1 55 2017-10-18 Zalan Bujtas <zalan@apple.com> 2 56 -
trunk/Source/WebCore/Scripts/GenerateSettings/Settings.py
r223612 r223624 62 62 def __init__(self, name): 63 63 self.name = name 64 self.type = "bool"64 self.type = 'bool' 65 65 self.initial = None 66 66 self.conditional = None 67 67 self.setNeedsStyleRecalcInAllFrames = None 68 self.getter = None 68 69 69 70 def __str__(self): 70 result = self.name + " TYPE:"+ self.type71 result = self.name + ' TYPE:' + self.type 71 72 if (self.initial): 72 result += " INIT:"+ self.initial73 result += ' INIT:' + self.initial 73 74 if (self.conditional): 74 result += " COND:"+ self.conditional75 result += ' COND:' + self.conditional 75 76 if (self.setNeedsStyleRecalcInAllFrames): 76 result += " RECALC:" + self.setNeedsStyleRecalcInAllFrames 77 result += ' RECALC:' + self.setNeedsStyleRecalcInAllFrames 78 if (self.getter): 79 result += ' GETTER:' + self.getter 77 80 return result 78 81 79 82 def hasComplexSetter(self): 80 if self.setNeedsStyleRecalcInAllFrames: 81 return True 82 return False 83 return self.setNeedsStyleRecalcInAllFrames 83 84 84 85 def typeIsValueType(self): 85 if self.type == 'String': 86 return False 87 return True 86 return self.type != 'String' 88 87 89 88 def setterFunctionName(self): 90 for prefix in [ "css", "xss", "ftp", "dom"]:89 for prefix in ['css', 'xss', 'ftp', 'dom']: 91 90 if self.name.startswith(prefix): 92 return "set"+ uppercaseFirstN(self.name, len(prefix))93 return "set"+ uppercaseFirstN(self.name, 1)91 return 'set' + uppercaseFirstN(self.name, len(prefix)) 92 return 'set' + uppercaseFirstN(self.name, 1) 94 93 95 94 def getterFunctionName(self): 96 return self. name95 return self.getter or self.name 97 96 98 97 def idlType(self): … … 123 122 def makeConditionalString(conditional): 124 123 conditionals = conditional.split('|') 125 return "ENABLE(" + ") || ENABLE(".join(conditionals) + ")"124 return 'ENABLE(' + ') || ENABLE('.join(conditionals) + ')' 126 125 127 126 128 127 def parseInput(input): 129 128 settings = {} 130 for line in open(input, "r"):131 if not line.startswith("#") and not line.isspace():132 129 133 (name, optionsString) = line.rstrip().split(' ', 1) 130 with open(input, 'r') as file: 131 for line in file: 132 if not line.startswith('#') and not line.isspace(): 134 133 135 options = re.split(r' *, *', optionsString)134 (name, optionsString) = line.rstrip().split(' ', 1) 136 135 137 setting = Setting(name) 138 for option in options: 139 (name, value) = re.split(r' *= *', option) 140 if (name == 'type'): 141 setting.type = value 142 if (name == 'initial'): 143 setting.initial = value 144 if (name == 'conditional'): 145 setting.conditional = value 146 if (name == 'setNeedsStyleRecalcInAllFrames'): 147 setting.setNeedsStyleRecalcInAllFrames = value 136 options = re.split(r' *, *', optionsString) 148 137 149 # FIXME: ASSERT something about setting.initial 138 setting = Setting(name) 139 for option in options: 140 (name, value) = re.split(r' *= *', option) 141 if (name == 'type'): 142 setting.type = value 143 if (name == 'initial'): 144 setting.initial = value 145 if (name == 'conditional'): 146 setting.conditional = value 147 if (name == 'setNeedsStyleRecalcInAllFrames'): 148 setting.setNeedsStyleRecalcInAllFrames = value 149 if (name == 'getter'): 150 setting.getter = value 150 151 151 settings[setting.name] = setting 152 # FIXME: ASSERT something about setting.initial 153 154 settings[setting.name] = setting 152 155 153 156 return settings -
trunk/Source/WebCore/page/Settings.in
r223432 r223624 67 67 showRepaintCounter initial=false, setNeedsStyleRecalcInAllFrames=1 68 68 visibleDebugOverlayRegions type=DebugOverlayRegions, initial=0 69 showTiledScrollingIndicator initial=false 69 70 70 71 # This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching, … … 304 305 allowMediaContentTypesRequiringHardwareSupportAsFallback initial=false 305 306 306 paymentRequestEnabled initial=false, conditional=PAYMENT_REQUEST 307 storageAccessAPIEnabled initial=false 308 309 timeWithoutMouseMovementBeforeHidingControls type=Seconds, initial=3_s 310 311 fontFallbackPrefersPictographs initial=false, setNeedsStyleRecalcInAllFrames=1 307 312 308 313 fontLoadTimingOverride type=FontLoadTimingOverride, initial=FontLoadTimingOverride::None 309 314 shouldIgnoreFontLoadCompletions initial=false 310 315 311 storageAccessAPIEnabled initial=false 312 316 paymentRequestEnabled initial=false, conditional=PAYMENT_REQUEST 317 applePayEnabled initial=false, conditional=APPLE_PAY 318 applePayCapabilityDisclosureAllowed initial=true, conditional=APPLE_PAY 319 320 javaEnabled initial=false, getter=isJavaEnabled 321 javaEnabledForLocalFiles initial=true, getter=isJavaEnabledForLocalFiles 322 323 fontRenderingMode type=FontRenderingMode, initial=FontRenderingMode::Normal 324 325 preferMIMETypeForImages initial=false 326 327 forcePendingWebGLPolicy initial=false, getter=isForcePendingWebGLPolicy 328 329 mediaKeysStorageDirectory type=String, conditional=LEGACY_ENCRYPTED_MEDIA 330 mediaDeviceIdentifierStorageDirectory type=String, conditional=MEDIA_STREAM 331 332 # FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe 333 # can fix the bug from their end. 334 needsAdobeFrameReloadingQuirk initial=false, getter=needsAcrobatFrameReloadingQuirk 335 336 touchEventEmulationEnabled initial=false, getter=isTouchEventEmulationEnabled, conditional=TOUCH_EVENTS -
trunk/Source/WebCore/page/SettingsBase.cpp
r223332 r223624 147 147 , m_layoutInterval(layoutScheduleThreshold) 148 148 , m_minimumDOMTimerInterval(DOMTimer::defaultMinimumInterval()) 149 , m_isJavaEnabled(false)150 , m_isJavaEnabledForLocalFiles(true)151 149 , m_loadsImagesAutomatically(false) 152 150 , m_areImagesEnabled(true) 153 , m_preferMIMETypeForImages(false)154 151 , m_arePluginsEnabled(false) 155 152 , m_isScriptEnabled(false) 156 , m_needsAdobeFrameReloadingQuirk(false)157 153 , m_usesPageCache(false) 158 , m_fontRenderingMode(0)159 , m_showTiledScrollingIndicator(false)160 154 , m_backgroundShouldExtendBeyondPage(false) 161 155 , m_dnsPrefetchingEnabled(false) 162 #if ENABLE(TOUCH_EVENTS)163 , m_touchEventEmulationEnabled(false)164 #endif165 156 , m_scrollingPerformanceLoggingEnabled(false) 166 157 , m_setImageLoadingSettingsTimer(*this, &SettingsBase::imageLoadingSettingsTimerFired) 167 158 , m_hiddenPageDOMTimerThrottlingEnabled(false) 168 159 , m_hiddenPageCSSAnimationSuspensionEnabled(false) 169 , m_fontFallbackPrefersPictographs(false)170 , m_forcePendingWebGLPolicy(false)171 160 { 172 161 // A Frame may not have been created yet, so we initialize the AtomicString … … 335 324 } 336 325 337 void SettingsBase::setJavaEnabled(bool isJavaEnabled)338 {339 m_isJavaEnabled = isJavaEnabled;340 }341 342 void SettingsBase::setJavaEnabledForLocalFiles(bool isJavaEnabledForLocalFiles)343 {344 m_isJavaEnabledForLocalFiles = isJavaEnabledForLocalFiles;345 }346 347 326 void SettingsBase::setImagesEnabled(bool areImagesEnabled) 348 327 { … … 353 332 } 354 333 355 void SettingsBase::setPreferMIMETypeForImages(bool preferMIMETypeForImages)356 {357 m_preferMIMETypeForImages = preferMIMETypeForImages;358 }359 360 void SettingsBase::setForcePendingWebGLPolicy(bool forced)361 {362 m_forcePendingWebGLPolicy = forced;363 }364 365 334 void SettingsBase::setPluginsEnabled(bool arePluginsEnabled) 366 335 { … … 381 350 if (m_page) 382 351 m_page->userStyleSheetLocationChanged(); 383 }384 385 // FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe386 // can fix the bug from their end.387 void SettingsBase::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUnchangedSRC)388 {389 m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;390 352 } 391 353 … … 424 386 } 425 387 426 void SettingsBase::setFontRenderingMode(FontRenderingMode mode)427 {428 if (fontRenderingMode() == mode)429 return;430 m_fontRenderingMode = static_cast<int>(mode);431 if (m_page)432 m_page->setNeedsRecalcStyleInAllFrames();433 }434 435 FontRenderingMode SettingsBase::fontRenderingMode() const436 {437 return static_cast<FontRenderingMode>(m_fontRenderingMode);438 }439 440 388 void SettingsBase::setDNSPrefetchingEnabled(bool dnsPrefetchingEnabled) 441 389 { … … 446 394 if (m_page) 447 395 m_page->dnsPrefetchingStateChanged(); 448 }449 450 void SettingsBase::setShowTiledScrollingIndicator(bool enabled)451 {452 if (m_showTiledScrollingIndicator == enabled)453 return;454 455 m_showTiledScrollingIndicator = enabled;456 396 } 457 397 … … 639 579 if (m_page) 640 580 m_page->hiddenPageCSSAnimationSuspensionStateChanged(); 641 }642 643 void SettingsBase::setFontFallbackPrefersPictographs(bool preferPictographs)644 {645 if (m_fontFallbackPrefersPictographs == preferPictographs)646 return;647 648 m_fontFallbackPrefersPictographs = preferPictographs;649 if (m_page)650 m_page->setNeedsRecalcStyleInAllFrames();651 581 } 652 582 -
trunk/Source/WebCore/page/SettingsBase.h
r223432 r223624 151 151 152 152 153 WEBCORE_EXPORT void setJavaEnabled(bool);154 bool isJavaEnabled() const { return m_isJavaEnabled; }155 156 // This settings is only consulted if isJavaEnabled() returns true;157 WEBCORE_EXPORT void setJavaEnabledForLocalFiles(bool);158 bool isJavaEnabledForLocalFiles() const { return m_isJavaEnabledForLocalFiles; }159 160 153 WEBCORE_EXPORT void setImagesEnabled(bool); 161 154 bool areImagesEnabled() const { return m_areImagesEnabled; } 162 155 163 WEBCORE_EXPORT void setPreferMIMETypeForImages(bool);164 bool preferMIMETypeForImages() const { return m_preferMIMETypeForImages; }165 166 156 WEBCORE_EXPORT void setPluginsEnabled(bool); 167 157 bool arePluginsEnabled() const { return m_arePluginsEnabled; } … … 172 162 WEBCORE_EXPORT void setUserStyleSheetLocation(const URL&); 173 163 const URL& userStyleSheetLocation() const { return m_userStyleSheetLocation; } 174 175 WEBCORE_EXPORT void setNeedsAdobeFrameReloadingQuirk(bool);176 bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }177 164 178 165 WEBCORE_EXPORT void setMinimumDOMTimerInterval(Seconds); // Initialized to DOMTimer::defaultMinimumInterval(). … … 190 177 bool usesPageCache() const { return m_usesPageCache; } 191 178 192 void setFontRenderingMode(FontRenderingMode mode);193 FontRenderingMode fontRenderingMode() const;194 195 WEBCORE_EXPORT void setShowTiledScrollingIndicator(bool);196 bool showTiledScrollingIndicator() const { return m_showTiledScrollingIndicator; }197 198 179 #if ENABLE(RESOURCE_USAGE) 199 180 bool resourceUsageOverlayVisible() const { return m_resourceUsageOverlayVisible; } … … 249 230 static bool usesMockScrollAnimator(); 250 231 251 #if ENABLE(TOUCH_EVENTS)252 void setTouchEventEmulationEnabled(bool enabled) { m_touchEventEmulationEnabled = enabled; }253 bool isTouchEventEmulationEnabled() const { return m_touchEventEmulationEnabled; }254 #endif255 256 232 WEBCORE_EXPORT void setStorageBlockingPolicy(SecurityOrigin::StorageBlockingPolicy); 257 233 SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy() const { return m_storageBlockingPolicy; } … … 263 239 static bool shouldRespectPriorityInCSSAttributeSetters(); 264 240 265 void setTimeWithoutMouseMovementBeforeHidingControls(Seconds time) { m_timeWithoutMouseMovementBeforeHidingControls = time; }266 Seconds timeWithoutMouseMovementBeforeHidingControls() const { return m_timeWithoutMouseMovementBeforeHidingControls; }267 268 241 bool hiddenPageCSSAnimationSuspensionEnabled() const { return m_hiddenPageCSSAnimationSuspensionEnabled; } 269 242 WEBCORE_EXPORT void setHiddenPageCSSAnimationSuspensionEnabled(bool); 270 271 WEBCORE_EXPORT void setFontFallbackPrefersPictographs(bool);272 bool fontFallbackPrefersPictographs() const { return m_fontFallbackPrefersPictographs; }273 243 274 244 static bool lowPowerVideoAudioBufferSizeEnabled() { return gLowPowerVideoAudioBufferSizeEnabled; } … … 305 275 static bool customPasteboardDataEnabled() { return gCustomPasteboardDataEnabled; } 306 276 WEBCORE_EXPORT static bool defaultCustomPasteboardDataEnabled(); 307 308 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)309 void setMediaKeysStorageDirectory(const String& directory) { m_mediaKeysStorageDirectory = directory; }310 const String& mediaKeysStorageDirectory() const { return m_mediaKeysStorageDirectory; }311 #endif312 277 313 278 #if ENABLE(MEDIA_STREAM) 314 void setMediaDeviceIdentifierStorageDirectory(const String& directory) { m_mediaDeviceIdentifierStorageDirectory = directory; }315 const String& mediaDeviceIdentifierStorageDirectory() const { return m_mediaDeviceIdentifierStorageDirectory; }316 317 279 static bool mockCaptureDevicesEnabled(); 318 280 WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool); … … 321 283 WEBCORE_EXPORT static void setMediaCaptureRequiresSecureConnection(bool); 322 284 #endif 323 324 #if ENABLE(APPLE_PAY)325 bool applePayEnabled() const { return m_applePayEnabled; }326 void setApplePayEnabled(bool applePayEnabled) { m_applePayEnabled = applePayEnabled; }327 328 bool applePayCapabilityDisclosureAllowed() const { return m_applePayCapabilityDisclosureAllowed; }329 void setApplePayCapabilityDisclosureAllowed(bool applePayCapabilityDisclosureAllowed) { m_applePayCapabilityDisclosureAllowed = applePayCapabilityDisclosureAllowed; }330 #endif331 332 WEBCORE_EXPORT void setForcePendingWebGLPolicy(bool);333 bool isForcePendingWebGLPolicy() const { return m_forcePendingWebGLPolicy; }334 285 335 286 WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool); … … 355 306 Seconds m_minimumDOMTimerInterval; 356 307 357 bool m_isJavaEnabled : 1;358 bool m_isJavaEnabledForLocalFiles : 1;359 308 bool m_loadsImagesAutomatically : 1; 360 309 bool m_areImagesEnabled : 1; 361 bool m_preferMIMETypeForImages : 1;362 310 bool m_arePluginsEnabled : 1; 363 311 bool m_isScriptEnabled : 1; 364 bool m_needsAdobeFrameReloadingQuirk : 1;365 312 bool m_usesPageCache : 1; 366 unsigned m_fontRenderingMode : 1;367 313 bool m_showTiledScrollingIndicator : 1; 368 314 bool m_backgroundShouldExtendBeyondPage : 1; 369 315 bool m_dnsPrefetchingEnabled : 1; 370 371 #if ENABLE(TOUCH_EVENTS)372 bool m_touchEventEmulationEnabled : 1;373 #endif374 316 bool m_scrollingPerformanceLoggingEnabled : 1; 375 376 Seconds m_timeWithoutMouseMovementBeforeHidingControls { 3_s };377 317 378 318 Timer m_setImageLoadingSettingsTimer; … … 381 321 bool m_hiddenPageDOMTimerThrottlingEnabled : 1; 382 322 bool m_hiddenPageCSSAnimationSuspensionEnabled : 1; 383 bool m_fontFallbackPrefersPictographs : 1;384 385 bool m_forcePendingWebGLPolicy : 1;386 323 387 324 #if ENABLE(RESOURCE_USAGE) … … 419 356 WEBCORE_EXPORT static bool gManageAudioSession; 420 357 WEBCORE_EXPORT static bool gCustomPasteboardDataEnabled; 421 422 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)423 String m_mediaKeysStorageDirectory;424 #endif425 358 426 359 #if ENABLE(MEDIA_STREAM) 427 String m_mediaDeviceIdentifierStorageDirectory;428 360 static bool gMockCaptureDevicesEnabled; 429 361 static bool gMediaCaptureRequiresSecureConnection; 430 #endif431 432 #if ENABLE(APPLE_PAY)433 bool m_applePayEnabled { false };434 bool m_applePayCapabilityDisclosureAllowed { true };435 362 #endif 436 363
Note: See TracChangeset
for help on using the changeset viewer.