Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 9b097d0ecda363b302393bf22b53c771d197995e https://github.com/WebKit/WebKit/commit/9b097d0ecda363b302393bf22b53c771d197995e Author: Razvan Caliman <rcali...@apple.com> Date: 2023-03-31 (Fri, 31 Mar 2023)
Changed paths: M LayoutTests/http/tests/inspector/network/resource-mime-type-expected.txt M LayoutTests/http/tests/inspector/network/resource-mime-type.html M Source/WebCore/inspector/agents/InspectorPageAgent.cpp M Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js Log Message: ----------- Web Inspector: Web inspector become unresponsive after opening online photos https://bugs.webkit.org/show_bug.cgi?id=254602 Reviewed by Patrick Angle and Devin Rousso. When the inspected main resource is an image, it is treated as a document regardless of its MIME type. Its resource type is incorrectly assigned on the backend as `InspectorPageAgent::Document`. See: `InspectorPageAgent::inspectorResourceType(CachedResource::Type type)` See: `CachedResourceLoader::requestMainResource(CachedResourceRequest&& request)` The Sources panel on the frontend represents resources of the type `WI.Resource.Type.Document` with a `WI.TextResourceContentView`. The payload of the image resource response is a blob of base64 text. When inspecting standalone images, Web Inspector passes this giant single-line blob of text to a `WI.SourceCodeTextEditor` where it runs expensive operations on the main thread and blocks it for long periods of time it if there's a lot of content. This patch modifies `InspectorPageAgent` on the backend to return the appropriate resource type for images, `InspectorPageAgent::ImageResource`, even when they are the main resource. This way, the frontend can represent images with the appropriate view: `WI.ImageResourceContentView`. * LayoutTests/http/tests/inspector/network/resource-mime-type-expected.txt: * LayoutTests/http/tests/inspector/network/resource-mime-type.html: Update test for resource type expectations when the document is an image. * Source/WebCore/inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::inspectorResourceType): Canonical link: https://commits.webkit.org/262409@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes