Bug 304113

Summary: Reduce boilerplate in Quirks.cpp with QUIRKS_EARLY_RETURN_IF_DISABLED_WITH_VALUE macro
Product: WebKit Reporter: Brandon <brandonstewart>
Component: WebCore Misc.Assignee: Brandon <brandonstewart>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   

Brandon
Reported 2025-12-13 06:40:08 PST
Introduce QUIRKS_EARLY_RETURN_IF_DISABLED 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(<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).
Attachments
Radar WebKit Bug Importer
Comment 1 2025-12-13 06:40:14 PST
Brandon
Comment 2 2025-12-13 06:41:44 PST
EWS
Comment 3 2025-12-16 06:00:06 PST
Committed 304509@main (b1538aeb1640): <https://commits.webkit.org/304509@main> Reviewed commits have been landed. Closing PR #55361 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.