WebInspectorCore is the package-internal semantic model target for the WebInspector inspector stack.
The target models WebKit protocol concepts before they reach UIKit presentation code. Runtime and transport targets decode protocol traffic and apply semantic events here.
- Model WebKit protocol concepts directly, starting with DOM and Network.
- Keep page, frame, document, protocol target, execution context, and DOM node identities explicit.
- Treat iframe documents as frame-document projections, not regular DOM children.
- Treat Network redirects as request history, not separate request identities.
- Make iframe refresh and cross-origin selection behavior testable without UIKit/TextKit2.
- Avoid compatibility paths from removed
v0.1.xDOM APIs.
- Transport research
- DOM model research
- CSS model research
- Network model research
- Console transport research
- WebInspector architecture overview
Mutable model classes are @MainActor @Observable so the native UI can observe the same semantic source of truth directly. Expensive work must stay outside this boundary:
- raw transport I/O
- JSON parsing
- protocol payload decoding
- search/tokenization/markup generation
The model should only apply already-decoded semantic events and produce Sendable snapshots/command intents.
Run the headless WebInspector core tests with:
swift test --filter WebInspectorCoreTests