Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.63 KB

File metadata and controls

42 lines (29 loc) · 1.63 KB

WebInspectorCore

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.

Goals

  • 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.x DOM APIs.

Domain Notes

Model Boundary

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.

Tests

Run the headless WebInspector core tests with:

swift test --filter WebInspectorCoreTests