Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b1538aeb164007c99c2b3d6d7773318be36fff12
https://github.com/WebKit/WebKit/commit/b1538aeb164007c99c2b3d6d7773318be36fff12
Author: Brandon Stewart <[email protected]>
Date: 2025-12-16 (Tue, 16 Dec 2025)
Changed paths:
M Source/WebCore/page/Quirks.cpp
M Source/WebCore/page/Quirks.h
Log Message:
-----------
Reduce boilerplate in Quirks.cpp with
QUIRKS_EARLY_RETURN_IF_DISABLED_WITH_VALUE macro
https://bugs.webkit.org/show_bug.cgi?id=304113
rdar://problem/166445289
Reviewed by Brent Fulgham.
Introduce QUIRKS_EARLY_RETURN_IF_DISABLED_WITH_VALUE macro to reduce repetitive
boilerplate
in Quirks.cpp. This replaces 118 instances of the pattern:
if (!needsQuirks()) [[unlikely]]
return <value>;
with:
QUIRKS_EARLY_RETURN_IF_DISABLED_WITH_VALUE(<value>);
This reduces the file by ~114 lines and improves consistency. The macro accepts
any return value, allowing it to handle the various return types used
(bool, String, std::optional, and StorageAccessResult).
* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::needsFormControlToBeMouseFocusable const):
(WebCore::Quirks::needsAutoplayPlayPauseEvents const):
(WebCore::Quirks::needsSeekingSupportDisabled const):
(WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
(WebCore::Quirks::shouldAutoplayWebAudioForArbitraryUserGesture const):
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
(WebCore::Quirks::isTouchBarUpdateSuppressedForHiddenContentEditable const):
(WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
(WebCore::Quirks::shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreas
const):
(WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection
const):
(WebCore::Quirks::needsYouTubeMouseOutQuirk const):
(WebCore::Quirks::shouldDisableWritingSuggestionsByDefault const):
(WebCore::Quirks::storageAccessUserAgentStringQuirkForDomain):
(WebCore::Quirks::shouldDisableElementFullscreenQuirk const):
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented
const):
(WebCore::Quirks::shouldPreventDispatchOfTouchEvent const):
(WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
(WebCore::Quirks::shouldDisablePointerEventsQuirk const):
(WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand
const):
(WebCore::Quirks::needsGMailOverflowScrollQuirk const):
(WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
(WebCore::Quirks::needsPrimeVideoUserSelectNoneQuirk const):
(WebCore::Quirks::needsFacebookRemoveNotSupportedQuirk const):
(WebCore::Quirks::needsScrollbarWidthThinDisabledQuirk const):
(WebCore::Quirks::needsBodyScrollbarWidthNoneDisabledQuirk const):
(WebCore::Quirks::needsFullscreenDisplayNoneQuirk const):
(WebCore::Quirks::needsFullscreenObjectFitQuirk const):
(WebCore::Quirks::needsZomatoEmailLoginLabelQuirk const):
(WebCore::Quirks::needsGoogleMapsScrollingQuirk const):
(WebCore::Quirks::needsGoogleTranslateScrollingQuirk const):
(WebCore::Quirks::needsGeforcenowWarningDisplayNoneQuirk const):
(WebCore::Quirks::shouldSilenceResizeObservers const):
(WebCore::Quirks::shouldSilenceWindowResizeEventsDuringApplicationSnapshotting
const):
(WebCore::Quirks::shouldSilenceMediaQueryListChangeEvents const):
(WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
(WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation
const):
(WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
(WebCore::Quirks::shouldIgnoreViewportArgumentsToAvoidExcessiveZoom const):
(WebCore::Quirks::shouldIgnoreViewportArgumentsToAvoidEnlargedView const):
(WebCore::Quirks::shouldOpenAsAboutBlank const):
(WebCore::Quirks::needsPreloadAutoQuirk const):
(WebCore::Quirks::shouldBypassBackForwardCache const):
(WebCore::Quirks::shouldBypassAsyncScriptDeferring const):
(WebCore::Quirks::shouldEnableFacebookFlagQuirk const):
(WebCore::Quirks::shouldEnableLegacyGetUserMediaQuirk const):
(WebCore::Quirks::shouldDisableImageCaptureQuirk const):
(WebCore::Quirks::shouldEnableCameraAndMicrophonePermissionStateQuirk const):
(WebCore::Quirks::shouldEnableRemoteTrackLabelQuirk const):
(WebCore::Quirks::shouldEnableSpeakerSelectionPermissionsPolicyQuirk const):
(WebCore::Quirks::shouldEnableEnumerateDeviceQuirk const):
(WebCore::Quirks::shouldEnableRTCEncodedStreamsQuirk const):
(WebCore::Quirks::shouldAllowNotificationPermissionWithoutUserGesture const):
(WebCore::Quirks::shouldUnloadHeavyFrame const):
(WebCore::Quirks::needsCanPlayAfterSeekedQuirk const):
(WebCore::Quirks::shouldLayOutAtMinimumWindowWidthWhenIgnoringScalingConstraints
const):
(WebCore::Quirks::shouldNotAutoUpgradeToHTTPSNavigation):
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
(WebCore::Quirks::needsVP9FullRangeFlagQuirk const):
(WebCore::Quirks::requiresUserGestureToPauseInPictureInPicture const):
(WebCore::Quirks::returnNullPictureInPictureElementDuringFullscreenChange
const):
(WebCore::Quirks::requiresUserGestureToLoadInPictureInPicture const):
(WebCore::Quirks::blocksReturnToFullscreenFromPictureInPictureQuirk const):
(WebCore::Quirks::blocksEnteringStandardFullscreenFromPictureInPictureQuirk
const):
(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk
const):
(WebCore::Quirks::allowLayeredFullscreenVideos const):
(WebCore::Quirks::shouldDisableFullscreenVideoAspectRatioAdaptiveSizing const):
(WebCore::Quirks::shouldEnableFontLoadingAPIQuirk const):
(WebCore::Quirks::shouldDisableAdSkippingInPip const):
(WebCore::Quirks::needsVideoShouldMaintainAspectRatioQuirk const):
(WebCore::Quirks::shouldExposeShowModalDialog const):
(WebCore::Quirks::shouldNavigatorPluginsBeEmpty const):
(WebCore::Quirks::shouldDisableLazyIframeLoadingQuirk const):
(WebCore::Quirks::shouldDisableFetchMetadata const):
(WebCore::Quirks::shouldBlockFetchWithNewlineAndLessThan const):
(WebCore::Quirks::shouldDisablePushStateFilePathRestrictions const):
(WebCore::Quirks::needsConfigurableIndexedPropertiesQuirk const):
(WebCore::Quirks::advancedPrivacyProtectionSubstituteDataURLForScriptWithFeatures
const):
(WebCore::Quirks::needsResettingTransitionCancelsRunningTransitionQuirk const):
(WebCore::Quirks::shouldDisableDataURLPaddingValidation const):
(WebCore::Quirks::needsDisableDOMPasteAccessQuirk const):
(WebCore::Quirks::shouldPreventOrientationMediaQueryFromEvaluatingToLandscape
const):
(WebCore::Quirks::shouldFlipScreenDimensions const):
(WebCore::Quirks::shouldIgnorePlaysInlineRequirementQuirk const):
(WebCore::Quirks::shouldUseEphemeralPartitionedStorageForDOMCookies const):
(WebCore::Quirks::needsPopupFromMicrosoftOfficeToOneDrive const):
(WebCore::Quirks::needsLaxSameSiteCookieQuirk const):
(WebCore::Quirks::shouldIgnoreTextAutoSizing const):
(WebCore::Quirks::scriptToEvaluateBeforeRunningScriptFromURL):
(WebCore::Quirks::shouldHideCoarsePointerCharacteristics const):
(WebCore::Quirks::implicitMuteWhenVolumeSetToZero const):
(WebCore::Quirks::shouldDispatchPointerOutAfterHandlingSyntheticClick const):
(WebCore::Quirks::needsZeroMaxTouchPointsQuirk const):
(WebCore::Quirks::needsChromeMediaControlsPseudoElement const):
(WebCore::Quirks::shouldHideSoftTopScrollEdgeEffectDuringFocus const):
(WebCore::Quirks::shouldTreatAddingMouseOutEventListenerAsContentChange const):
(WebCore::Quirks::shouldSynthesizeTouchEventsAfterNonSyntheticClick const):
(WebCore::Quirks::shouldIgnoreContentObservationForClick const):
(WebCore::Quirks::needsMozillaFileTypeForDataTransfer const):
(WebCore::Quirks::shouldAvoidStartingSelectionOnMouseDownOverPointerCursor
const):
(WebCore::Quirks::shouldReuseLiveRangeForSelectionUpdate const):
(WebCore::Quirks::needsPointerTouchCompatibility const):
(WebCore::Quirks::needsFacebookStoriesCreationFormQuirk const):
(WebCore::Quirks::needsHotelsAnimationQuirk const):
(WebCore::Quirks::needsClaudeSidebarViewportUnitQuirk const):
(WebCore::Quirks::needsCustomUserAgentData const):
(WebCore::Quirks::needsNavigatorUserAgentDataQuirk const):
(WebCore::Quirks::needsNowPlayingFullscreenSwapQuirk const):
(WebCore::Quirks::needsSuppressPostLayoutBoundaryEventsQuirk const):
(WebCore::Quirks::needsTikTokOverflowingContentQuirk const):
(WebCore::Quirks::needsInstagramResizingReelsQuirk const):
(WebCore::Quirks::needsWebKitMediaTextTrackDisplayQuirk const):
(WebCore::Quirks::shouldSupportHoverMediaQueries const):
(WebCore::Quirks::shouldRewriteMediaRangeRequestForURL const):
(WebCore::Quirks::shouldEnterNativeFullscreenWhenCallingElementRequestFullscreenQuirk
const):
(WebCore::Quirks::shouldDelayReloadWhenRegisteringServiceWorker const):
(WebCore::Quirks::shouldDisableDOMAudioSessionQuirk const):
(WebCore::Quirks::shouldReportVisibleDueToActivePictureInPictureContent const):
* Source/WebCore/page/Quirks.h:
Canonical link: https://commits.webkit.org/304509@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications