WebView (macOS): remove orphaned contentsScale override (fixes low-DPI blur) - #37
Closed
jakepenn wants to merge 1 commit into
Closed
WebView (macOS): remove orphaned contentsScale override (fixes low-DPI blur)#37jakepenn wants to merge 1 commit into
jakepenn wants to merge 1 commit into
Conversation
Removes the override that force-stamped layer.contentsScale = backingScaleFactor. It was added to counter the setWantsLayer:YES first-paint flash hack, which has since been removed — so on the now layer-hosting WKWebView it was orphaned, and it clamped WebKit's root-layer raster scale. That left content scaled via an ancestor CSS/host transform rendering blurry on low-DPI (non-Retina / 100%) displays. Letting WebKit manage contentsScale (matching JUCE master) renders sharply. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The player webview rendered blurry on low-DPI (non-Retina / 100%) displays when the host scales the editor.
Cause
We carried a fork-local override of
viewDidChangeBackingProperties(added in #32, "sync layer contentsScale on backing change") that force-stamped:That override existed only to counter the
setWantsLayer:YESfirst-paint flash hack — which was removed in #34. With the WKWebView back to its default layer-hosting mode, the override is orphaned: stamping the WebKit-owned root layer'scontentsScaledown to the backing scale clamps WebKit's raster scale and stops it from rendering content (scaled via an ancestor CSS/host transform) at full resolution → blur on 1× displays.Change
Remove the override entirely, matching JUCE master. WebKit manages
contentsScaleitself and renders sharply. A short comment is left in place so the override isn't reintroduced.This is the macOS render path returning to upstream behaviour — none of the other fork customizations (keyboard forwarding, flash/background, DevTools) touch rasterisation.
Testing
Verified the low-DPI blur clears with the override removed (reproduced locally via macOS "Open in Low Resolution", which forces
backingScaleFactor = 1).🤖 Generated with Claude Code