Conversation
…urceHandler drop safety
This branch has not been deployed
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.
Closes #958
Hi everyone,
1. Summary of Changes
This pull request resolves a render-blocking deadlock on Windows where loading local stylesheets or assets via compile-time absolute paths (e.g.
asset!("browser.css")) leaves the application window permanently solid white (#FFFFFF).Root Causes Addressed:
BaseDocument::resolve_urlpreviously passed Windows absolute paths (e.g.D:\...\browser.css) directly tourl::Url::parse(), which interpreted the drive letter as a scheme (url.scheme() == "d").blitz-netfailed on scheme"d", it dropped theResourceHandlerwithout sending a response. BecauseResourceHandlerlacked aDropimplementation,pending_critical_resources.remove(...)was never called, permanently blocking layout and paint passes (render_skipped=true).blitz-netusedrequest.url.path()instead ofto_file_path()forfile://URLs, which fails on Windows absolute drive letters.2. Exact Scope & Seams Touched
blitz-dompackages/blitz-dom/src/document.rsresolve_urland convert to validfile:///URLs viaUrl::from_file_path.blitz-dompackages/blitz-dom/src/net.rsDropforResourceHandler<T>with anAtomicBoolguard to guarantee that dropped handlers emit an errorResourceLoadResponseand request a redraw, ensuringpending_critical_resourcesalways clears. Added unit tests.blitz-netpackages/blitz-net/src/lib.rsrequest.url.to_file_path()instead ofrequest.url.path()forfile://requests on Windows.3. Direct Empirical Proof (Two-Case Comparison)
To confirm that this deadlock is an independent root cause in Blitz, a controlled dual-run verification was executed on Windows hardware with the GPU backend held strictly constant (DirectX 12 enabled via upstream AnyRender PR #100):
resolved_urlin<head>'d:\business\...'(Scheme"d")'file:///D:/business/...'(Scheme"file")pending_critical_resourcesload_resourceinvocationsresolve()early_return=true(aborted)blitz-shell::redrawrender_skipped=true(aborted)render_skipped=false(rendered)#FFFFFF)This confirms that even with a fully working DX12 graphics backend, original Blitz alone is 100% sufficient to cause a permanent blank white window on Windows.
4. Separation from Upstream AnyRender
This PR is strictly confined to the Blitz repository's asset and document lifecycle:
dioxuslabs/anyrender(Issue #99, PR #100).wgpuinstance selection logic, ensuring a clean, orthogonal review.5. Validation Summary
dropped_handler_emits_error_response: Verifies that dropping an unfulfilledResourceHandlerautomatically emits an errorDocumentEvent::ResourceLoad.responded_handler_does_not_emit_on_drop: Verifies that a handler that has already responded does not emit a duplicate response on drop.cargo test -p blitz-dom --lib net::tests(Passed cleanly).cargo run -rp browserlaunches on Windows and displays the new tab page, address bar, Blitz logo SVG, and search input box without freezing.Thanks!