Diff
Modified: trunk/Source/WebCore/ChangeLog (223431 => 223432)
--- trunk/Source/WebCore/ChangeLog 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/ChangeLog 2017-10-16 20:33:32 UTC (rev 223432)
@@ -1,3 +1,57 @@
+2017-10-16 Sam Weinig <s...@webkit.org>
+
+ [Settings] Remove all custom code from Settings.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=178330
+
+ Reviewed by Simon Fraser.
+
+ Removes the two remaining functions out of Settings paving the way
+ for the file to be generated.
+
+ - pageDestroyed was moved down into SettingsBase.
+ - effectiveFrameFlattening was moved to FrameView (to reduce the need
+ for additional includes, the FrameFlattening enum was converted to
+ an enum class to allow it to be forward declared).
+
+ Also moves default values into SettingsDefaultValues.h
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+ Add new files.
+
+ * page/FrameView.cpp:
+ * page/FrameView.h:
+
+ Move effectiveFrameFlattening function here from Settings.
+
+ * page/Settings.cpp:
+ * page/Settings.h:
+
+ Move effectiveFrameFlattening, pageDestroyed and default values out.
+
+ * page/Settings.in:
+
+ Update for turning FrameFlattening into an enum class.
+
+ * page/SettingsBase.h:
+
+ Turn FrameFlattening into an enum class and move pageDestroyed here.
+
+ * page/SettingsDefaultValues.h: Added.
+
+ Move all the default values from Settings here.
+
+ * rendering/RenderFrameSet.cpp:
+ * rendering/RenderIFrame.cpp:
+ * rendering/RenderView.cpp:
+
+ Get effectiveFrameFlattening from the FrameView.
+
+ * testing/InternalSettings.cpp:
+ * testing/InternalSettings.h:
+
+ Update now that FrameFlattening is an enum class.
+
2017-10-16 Maureen Daum <md...@apple.com>
If we fail to delete any database file, don't remove its information from the tracker database
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (223431 => 223432)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-10-16 20:33:32 UTC (rev 223432)
@@ -11504,6 +11504,7 @@
7C6579ED1E00856600E3A27A /* JSApplePayShippingMethod.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayShippingMethod.cpp; sourceTree = "<group>"; };
7C6579EE1E00856600E3A27A /* JSApplePayShippingMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayShippingMethod.h; sourceTree = "<group>"; };
7C6752BA1B06E82000C279CB /* NonElementParentNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NonElementParentNode.idl; sourceTree = "<group>"; };
+ 7C6EFEEA1F946A2E00FFAD41 /* SettingsDefaultValues.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SettingsDefaultValues.h; sourceTree = "<group>"; };
7C73FB05191EF416007DE061 /* UserMessageHandlersNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandlersNamespace.cpp; sourceTree = "<group>"; };
7C73FB06191EF417007DE061 /* UserMessageHandlersNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlersNamespace.h; sourceTree = "<group>"; };
7C73FB09191EF49F007DE061 /* UserMessageHandlersNamespace.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = UserMessageHandlersNamespace.idl; sourceTree = "<group>"; };
@@ -19920,6 +19921,7 @@
BC59DEF8169DEDC30016AC34 /* Settings.in */,
7CC6609B1F93057900D500E9 /* SettingsBase.cpp */,
7CC660991F93057800D500E9 /* SettingsBase.h */,
+ 7C6EFEEA1F946A2E00FFAD41 /* SettingsDefaultValues.h */,
5C688AA21D38126F000B54FA /* SocketProvider.cpp */,
5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */,
626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */,
Modified: trunk/Source/WebCore/page/FrameView.cpp (223431 => 223432)
--- trunk/Source/WebCore/page/FrameView.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/page/FrameView.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -566,9 +566,21 @@
m_margins.setHeight(h);
}
+FrameFlattening FrameView::effectiveFrameFlattening() const
+{
+#if PLATFORM(IOS)
+ // On iOS when async frame scrolling is enabled, it does not make sense to use full frame flattening.
+ // In that case, we just consider that frame flattening is disabled. This allows people to test
+ // frame scrolling on iOS by enabling "Async Frame Scrolling" via the Safari menu.
+ if (frame().settings().asyncFrameScrollingEnabled() && frame().settings().frameFlattening() == FrameFlattening::FullyEnabled)
+ return FrameFlattening::Disabled;
+#endif
+ return frame().settings().frameFlattening();
+}
+
bool FrameView::frameFlatteningEnabled() const
{
- return frame().settings().effectiveFrameFlattening() != FrameFlatteningDisabled;
+ return effectiveFrameFlattening() != FrameFlattening::Disabled;
}
bool FrameView::isFrameFlatteningValidForThisFrame() const
Modified: trunk/Source/WebCore/page/FrameView.h (223431 => 223432)
--- trunk/Source/WebCore/page/FrameView.h 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/page/FrameView.h 2017-10-16 20:33:32 UTC (rev 223432)
@@ -61,6 +61,8 @@
class RenderView;
class RenderWidget;
+enum class FrameFlattening;
+
Pagination::Mode paginationModeForRenderStyle(const RenderStyle&);
class FrameView final : public ScrollView {
@@ -635,6 +637,8 @@
void setSpeculativeTilingDelayDisabledForTesting(bool disabled) { m_speculativeTilingDelayDisabledForTesting = disabled; }
+ WEBCORE_EXPORT FrameFlattening effectiveFrameFlattening() const;
+
protected:
bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final;
void scrollContentsSlowPath(const IntRect& updateRect) final;
Modified: trunk/Source/WebCore/page/Settings.cpp (223431 => 223432)
--- trunk/Source/WebCore/page/Settings.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/page/Settings.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -26,97 +26,11 @@
#include "config.h"
#include "Settings.h"
-#include "AudioSession.h"
-#include "BackForwardController.h"
-#include "CachedResourceLoader.h"
-#include "CookieStorage.h"
-#include "DOMTimer.h"
-#include "Database.h"
-#include "Document.h"
-#include "FontCascade.h"
-#include "FontGenericFamilies.h"
-#include "FrameTree.h"
-#include "FrameView.h"
-#include "HTMLMediaElement.h"
-#include "HistoryItem.h"
-#include "MainFrame.h"
#include "Page.h"
-#include "StorageMap.h"
-#include <limits>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/StdLibExtras.h>
+#include "SettingsDefaultValues.h"
namespace WebCore {
-// NOTEs
-// 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well as QtWebKit when built on Mac;
-// 2) EditingWindowsBehavior comprises Win32 build;
-// 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS (and then abusing the terminology);
-// 99) MacEditingBehavior is used as a fallback.
-static EditingBehaviorType editingBehaviorTypeForPlatform()
-{
- return
-#if PLATFORM(IOS)
- EditingIOSBehavior
-#elif OS(DARWIN)
- EditingMacBehavior
-#elif OS(WINDOWS)
- EditingWindowsBehavior
-#elif OS(UNIX)
- EditingUnixBehavior
-#else
- // Fallback
- EditingMacBehavior
-#endif
- ;
-}
-
-#if PLATFORM(COCOA)
-static const bool defaultYouTubeFlashPluginReplacementEnabled = true;
-#else
-static const bool defaultYouTubeFlashPluginReplacementEnabled = false;
-#endif
-
-#if PLATFORM(IOS)
-static const bool defaultFixedBackgroundsPaintRelativeToDocument = true;
-static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
-static const bool defaultAllowsInlineMediaPlayback = false;
-static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = true;
-static const bool defaultVideoPlaybackRequiresUserGesture = true;
-static const bool defaultAudioPlaybackRequiresUserGesture = true;
-static const bool defaultMediaDataLoadsAutomatically = false;
-static const bool defaultShouldRespectImageOrientation = true;
-static const bool defaultImageSubsamplingEnabled = true;
-static const bool defaultScrollingTreeIncludesFrames = true;
-static const bool defaultMediaControlsScaleWithPageZoom = true;
-static const bool defaultQuickTimePluginReplacementEnabled = true;
-#else
-static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
-static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
-static const bool defaultAllowsInlineMediaPlayback = true;
-static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = false;
-static const bool defaultVideoPlaybackRequiresUserGesture = false;
-static const bool defaultAudioPlaybackRequiresUserGesture = false;
-static const bool defaultMediaDataLoadsAutomatically = true;
-static const bool defaultShouldRespectImageOrientation = false;
-static const bool defaultImageSubsamplingEnabled = false;
-static const bool defaultScrollingTreeIncludesFrames = false;
-static const bool defaultMediaControlsScaleWithPageZoom = true;
-static const bool defaultQuickTimePluginReplacementEnabled = false;
-#endif
-
-static const bool defaultRequiresUserGestureToLoadVideo = true;
-static const bool defaultAllowsPictureInPictureMediaPlayback = true;
-
-static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5;
-#if USE(UNIFIED_TEXT_CHECKING)
-static const bool defaultUnifiedTextCheckerEnabled = true;
-#else
-static const bool defaultUnifiedTextCheckerEnabled = false;
-#endif
-static const bool defaultSmartInsertDeleteEnabled = true;
-static const bool defaultSelectTrailingWhitespaceEnabled = false;
-
Ref<Settings> Settings::create(Page* page)
{
return adoptRef(*new Settings(page));
@@ -134,16 +48,4 @@
SETTINGS_SETTER_BODIES
-FrameFlattening Settings::effectiveFrameFlattening()
-{
-#if PLATFORM(IOS)
- // On iOS when async frame scrolling is enabled, it does not make sense to use full frame flattening.
- // In that case, we just consider that frame flattening is disabled. This allows people to test
- // frame scrolling on iOS by enabling "Async Frame Scrolling" via the Safari menu.
- if (asyncFrameScrollingEnabled() && frameFlattening() == FrameFlatteningFullyEnabled)
- return FrameFlatteningDisabled;
-#endif
- return frameFlattening();
-}
-
} // namespace WebCore
Modified: trunk/Source/WebCore/page/Settings.h (223431 => 223432)
--- trunk/Source/WebCore/page/Settings.h 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/page/Settings.h 2017-10-16 20:33:32 UTC (rev 223432)
@@ -27,6 +27,8 @@
#pragma once
#include "SettingsBase.h"
+#include "SettingsMacros.h"
+#include <wtf/RefCounted.h>
namespace WebCore {
@@ -36,18 +38,12 @@
static Ref<Settings> create(Page*);
~Settings();
- void pageDestroyed() { m_page = nullptr; }
-
SETTINGS_GETTERS_AND_SETTERS
-
- WEBCORE_EXPORT FrameFlattening effectiveFrameFlattening();
-
private:
explicit Settings(Page*);
SETTINGS_MEMBER_VARIABLES
-
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/Settings.in (223431 => 223432)
--- trunk/Source/WebCore/page/Settings.in 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/page/Settings.in 2017-10-16 20:33:32 UTC (rev 223432)
@@ -175,7 +175,7 @@
autostartOriginPlugInSnapshottingEnabled initial=true
primaryPlugInSnapshotDetectionEnabled initial=true
maximumPlugInSnapshotAttempts type=unsigned, initial=20
-frameFlattening type=FrameFlattening, initial=FrameFlatteningDisabled
+frameFlattening type=FrameFlattening, initial=FrameFlattening::Disabled
asyncFrameScrollingEnabled initial=false
webSecurityEnabled initial=true
Modified: trunk/Source/WebCore/page/SettingsBase.h (223431 => 223432)
--- trunk/Source/WebCore/page/SettingsBase.h 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/page/SettingsBase.h 2017-10-16 20:33:32 UTC (rev 223432)
@@ -31,7 +31,7 @@
#include "EditingBehaviorTypes.h"
#include "IntSize.h"
#include "SecurityOrigin.h"
-#include "SettingsMacros.h"
+#include "StorageMap.h"
#include "TextFlags.h"
#include "Timer.h"
#include "URL.h"
@@ -88,10 +88,10 @@
#endif
};
-enum FrameFlattening {
- FrameFlatteningDisabled,
- FrameFlatteningEnabledForNonFullScreenIFrames,
- FrameFlatteningFullyEnabled
+enum class FrameFlattening {
+ Disabled,
+ EnabledForNonFullScreenIFrames,
+ FullyEnabled
};
typedef unsigned DebugOverlayRegions;
@@ -101,6 +101,8 @@
public:
~SettingsBase();
+ void pageDestroyed() { m_page = nullptr; }
+
enum class FontLoadTimingOverride { None, Block, Swap, Failure };
enum class ForcedAccessibilityValue { System, On, Off };
Added: trunk/Source/WebCore/page/SettingsDefaultValues.h (0 => 223432)
--- trunk/Source/WebCore/page/SettingsDefaultValues.h (rev 0)
+++ trunk/Source/WebCore/page/SettingsDefaultValues.h 2017-10-16 20:33:32 UTC (rev 223432)
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "EditingBehaviorTypes.h"
+
+namespace WebCore {
+
+// NOTEs
+// 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well as QtWebKit when built on Mac;
+// 2) EditingWindowsBehavior comprises Win32 build;
+// 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS (and then abusing the terminology);
+// 99) MacEditingBehavior is used as a fallback.
+inline EditingBehaviorType editingBehaviorTypeForPlatform()
+{
+#if PLATFORM(IOS)
+ return EditingIOSBehavior;
+#elif OS(DARWIN)
+ return EditingMacBehavior;
+#elif OS(WINDOWS)
+ return EditingWindowsBehavior;
+#elif OS(UNIX)
+ return EditingUnixBehavior;
+#else
+ // Fallback
+ return EditingMacBehavior;
+#endif
+
+}
+
+#if PLATFORM(COCOA)
+static const bool defaultYouTubeFlashPluginReplacementEnabled = true;
+#else
+static const bool defaultYouTubeFlashPluginReplacementEnabled = false;
+#endif
+
+#if PLATFORM(IOS)
+static const bool defaultFixedBackgroundsPaintRelativeToDocument = true;
+static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
+static const bool defaultAllowsInlineMediaPlayback = false;
+static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = true;
+static const bool defaultVideoPlaybackRequiresUserGesture = true;
+static const bool defaultAudioPlaybackRequiresUserGesture = true;
+static const bool defaultMediaDataLoadsAutomatically = false;
+static const bool defaultShouldRespectImageOrientation = true;
+static const bool defaultImageSubsamplingEnabled = true;
+static const bool defaultScrollingTreeIncludesFrames = true;
+static const bool defaultMediaControlsScaleWithPageZoom = true;
+static const bool defaultQuickTimePluginReplacementEnabled = true;
+#else
+static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
+static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
+static const bool defaultAllowsInlineMediaPlayback = true;
+static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = false;
+static const bool defaultVideoPlaybackRequiresUserGesture = false;
+static const bool defaultAudioPlaybackRequiresUserGesture = false;
+static const bool defaultMediaDataLoadsAutomatically = true;
+static const bool defaultShouldRespectImageOrientation = false;
+static const bool defaultImageSubsamplingEnabled = false;
+static const bool defaultScrollingTreeIncludesFrames = false;
+static const bool defaultMediaControlsScaleWithPageZoom = true;
+static const bool defaultQuickTimePluginReplacementEnabled = false;
+#endif
+
+static const bool defaultRequiresUserGestureToLoadVideo = true;
+static const bool defaultAllowsPictureInPictureMediaPlayback = true;
+
+static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5;
+#if USE(UNIFIED_TEXT_CHECKING)
+static const bool defaultUnifiedTextCheckerEnabled = true;
+#else
+static const bool defaultUnifiedTextCheckerEnabled = false;
+#endif
+static const bool defaultSmartInsertDeleteEnabled = true;
+static const bool defaultSelectTrailingWhitespaceEnabled = false;
+
+}
Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (223431 => 223432)
--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -651,7 +651,7 @@
bool RenderFrameSet::flattenFrameSet() const
{
- return settings().effectiveFrameFlattening() != FrameFlatteningDisabled;
+ return view().frameView().effectiveFrameFlattening() != FrameFlattening::Disabled;
}
void RenderFrameSet::startResizing(GridAxis& axis, int position)
Modified: trunk/Source/WebCore/rendering/RenderIFrame.cpp (223431 => 223432)
--- trunk/Source/WebCore/rendering/RenderIFrame.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/rendering/RenderIFrame.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -78,7 +78,7 @@
bool RenderIFrame::flattenFrame() const
{
- if (settings().effectiveFrameFlattening() == FrameFlatteningDisabled)
+ if (view().frameView().effectiveFrameFlattening() == FrameFlattening::Disabled)
return false;
if (style().width().isFixed() && style().height().isFixed()) {
@@ -89,7 +89,7 @@
if (style().width().value() <= 0 || style().height().value() <= 0)
return false;
// Do not flatten "fullscreen" iframes or they could become larger than the viewport.
- if (settings().effectiveFrameFlattening() <= FrameFlatteningEnabledForNonFullScreenIFrames && isFullScreenIFrame())
+ if (view().frameView().effectiveFrameFlattening() <= FrameFlattening::EnabledForNonFullScreenIFrames && isFullScreenIFrame())
return false;
}
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (223431 => 223432)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -59,7 +59,7 @@
struct FrameFlatteningLayoutDisallower {
FrameFlatteningLayoutDisallower(FrameView& frameView)
: m_frameView(frameView)
- , m_disallowLayout(frameView.frame().settings().effectiveFrameFlattening() != FrameFlatteningDisabled)
+ , m_disallowLayout(frameView.effectiveFrameFlattening() != FrameFlattening::Disabled)
{
if (m_disallowLayout)
m_frameView.startDisallowingLayout();
Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (223431 => 223432)
--- trunk/Source/WebCore/testing/InternalSettings.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -819,26 +819,11 @@
return Exception { InvalidAccessError };
}
-static FrameFlattening internalSettingsToWebCoreValue(InternalSettings::FrameFlatteningValue value)
+ExceptionOr<void> InternalSettings::setFrameFlattening(FrameFlatteningValue frameFlattening)
{
- switch (value) {
- case InternalSettings::FrameFlatteningValue::Disabled:
- return FrameFlatteningDisabled;
- case InternalSettings::FrameFlatteningValue::EnabledForNonFullScreenIFrames:
- return FrameFlatteningEnabledForNonFullScreenIFrames;
- case InternalSettings::FrameFlatteningValue::FullyEnabled:
- return FrameFlatteningFullyEnabled;
- }
-
- ASSERT_NOT_REACHED();
- return FrameFlatteningDisabled;
-}
-
-ExceptionOr<void> InternalSettings::setFrameFlattening(const FrameFlatteningValue& frameFlattening)
-{
if (!m_page)
return Exception { InvalidAccessError };
- settings().setFrameFlattening(internalSettingsToWebCoreValue(frameFlattening));
+ settings().setFrameFlattening(frameFlattening);
return { };
}
Modified: trunk/Source/WebCore/testing/InternalSettings.h (223431 => 223432)
--- trunk/Source/WebCore/testing/InternalSettings.h 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebCore/testing/InternalSettings.h 2017-10-16 20:33:32 UTC (rev 223432)
@@ -101,8 +101,8 @@
ExceptionOr<void> setShouldManageAudioSessionCategory(bool);
ExceptionOr<void> setCustomPasteboardDataEnabled(bool);
- enum class FrameFlatteningValue { Disabled, EnabledForNonFullScreenIFrames, FullyEnabled };
- ExceptionOr<void> setFrameFlattening(const FrameFlatteningValue&);
+ using FrameFlatteningValue = FrameFlattening;
+ ExceptionOr<void> setFrameFlattening(FrameFlatteningValue);
static void setAllowsAnySSLCertificate(bool);
Modified: trunk/Source/WebKit/ChangeLog (223431 => 223432)
--- trunk/Source/WebKit/ChangeLog 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKit/ChangeLog 2017-10-16 20:33:32 UTC (rev 223432)
@@ -1,3 +1,27 @@
+2017-10-16 Sam Weinig <s...@webkit.org>
+
+ [Settings] Remove all custom code from Settings.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=178330
+
+ Reviewed by Simon Fraser.
+
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetFrameFlatteningEnabled):
+ (WKPreferencesGetFrameFlatteningEnabled):
+ * UIProcess/API/glib/WebKitSettings.cpp:
+ (webkit_settings_get_enable_frame_flattening):
+ (webkit_settings_set_enable_frame_flattening):
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::setFrameFlatteningEnabled):
+
+ Update for naming changes of FrameFlattening now that it is an enum class.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::contentsSizeChanged const):
+
+ Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
+
2017-10-16 Chris Dumez <cdu...@apple.com>
[WK2][NetworkSession] Add support for resuming downloads
Modified: trunk/Source/WebKit/Shared/WebPreferencesDefinitions.h (223431 => 223432)
--- trunk/Source/WebKit/Shared/WebPreferencesDefinitions.h 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefinitions.h 2017-10-16 20:33:32 UTC (rev 223432)
@@ -60,7 +60,7 @@
#if PLATFORM(IOS)
#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK true
#define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED false
-#define DEFAULT_FRAME_FLATTENING FrameFlatteningFullyEnabled
+#define DEFAULT_FRAME_FLATTENING FrameFlattening::FullyEnabled
#define DEFAULT_SHOULD_PRINT_BACKGROUNDS true
#define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
#define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
@@ -78,7 +78,7 @@
#else
#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK false
#define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED true
-#define DEFAULT_FRAME_FLATTENING FrameFlatteningDisabled
+#define DEFAULT_FRAME_FLATTENING FrameFlattening::Disabled
#define DEFAULT_SHOULD_PRINT_BACKGROUNDS false
#define DEFAULT_TEXT_AREAS_ARE_RESIZABLE true
#define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY true
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (223431 => 223432)
--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -145,13 +145,13 @@
void WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef, bool frameFlatteningEnabled)
{
// FIXME: Expose more frame flattening values.
- toImpl(preferencesRef)->setFrameFlattening(frameFlatteningEnabled ? WebCore::FrameFlatteningFullyEnabled : WebCore::FrameFlatteningDisabled);
+ toImpl(preferencesRef)->setFrameFlattening(frameFlatteningEnabled ? static_cast<uint32_t>(WebCore::FrameFlattening::FullyEnabled) : static_cast<uint32_t>(WebCore::FrameFlattening::Disabled));
}
bool WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)
{
// FIXME: Expose more frame flattening values.
- return toImpl(preferencesRef)->frameFlattening() != WebCore::FrameFlatteningDisabled;
+ return toImpl(preferencesRef)->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
}
void WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef, bool pluginsEnabled)
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp (223431 => 223432)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -1620,7 +1620,7 @@
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
// FIXME: Expose more frame flattening values.
- return settings->priv->preferences->frameFlattening() != WebCore::FrameFlatteningDisabled;
+ return settings->priv->preferences->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
}
/**
@@ -1635,12 +1635,12 @@
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = priv->preferences->frameFlattening() != WebCore::FrameFlatteningDisabled;
+ bool currentValue = priv->preferences->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
if (currentValue == enabled)
return;
// FIXME: Expose more frame flattening values.
- priv->preferences->setFrameFlattening(enabled ? WebCore::FrameFlatteningFullyEnabled : WebCore::FrameFlatteningDisabled);
+ priv->preferences->setFrameFlattening(enabled ? static_cast<uint32_t>(WebCore::FrameFlattening::FullyEnabled) : static_cast<uint32_t>(WebCore::FrameFlattening::Disabled));
g_object_notify(G_OBJECT(settings), "enable-frame-flattening");
}
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp (223431 => 223432)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -300,7 +300,7 @@
{
const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
- (*iter)->settings().setFrameFlattening(enabled ? FrameFlatteningFullyEnabled : FrameFlatteningDisabled);
+ (*iter)->settings().setFrameFlattening(enabled ? FrameFlattening::FullyEnabled : FrameFlattening::Disabled);
}
void InjectedBundle::setAsyncFrameScrollingEnabled(WebPageGroupProxy* pageGroup, bool enabled)
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (223431 => 223432)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -566,7 +566,9 @@
void WebChromeClient::contentsSizeChanged(Frame& frame, const IntSize& size) const
{
- if (m_page.corePage()->settings().effectiveFrameFlattening() == FrameFlatteningDisabled) {
+ FrameView* frameView = frame.view();
+
+ if (frameView && frameView->effectiveFrameFlattening() == FrameFlattening::Disabled) {
WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
m_cachedFrameSetLargestFrame = largestFrame;
@@ -581,7 +583,6 @@
m_page.drawingArea()->mainFrameContentSizeChanged(size);
- FrameView* frameView = frame.view();
if (frameView && !frameView->delegatesScrolling()) {
bool hasHorizontalScrollbar = frameView->horizontalScrollbar();
bool hasVerticalScrollbar = frameView->verticalScrollbar();
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (223431 => 223432)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2017-10-16 20:33:32 UTC (rev 223432)
@@ -1,3 +1,15 @@
+2017-10-16 Sam Weinig <s...@webkit.org>
+
+ [Settings] Remove all custom code from Settings.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=178330
+
+ Reviewed by Simon Fraser.
+
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+
+ Update for naming changes of FrameFlattening now that it is an enum class.
+
2017-10-13 Alex Christensen <achristen...@webkit.org>
Remove Editor::simplifyMarkup
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (223431 => 223432)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2017-10-16 20:33:32 UTC (rev 223432)
@@ -517,9 +517,9 @@
[NSNumber numberWithBool:YES], WebKitLargeImageAsyncDecodingEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey,
#if PLATFORM(IOS)
- [NSNumber numberWithUnsignedInt:FrameFlatteningFullyEnabled], WebKitFrameFlatteningPreferenceKey,
+ [NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::FullyEnabled)], WebKitFrameFlatteningPreferenceKey,
#else
- [NSNumber numberWithUnsignedInt:FrameFlatteningDisabled], WebKitFrameFlatteningPreferenceKey,
+ [NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::Disabled)], WebKitFrameFlatteningPreferenceKey,
#endif
[NSNumber numberWithBool:NO], WebKitAsyncFrameScrollingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitSpatialNavigationEnabledPreferenceKey,
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (223431 => 223432)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2017-10-16 20:33:32 UTC (rev 223432)
@@ -1,3 +1,15 @@
+2017-10-16 Sam Weinig <s...@webkit.org>
+
+ [Settings] Remove all custom code from Settings.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=178330
+
+ Reviewed by Simon Fraser.
+
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+ Update for naming changes of FrameFlattening now that it is an enum class.
+
2017-10-11 Chris Dumez <cdu...@apple.com>
Modernize Geolocation code
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (223431 => 223432)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2017-10-16 20:29:35 UTC (rev 223431)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2017-10-16 20:33:32 UTC (rev 223432)
@@ -5421,7 +5421,7 @@
hr = prefsPrivate->isFrameFlatteningEnabled(&enabled);
if (FAILED(hr))
return hr;
- settings.setFrameFlattening(enabled ? FrameFlatteningFullyEnabled : FrameFlatteningDisabled);
+ settings.setFrameFlattening(enabled ? FrameFlattening::FullyEnabled : FrameFlattening::Disabled);
hr = prefsPrivate->acceleratedCompositingEnabled(&enabled);
if (FAILED(hr))