Skip to content

Commit

Permalink
Remove PaintTimingEnabled preference
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265194

Reviewed by Timothy Hatcher.

Reduce the number of branches to maintain. This enables this feature in
WebKitLegacy, but that seems acceptable (perhaps even desired as per
the FIXME).

Also tidy up a couple of prior preference removals.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::supportsPaintTiming const):
* Source/WebCore/page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setPaintTimingEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::paintTimingEnabled): Deleted.
* Source/WebCore/page/PerformanceEntry.cpp:
(WebCore::PerformanceEntry::parseEntryTypeString):
* Source/WebCore/page/PerformancePaintTiming.idl:
* Source/WebKit/UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPaintTimingEnabled):
(WKPreferencesGetPaintTimingEnabled):
(WKPreferencesSetRequestAnimationFrameEnabled):
(WKPreferencesGetRequestAnimationFrameEnabled):
(WKPreferencesSetIntersectionObserverEnabled):
(WKPreferencesGetIntersectionObserverEnabled):
(WKPreferencesSetMenuItemElementEnabled):
(WKPreferencesGetMenuItemElementEnabled):
* Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:
* Tools/DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

Canonical link: https://commits.webkit.org/271039@main
  • Loading branch information
annevk committed Nov 22, 2023
1 parent bb42e43 commit ac0de29
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 71 deletions.
13 changes: 0 additions & 13 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4915,19 +4915,6 @@ PageVisibilityBasedProcessSuppressionEnabled:
WebKit:
default: true

# FIXME: This is on by default in WebKit2. Perhaps we should consider turning it on for WebKitLegacy as well.
PaintTimingEnabled:
type: bool
status: mature
humanReadableName: "Paint Timing"
humanReadableDescription: "Enable PaintTiming API"
webcoreBinding: DeprecatedGlobalSettings
defaultValue:
WebKitLegacy:
default: false
WebKit:
default: true

PassiveTouchListenersAsDefaultOnDocument:
type: bool
status: embedder
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/dom/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3526,7 +3526,7 @@ bool Document::isLayoutPending() const

bool Document::supportsPaintTiming() const
{
return DeprecatedGlobalSettings::paintTimingEnabled() && securityOrigin().isSameOriginDomain(topOrigin());
return securityOrigin().isSameOriginDomain(topOrigin());
}

// https://w3c.github.io/paint-timing/#ref-for-mark-paint-timing
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/page/DeprecatedGlobalSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ class DeprecatedGlobalSettings {
WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool);
WEBCORE_EXPORT static bool allowsAnySSLCertificate();

static void setPaintTimingEnabled(bool isEnabled) { shared().m_isPaintTimingEnabled = isEnabled; }
static bool paintTimingEnabled() { return shared().m_isPaintTimingEnabled; }

static void setCustomPasteboardDataEnabled(bool isEnabled) { shared().m_isCustomPasteboardDataEnabled = isEnabled; }
static bool customPasteboardDataEnabled() { return shared().m_isCustomPasteboardDataEnabled; }

Expand Down Expand Up @@ -207,8 +204,6 @@ class DeprecatedGlobalSettings {
bool m_trackingPreventionEnabled { false };
bool m_allowsAnySSLCertificate { false };

bool m_isPaintTimingEnabled { false };

bool m_isCustomPasteboardDataEnabled { false };
bool m_isRestrictedHTTPResponseAccess { true };
bool m_isServerTimingEnabled { false };
Expand Down
8 changes: 2 additions & 6 deletions Source/WebCore/page/PerformanceEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include "config.h"
#include "PerformanceEntry.h"

#include "DeprecatedGlobalSettings.h"

namespace WebCore {

DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(PerformanceEntry);
Expand All @@ -59,10 +57,8 @@ std::optional<PerformanceEntry::Type> PerformanceEntry::parseEntryTypeString(con
if (entryType == "resource"_s)
return std::optional<Type>(Type::Resource);

if (DeprecatedGlobalSettings::paintTimingEnabled()) {
if (entryType == "paint"_s)
return std::optional<Type>(Type::Paint);
}
if (entryType == "paint"_s)
return std::optional<Type>(Type::Paint);

return std::nullopt;
}
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/page/PerformancePaintTiming.idl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
typedef double DOMHighResTimeStamp;

[
EnabledByDeprecatedGlobalSetting=PaintTimingEnabled,
Exposed=Window
] interface PerformancePaintTiming : PerformanceEntry {
};
73 changes: 36 additions & 37 deletions Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,6 @@ bool WKPreferencesGetShouldRespectImageOrientation(WKPreferencesRef preferencesR
return toImpl(preferencesRef)->shouldRespectImageOrientation();
}

void WKPreferencesSetRequestAnimationFrameEnabled(WKPreferencesRef, bool)
{
}

bool WKPreferencesGetRequestAnimationFrameEnabled(WKPreferencesRef)
{
return true;
}

void WKPreferencesSetStorageBlockingPolicy(WKPreferencesRef preferencesRef, WKStorageBlockingPolicy policy)
{
toImpl(preferencesRef)->setStorageBlockingPolicy(static_cast<uint32_t>(toStorageBlockingPolicy(policy)));
Expand Down Expand Up @@ -1537,34 +1528,6 @@ bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->downloadAttributeEnabled();
}

void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}

bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef preferencesRef)
{
return true;
}

void WKPreferencesSetMenuItemElementEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}

bool WKPreferencesGetMenuItemElementEnabled(WKPreferencesRef preferencesRef)
{
return false;
}

void WKPreferencesSetPaintTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
{
toImpl(preferencesRef)->setPaintTimingEnabled(flag);
}

bool WKPreferencesGetPaintTimingEnabled(WKPreferencesRef preferencesRef)
{
return toImpl(preferencesRef)->paintTimingEnabled();
}

void WKPreferencesSetWebRTCPlatformCodecsInGPUProcessEnabled(WKPreferencesRef preferencesRef, bool flag)
{
toImpl(preferencesRef)->setWebRTCPlatformCodecsInGPUProcessEnabled(flag);
Expand Down Expand Up @@ -1898,6 +1861,24 @@ bool WKPreferencesGetRequestVideoFrameCallbackEnabled(WKPreferencesRef preferenc

// The following are all deprecated and do nothing. They should be removed when possible.

void WKPreferencesSetPaintTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}

bool WKPreferencesGetPaintTimingEnabled(WKPreferencesRef preferencesRef)
{
return true;
}

void WKPreferencesSetRequestAnimationFrameEnabled(WKPreferencesRef, bool)
{
}

bool WKPreferencesGetRequestAnimationFrameEnabled(WKPreferencesRef)
{
return true;
}

void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef, bool)
{
}
Expand Down Expand Up @@ -1997,6 +1978,15 @@ bool WKPreferencesGetFetchAPIKeepAliveEnabled(WKPreferencesRef)
return true;
}

void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}

bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef preferencesRef)
{
return true;
}

void WKPreferencesSetIsSecureContextAttributeEnabled(WKPreferencesRef, bool)
{
}
Expand Down Expand Up @@ -2087,6 +2077,15 @@ bool WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesR
return false;
}

void WKPreferencesSetMenuItemElementEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}

bool WKPreferencesGetMenuItemElementEnabled(WKPreferencesRef preferencesRef)
{
return false;
}

void WKPreferencesSetReferrerPolicyAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}
Expand Down
6 changes: 2 additions & 4 deletions Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,6 @@ WK_EXPORT bool WKPreferencesGetCustomPasteboardDataEnabled(WKPreferencesRef);
WK_EXPORT void WKPreferencesSetWebShareEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetWebShareEnabled(WKPreferencesRef);

// Defaults to false
WK_EXPORT void WKPreferencesSetPaintTimingEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetPaintTimingEnabled(WKPreferencesRef);

// Defaults to false
WK_EXPORT void WKPreferencesSetWebRTCPlatformCodecsInGPUProcessEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetWebRTCPlatformCodecsInGPUProcessEnabled(WKPreferencesRef);
Expand Down Expand Up @@ -507,6 +503,8 @@ WK_EXPORT bool WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode(WKPreferencesR

// The following are all deprecated and do nothing. They should be removed when possible.

WK_EXPORT void WKPreferencesSetPaintTimingEnabled(WKPreferencesRef, bool flag) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetPaintTimingEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetRequestAnimationFrameEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetRequestAnimationFrameEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
Expand Down
4 changes: 0 additions & 4 deletions Tools/DumpRenderTree/TestOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const TestFeatures& TestOptions::defaults()
{ "MockScrollbarsEnabled", true },
{ "NeedsStorageAccessFromFileURLsQuirk", false },
{ "OfflineWebApplicationCacheEnabled", true },
{ "PaintTimingEnabled", true },
{ "PushAPIEnabled", true },
{ "ReferrerPolicyAttributeEnabled", true },
{ "RemotePlaybackEnabled", true },
Expand Down Expand Up @@ -152,15 +151,12 @@ const TestFeatures& TestOptions::defaults()
{ "DOMPasteAllowed", true },
{ "DeveloperExtrasEnabled", true },
{ "HiddenPageDOMTimerThrottlingEnabled", false },
{ "IntersectionObserverEnabled", false },
{ "JavaScriptCanAccessClipboard", true },
{ "JavaScriptCanOpenWindowsAutomatically", true },
{ "JavaScriptEnabled", true },
{ "KeygenElementEnabled", false },
{ "LayoutFormattingContextIntegrationEnabled", true },
{ "LoadsImagesAutomatically", true },
{ "MainContentUserGestureOverrideEnabled", false },
{ "MenuItemElementEnabled", false },
{ "MockScrollbarsControllerEnabled", false },
{ "ModernMediaControlsEnabled", true },
{ "NeedsStorageAccessFromFileURLsQuirk", false },
Expand Down

0 comments on commit ac0de29

Please sign in to comment.