Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 587e3a7c563e482a45c3b186d9d5f093aadfb4a8
https://github.com/WebKit/WebKit/commit/587e3a7c563e482a45c3b186d9d5f093aadfb4a8
Author: Gerald Squelart <[email protected]>
Date: 2026-09-07 (Mon, 07 Sep 2026)
Changed paths:
M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
M Tools/TestWebKitAPI/Resources/cocoa/canvas-fingerprinting.js
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ScriptTrackingPrivacyTests.mm
Log Message:
-----------
getImageData should return the requested color space even for fingerprinters
https://bugs.webkit.org/show_bug.cgi?id=323637
rdar://183595301
Reviewed by Mike Wyrzykowski.
The anti privacy tracking branch of getImageData() was always returning
an sRGB ImageData, which is against specs and therefore could be used as
a fingerprint datapoint.
Fixed by hoisting the existing ImageData::computeColorSpace() calculation
above the noise-injection branch and using it for the noise path's
PixelBufferFormat, matching what the normal (non-noise) path already
does.
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::getImageData const):
* Tools/TestWebKitAPI/Resources/cocoa/canvas-fingerprinting.js:
(getImageDataColorSpace):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ScriptTrackingPrivacyTests.mm:
(TestWebKitAPI::(ScriptTrackingPrivacyTests, Canvas2DColorSpace)):
Canonical link: https://commits.webkit.org/320638@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications