Diff
Modified: trunk/Source/WebCore/ChangeLog (223623 => 223624)
--- trunk/Source/WebCore/ChangeLog 2017-10-18 19:30:28 UTC (rev 223623)
+++ trunk/Source/WebCore/ChangeLog 2017-10-18 20:18:38 UTC (rev 223624)
@@ -1,3 +1,57 @@
+2017-10-18 Sam Weinig <[email protected]>
+
+ [Settings] Move remaining simple settings to Settings.in
+ https://bugs.webkit.org/show_bug.cgi?id=177730
+ <rdar://problem/34763346>
+
+ Reviewed by Daniel Bates.
+
+ * Scripts/GenerateSettings/Settings.py:
+ (Setting.__init__):
+ (Setting.__str__):
+ (Setting.getterFunctionName):
+ (parseInput):
+
+ Add support for parsing the 'getter' option.
+
+ * page/Settings.in:
+
+ Migrate simple settings from SettingsBase to here.
+
+ * page/SettingsBase.cpp:
+ (WebCore::SettingsBase::SettingsBase):
+ (WebCore::SettingsBase::setJavaEnabled): Deleted.
+ (WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
+ (WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
+ (WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
+ (WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
+ (WebCore::SettingsBase::setFontRenderingMode): Deleted.
+ (WebCore::SettingsBase::fontRenderingMode const): Deleted.
+ (WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
+ (WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
+ * page/SettingsBase.h:
+ (WebCore::SettingsBase::isJavaEnabled const): Deleted.
+ (WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
+ (WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
+ (WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
+ (WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
+ (WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
+ (WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
+ (WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
+ (WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
+ (WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
+ (WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
+ (WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
+ (WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
+ (WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
+ (WebCore::SettingsBase::applePayEnabled const): Deleted.
+ (WebCore::SettingsBase::setApplePayEnabled): Deleted.
+ (WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
+ (WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
+ (WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.
+
+ Remove simple settings.
+
2017-10-18 Zalan Bujtas <[email protected]>
[FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
Modified: trunk/Source/WebCore/Scripts/GenerateSettings/Settings.py (223623 => 223624)
--- trunk/Source/WebCore/Scripts/GenerateSettings/Settings.py 2017-10-18 19:30:28 UTC (rev 223623)
+++ trunk/Source/WebCore/Scripts/GenerateSettings/Settings.py 2017-10-18 20:18:38 UTC (rev 223624)
@@ -61,39 +61,38 @@
class Setting:
def __init__(self, name):
self.name = name
- self.type = "bool"
+ self.type = 'bool'
self.initial = None
self.conditional = None
self.setNeedsStyleRecalcInAllFrames = None
+ self.getter = None
def __str__(self):
- result = self.name + " TYPE:" + self.type
+ result = self.name + ' TYPE:' + self.type
if (self.initial):
- result += " INIT:" + self.initial
+ result += ' INIT:' + self.initial
if (self.conditional):
- result += " COND:" + self.conditional
+ result += ' COND:' + self.conditional
if (self.setNeedsStyleRecalcInAllFrames):
- result += " RECALC:" + self.setNeedsStyleRecalcInAllFrames
+ result += ' RECALC:' + self.setNeedsStyleRecalcInAllFrames
+ if (self.getter):
+ result += ' GETTER:' + self.getter
return result
def hasComplexSetter(self):
- if self.setNeedsStyleRecalcInAllFrames:
- return True
- return False
+ return self.setNeedsStyleRecalcInAllFrames
def typeIsValueType(self):
- if self.type == 'String':
- return False
- return True
+ return self.type != 'String'
def setterFunctionName(self):
- for prefix in ["css", "xss", "ftp", "dom"]:
+ for prefix in ['css', 'xss', 'ftp', 'dom']:
if self.name.startswith(prefix):
- return "set" + uppercaseFirstN(self.name, len(prefix))
- return "set" + uppercaseFirstN(self.name, 1)
+ return 'set' + uppercaseFirstN(self.name, len(prefix))
+ return 'set' + uppercaseFirstN(self.name, 1)
def getterFunctionName(self):
- return self.name
+ return self.getter or self.name
def idlType(self):
# FIXME: Add support for more types including enumerate types.
@@ -122,32 +121,36 @@
def makeConditionalString(conditional):
conditionals = conditional.split('|')
- return "ENABLE(" + ") || ENABLE(".join(conditionals) + ")"
+ return 'ENABLE(' + ') || ENABLE('.join(conditionals) + ')'
def parseInput(input):
settings = {}
- for line in open(input, "r"):
- if not line.startswith("#") and not line.isspace():
- (name, optionsString) = line.rstrip().split(' ', 1)
+ with open(input, 'r') as file:
+ for line in file:
+ if not line.startswith('#') and not line.isspace():
- options = re.split(r' *, *', optionsString)
+ (name, optionsString) = line.rstrip().split(' ', 1)
- setting = Setting(name)
- for option in options:
- (name, value) = re.split(r' *= *', option)
- if (name == 'type'):
- setting.type = value
- if (name == 'initial'):
- setting.initial = value
- if (name == 'conditional'):
- setting.conditional = value
- if (name == 'setNeedsStyleRecalcInAllFrames'):
- setting.setNeedsStyleRecalcInAllFrames = value
+ options = re.split(r' *, *', optionsString)
- # FIXME: ASSERT something about setting.initial
+ setting = Setting(name)
+ for option in options:
+ (name, value) = re.split(r' *= *', option)
+ if (name == 'type'):
+ setting.type = value
+ if (name == 'initial'):
+ setting.initial = value
+ if (name == 'conditional'):
+ setting.conditional = value
+ if (name == 'setNeedsStyleRecalcInAllFrames'):
+ setting.setNeedsStyleRecalcInAllFrames = value
+ if (name == 'getter'):
+ setting.getter = value
- settings[setting.name] = setting
+ # FIXME: ASSERT something about setting.initial
+ settings[setting.name] = setting
+
return settings
Modified: trunk/Source/WebCore/page/Settings.in (223623 => 223624)
--- trunk/Source/WebCore/page/Settings.in 2017-10-18 19:30:28 UTC (rev 223623)
+++ trunk/Source/WebCore/page/Settings.in 2017-10-18 20:18:38 UTC (rev 223624)
@@ -66,6 +66,7 @@
showDebugBorders initial=false, setNeedsStyleRecalcInAllFrames=1
showRepaintCounter initial=false, setNeedsStyleRecalcInAllFrames=1
visibleDebugOverlayRegions type=DebugOverlayRegions, initial=0
+showTiledScrollingIndicator initial=false
# This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
# making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
@@ -303,10 +304,33 @@
allowMediaContentTypesRequiringHardwareSupportAsFallback initial=false
-paymentRequestEnabled initial=false, conditional=PAYMENT_REQUEST
+storageAccessAPIEnabled initial=false
+timeWithoutMouseMovementBeforeHidingControls type=Seconds, initial=3_s
+
+fontFallbackPrefersPictographs initial=false, setNeedsStyleRecalcInAllFrames=1
+
fontLoadTimingOverride type=FontLoadTimingOverride, initial=FontLoadTimingOverride::None
shouldIgnoreFontLoadCompletions initial=false
-storageAccessAPIEnabled initial=false
+paymentRequestEnabled initial=false, conditional=PAYMENT_REQUEST
+applePayEnabled initial=false, conditional=APPLE_PAY
+applePayCapabilityDisclosureAllowed initial=true, conditional=APPLE_PAY
+javaEnabled initial=false, getter=isJavaEnabled
+javaEnabledForLocalFiles initial=true, getter=isJavaEnabledForLocalFiles
+
+fontRenderingMode type=FontRenderingMode, initial=FontRenderingMode::Normal
+
+preferMIMETypeForImages initial=false
+
+forcePendingWebGLPolicy initial=false, getter=isForcePendingWebGLPolicy
+
+mediaKeysStorageDirectory type=String, conditional=LEGACY_ENCRYPTED_MEDIA
+mediaDeviceIdentifierStorageDirectory type=String, conditional=MEDIA_STREAM
+
+# FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
+# can fix the bug from their end.
+needsAdobeFrameReloadingQuirk initial=false, getter=needsAcrobatFrameReloadingQuirk
+
+touchEventEmulationEnabled initial=false, getter=isTouchEventEmulationEnabled, conditional=TOUCH_EVENTS
Modified: trunk/Source/WebCore/page/SettingsBase.cpp (223623 => 223624)
--- trunk/Source/WebCore/page/SettingsBase.cpp 2017-10-18 19:30:28 UTC (rev 223623)
+++ trunk/Source/WebCore/page/SettingsBase.cpp 2017-10-18 20:18:38 UTC (rev 223624)
@@ -146,28 +146,17 @@
, m_fontGenericFamilies(std::make_unique<FontGenericFamilies>())
, m_layoutInterval(layoutScheduleThreshold)
, m_minimumDOMTimerInterval(DOMTimer::defaultMinimumInterval())
- , m_isJavaEnabled(false)
- , m_isJavaEnabledForLocalFiles(true)
, m_loadsImagesAutomatically(false)
, m_areImagesEnabled(true)
- , m_preferMIMETypeForImages(false)
, m_arePluginsEnabled(false)
, m_isScriptEnabled(false)
- , m_needsAdobeFrameReloadingQuirk(false)
, m_usesPageCache(false)
- , m_fontRenderingMode(0)
- , m_showTiledScrollingIndicator(false)
, m_backgroundShouldExtendBeyondPage(false)
, m_dnsPrefetchingEnabled(false)
-#if ENABLE(TOUCH_EVENTS)
- , m_touchEventEmulationEnabled(false)
-#endif
, m_scrollingPerformanceLoggingEnabled(false)
, m_setImageLoadingSettingsTimer(*this, &SettingsBase::imageLoadingSettingsTimerFired)
, m_hiddenPageDOMTimerThrottlingEnabled(false)
, m_hiddenPageCSSAnimationSuspensionEnabled(false)
- , m_fontFallbackPrefersPictographs(false)
- , m_forcePendingWebGLPolicy(false)
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -334,16 +323,6 @@
#endif
}
-void SettingsBase::setJavaEnabled(bool isJavaEnabled)
-{
- m_isJavaEnabled = isJavaEnabled;
-}
-
-void SettingsBase::setJavaEnabledForLocalFiles(bool isJavaEnabledForLocalFiles)
-{
- m_isJavaEnabledForLocalFiles = isJavaEnabledForLocalFiles;
-}
-
void SettingsBase::setImagesEnabled(bool areImagesEnabled)
{
m_areImagesEnabled = areImagesEnabled;
@@ -352,16 +331,6 @@
m_setImageLoadingSettingsTimer.startOneShot(0_s);
}
-void SettingsBase::setPreferMIMETypeForImages(bool preferMIMETypeForImages)
-{
- m_preferMIMETypeForImages = preferMIMETypeForImages;
-}
-
-void SettingsBase::setForcePendingWebGLPolicy(bool forced)
-{
- m_forcePendingWebGLPolicy = forced;
-}
-
void SettingsBase::setPluginsEnabled(bool arePluginsEnabled)
{
if (m_arePluginsEnabled == arePluginsEnabled)
@@ -382,13 +351,6 @@
m_page->userStyleSheetLocationChanged();
}
-// FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
-// can fix the bug from their end.
-void SettingsBase::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUnchangedSRC)
-{
- m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
-}
-
void SettingsBase::setMinimumDOMTimerInterval(Seconds interval)
{
auto oldTimerInterval = std::exchange(m_minimumDOMTimerInterval, interval);
@@ -423,20 +385,6 @@
PageCache::singleton().pruneToSizeNow(0, PruningReason::None);
}
-void SettingsBase::setFontRenderingMode(FontRenderingMode mode)
-{
- if (fontRenderingMode() == mode)
- return;
- m_fontRenderingMode = static_cast<int>(mode);
- if (m_page)
- m_page->setNeedsRecalcStyleInAllFrames();
-}
-
-FontRenderingMode SettingsBase::fontRenderingMode() const
-{
- return static_cast<FontRenderingMode>(m_fontRenderingMode);
-}
-
void SettingsBase::setDNSPrefetchingEnabled(bool dnsPrefetchingEnabled)
{
if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled)
@@ -447,14 +395,6 @@
m_page->dnsPrefetchingStateChanged();
}
-void SettingsBase::setShowTiledScrollingIndicator(bool enabled)
-{
- if (m_showTiledScrollingIndicator == enabled)
- return;
-
- m_showTiledScrollingIndicator = enabled;
-}
-
#if ENABLE(RESOURCE_USAGE)
void SettingsBase::setResourceUsageOverlayVisible(bool visible)
{
@@ -640,16 +580,6 @@
m_page->hiddenPageCSSAnimationSuspensionStateChanged();
}
-void SettingsBase::setFontFallbackPrefersPictographs(bool preferPictographs)
-{
- if (m_fontFallbackPrefersPictographs == preferPictographs)
- return;
-
- m_fontFallbackPrefersPictographs = preferPictographs;
- if (m_page)
- m_page->setNeedsRecalcStyleInAllFrames();
-}
-
void SettingsBase::setLowPowerVideoAudioBufferSizeEnabled(bool flag)
{
gLowPowerVideoAudioBufferSizeEnabled = flag;
Modified: trunk/Source/WebCore/page/SettingsBase.h (223623 => 223624)
--- trunk/Source/WebCore/page/SettingsBase.h 2017-10-18 19:30:28 UTC (rev 223623)
+++ trunk/Source/WebCore/page/SettingsBase.h 2017-10-18 20:18:38 UTC (rev 223624)
@@ -150,19 +150,9 @@
WEBCORE_EXPORT void setScriptEnabled(bool);
- WEBCORE_EXPORT void setJavaEnabled(bool);
- bool isJavaEnabled() const { return m_isJavaEnabled; }
-
- // This settings is only consulted if isJavaEnabled() returns true;
- WEBCORE_EXPORT void setJavaEnabledForLocalFiles(bool);
- bool isJavaEnabledForLocalFiles() const { return m_isJavaEnabledForLocalFiles; }
-
WEBCORE_EXPORT void setImagesEnabled(bool);
bool areImagesEnabled() const { return m_areImagesEnabled; }
- WEBCORE_EXPORT void setPreferMIMETypeForImages(bool);
- bool preferMIMETypeForImages() const { return m_preferMIMETypeForImages; }
-
WEBCORE_EXPORT void setPluginsEnabled(bool);
bool arePluginsEnabled() const { return m_arePluginsEnabled; }
@@ -172,9 +162,6 @@
WEBCORE_EXPORT void setUserStyleSheetLocation(const URL&);
const URL& userStyleSheetLocation() const { return m_userStyleSheetLocation; }
- WEBCORE_EXPORT void setNeedsAdobeFrameReloadingQuirk(bool);
- bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }
-
WEBCORE_EXPORT void setMinimumDOMTimerInterval(Seconds); // Initialized to DOMTimer::defaultMinimumInterval().
Seconds minimumDOMTimerInterval() const { return m_minimumDOMTimerInterval; }
@@ -189,12 +176,6 @@
WEBCORE_EXPORT void setUsesPageCache(bool);
bool usesPageCache() const { return m_usesPageCache; }
- void setFontRenderingMode(FontRenderingMode mode);
- FontRenderingMode fontRenderingMode() const;
-
- WEBCORE_EXPORT void setShowTiledScrollingIndicator(bool);
- bool showTiledScrollingIndicator() const { return m_showTiledScrollingIndicator; }
-
#if ENABLE(RESOURCE_USAGE)
bool resourceUsageOverlayVisible() const { return m_resourceUsageOverlayVisible; }
WEBCORE_EXPORT void setResourceUsageOverlayVisible(bool);
@@ -248,11 +229,6 @@
WEBCORE_EXPORT static void setUsesMockScrollAnimator(bool);
static bool usesMockScrollAnimator();
-#if ENABLE(TOUCH_EVENTS)
- void setTouchEventEmulationEnabled(bool enabled) { m_touchEventEmulationEnabled = enabled; }
- bool isTouchEventEmulationEnabled() const { return m_touchEventEmulationEnabled; }
-#endif
-
WEBCORE_EXPORT void setStorageBlockingPolicy(SecurityOrigin::StorageBlockingPolicy);
SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy() const { return m_storageBlockingPolicy; }
@@ -262,15 +238,9 @@
WEBCORE_EXPORT static void setShouldRespectPriorityInCSSAttributeSetters(bool);
static bool shouldRespectPriorityInCSSAttributeSetters();
- void setTimeWithoutMouseMovementBeforeHidingControls(Seconds time) { m_timeWithoutMouseMovementBeforeHidingControls = time; }
- Seconds timeWithoutMouseMovementBeforeHidingControls() const { return m_timeWithoutMouseMovementBeforeHidingControls; }
-
bool hiddenPageCSSAnimationSuspensionEnabled() const { return m_hiddenPageCSSAnimationSuspensionEnabled; }
WEBCORE_EXPORT void setHiddenPageCSSAnimationSuspensionEnabled(bool);
- WEBCORE_EXPORT void setFontFallbackPrefersPictographs(bool);
- bool fontFallbackPrefersPictographs() const { return m_fontFallbackPrefersPictographs; }
-
static bool lowPowerVideoAudioBufferSizeEnabled() { return gLowPowerVideoAudioBufferSizeEnabled; }
WEBCORE_EXPORT static void setLowPowerVideoAudioBufferSizeEnabled(bool);
@@ -304,16 +274,8 @@
static void setCustomPasteboardDataEnabled(bool enabled) { gCustomPasteboardDataEnabled = enabled; }
static bool customPasteboardDataEnabled() { return gCustomPasteboardDataEnabled; }
WEBCORE_EXPORT static bool defaultCustomPasteboardDataEnabled();
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
- void setMediaKeysStorageDirectory(const String& directory) { m_mediaKeysStorageDirectory = directory; }
- const String& mediaKeysStorageDirectory() const { return m_mediaKeysStorageDirectory; }
-#endif
#if ENABLE(MEDIA_STREAM)
- void setMediaDeviceIdentifierStorageDirectory(const String& directory) { m_mediaDeviceIdentifierStorageDirectory = directory; }
- const String& mediaDeviceIdentifierStorageDirectory() const { return m_mediaDeviceIdentifierStorageDirectory; }
-
static bool mockCaptureDevicesEnabled();
WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool);
@@ -321,17 +283,6 @@
WEBCORE_EXPORT static void setMediaCaptureRequiresSecureConnection(bool);
#endif
-#if ENABLE(APPLE_PAY)
- bool applePayEnabled() const { return m_applePayEnabled; }
- void setApplePayEnabled(bool applePayEnabled) { m_applePayEnabled = applePayEnabled; }
-
- bool applePayCapabilityDisclosureAllowed() const { return m_applePayCapabilityDisclosureAllowed; }
- void setApplePayCapabilityDisclosureAllowed(bool applePayCapabilityDisclosureAllowed) { m_applePayCapabilityDisclosureAllowed = applePayCapabilityDisclosureAllowed; }
-#endif
-
- WEBCORE_EXPORT void setForcePendingWebGLPolicy(bool);
- bool isForcePendingWebGLPolicy() const { return m_forcePendingWebGLPolicy; }
-
WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool);
static bool allowsAnySSLCertificate();
@@ -354,36 +305,22 @@
Seconds m_layoutInterval;
Seconds m_minimumDOMTimerInterval;
- bool m_isJavaEnabled : 1;
- bool m_isJavaEnabledForLocalFiles : 1;
bool m_loadsImagesAutomatically : 1;
bool m_areImagesEnabled : 1;
- bool m_preferMIMETypeForImages : 1;
bool m_arePluginsEnabled : 1;
bool m_isScriptEnabled : 1;
- bool m_needsAdobeFrameReloadingQuirk : 1;
bool m_usesPageCache : 1;
- unsigned m_fontRenderingMode : 1;
bool m_showTiledScrollingIndicator : 1;
bool m_backgroundShouldExtendBeyondPage : 1;
bool m_dnsPrefetchingEnabled : 1;
-
-#if ENABLE(TOUCH_EVENTS)
- bool m_touchEventEmulationEnabled : 1;
-#endif
bool m_scrollingPerformanceLoggingEnabled : 1;
- Seconds m_timeWithoutMouseMovementBeforeHidingControls { 3_s };
-
Timer m_setImageLoadingSettingsTimer;
void imageLoadingSettingsTimerFired();
bool m_hiddenPageDOMTimerThrottlingEnabled : 1;
bool m_hiddenPageCSSAnimationSuspensionEnabled : 1;
- bool m_fontFallbackPrefersPictographs : 1;
- bool m_forcePendingWebGLPolicy : 1;
-
#if ENABLE(RESOURCE_USAGE)
bool m_resourceUsageOverlayVisible { false };
#endif
@@ -418,22 +355,12 @@
#endif
WEBCORE_EXPORT static bool gManageAudioSession;
WEBCORE_EXPORT static bool gCustomPasteboardDataEnabled;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
- String m_mediaKeysStorageDirectory;
-#endif
#if ENABLE(MEDIA_STREAM)
- String m_mediaDeviceIdentifierStorageDirectory;
static bool gMockCaptureDevicesEnabled;
static bool gMediaCaptureRequiresSecureConnection;
#endif
-#if ENABLE(APPLE_PAY)
- bool m_applePayEnabled { false };
- bool m_applePayCapabilityDisclosureAllowed { true };
-#endif
-
static bool gLowPowerVideoAudioBufferSizeEnabled;
static bool gResourceLoadStatisticsEnabledEnabled;
static bool gAllowsAnySSLCertificate;