Skip to content

Commit 4b04c1b

Browse files
feat: DOM form bindings, proxy fixes, README updates (#18)
* feat: implement DOM form bindings, proxy engine fixes, and README updates Add comprehensive DOM form bindings (DOMBindings.ts) with 660+ lines of form element support including input, select, textarea, and form submission handling. Add 561+ lines of tests plus new dom_form_bindings test file. Fix proxy engine cache manager, health check, and reverse proxy issues. Update devtools server and e2e tests. Refresh READMEs across all components. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address code review feedback — security, correctness, and test coverage - Restore regex escaping in HTTPCacheManager.purge to prevent ReDoS (security) - Fix ReverseProxy retry loop to use per-attempt timing for recordSuccess - Fix select.options to traverse optgroup children (browser spec compliance) - Add style.setProperty priority (!important) and cssText setter tests - Add form.reset() event dispatch test - Add button.form ancestor traversal test - Add textarea form/name/placeholder binding tests - Add select disabled/multiple/form binding tests - Add x-forwarded-for header chaining integration test - Fix HTTP3 → HTTP/3 typo in README for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3bd0ad0 commit 4b04c1b

18 files changed

Lines changed: 2142 additions & 120 deletions

File tree

README.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ All packages are designed to work together as an integrated system, but each is
2727
- **pixpane** - Native windowing: cross-platform windows, GPU rendering via wgpu, immediate-mode UI with egui
2828
- **webgpu_x** - GPU compute: WebGPU bindings for compute shaders, texture readback, and bind group management
2929
- **bytecodex** - Bytecode optimization: constant folding, dead store elimination, peephole optimization, validation
30-
- **transportx** - QUIC/HTTP3 transport: connection management, stream multiplexing via quiche FFI
30+
- **transportx** - QUIC/HTTP/3 transport: connection management, stream multiplexing via quiche FFI
3131

3232
### Built to Work Together
3333

@@ -138,7 +138,7 @@ Understanding the Layers:
138138
139139
┌──────────────────┐ ┌──────────────────┐
140140
│ bytecodex (Rust) │ │ transportx(Rust) │
141-
│ - Const folding │ │ - QUIC/HTTP3
141+
│ - Const folding │ │ - QUIC/HTTP/3
142142
│ - Dead store │ │ - Stream mux │
143143
│ - Peephole (FFI) │ │ - quiche (FFI) │
144144
└──────────────────┘ └──────────────────┘
@@ -220,7 +220,7 @@ BrowserX/
220220
│ ├── bytecodex/ # Bytecode optimizer (Rust)
221221
│ │ └── src/ # Constant folding, dead store elimination, peephole
222222
│ │
223-
│ └── transportx/ # QUIC/HTTP3 transport (Rust)
223+
│ └── transportx/ # QUIC/HTTP/3 transport (Rust)
224224
│ └── src/ # Connection management, stream mux via quiche
225225
226226
├── resources/ # Reference implementations and dependencies
@@ -444,11 +444,13 @@ cd crates/webgpu_x && cargo test
444444
- Complete type system (11 type files: HTTP, DOM, CSS, rendering, network, JavaScript, storage, events, WebGPU)
445445
- Network layer: TCP connection management, TLS 1.3 implementation with handshake and certificate validation, connection pooling, DNS resolution
446446
- HTTP protocol: Request/response parsing, header handling, connection reuse
447-
- HTML tokenizer: Full state machine with 60+ tokenization states
447+
- HTML tokenizer: Full state machine with 80+ tokenization states
448448
- CSS parser: Selector matching, specificity calculation, cascade resolution
449-
- JavaScript engine: V8 isolate management, execution contexts, heap management
449+
- JavaScript engine: V8 isolate management, execution contexts, heap management, bytecode compilation with 11 ops, bytecodex FFI optimization (721 tests)
450+
- CSS at-rules: `@media`, `@keyframes`, `@font-face`, `@import` parsing with media query matching, percentage length resolution
450451
- Storage types: Interfaces for localStorage, sessionStorage, IndexedDB, cookies, quota management
451-
- WebGPU rendering: Offscreen rendering via Deno's native WebGPU, GPU readback, WGSL compositor shaders
452+
- WebGPU rendering: Offscreen rendering via Deno's native WebGPU, GPU readback, WGSL compositor shaders, compositeLayer GPU compositing
453+
- Window subsystem: `Window` + `WindowContext` classes with OS abstractions
452454

453455
**Proxy Engine** :
454456

@@ -461,6 +463,10 @@ cd crates/webgpu_x && cargo test
461463
- Network primitives: TCP sockets, IP address handling, buffer pools
462464
- Event system: Event loop, async handling, priority queuing
463465
- Process/thread management: Multi-process architecture, worker pools, task scheduling
466+
- Proxy types: Reverse proxy, load balancer, auth proxy, WebSocket proxy, SSE proxy, TLS proxy, event-driven proxy
467+
- Load balancing: Round-robin, least connections, weighted, IP hash, least response time, random (1878 tests)
468+
- ALPN protocol negotiation: TLS ClientHello parsing and extension building
469+
- HTTP/2 GOAWAY: Stream draining and graceful connection shutdown
464470

465471
**Query Engine** :
466472

@@ -473,6 +479,9 @@ cd crates/webgpu_x && cargo test
473479
- Executor: Query execution engine
474480
- Type system: Primitive types, collections, functions
475481
- Error handling: Comprehensive error types and recovery
482+
- Browser wiring: DOM functions (CLICK, TYPE, TEXT, HTML, ATTR, COUNT, EXISTS) async with browser controller
483+
- Result formatting: Multiple output formats (JSON, CSV, table)
484+
- Dependency graph: GraphX-backed `DependencyGraphBuilder` with topological sort and cycle detection
476485

477486
**Pixpane** :
478487

@@ -505,6 +514,9 @@ cd crates/webgpu_x && cargo test
505514
- Plugin lifecycle: All contributions return Disposable for automatic cleanup
506515
- Plugin registry: Discovery, validation, and loading of plugins
507516
- Configuration: RuntimeConfig with plugin enablement (opt-in by default)
517+
- Lifecycle components: LifecycleManager, HealthChecker, UnifiedMetricsCollector, EventCoordinator
518+
- BrowserPool: acquire/release pattern with idle timeout, max lifetime, automatic cleanup
519+
- GraphX integration: PluginManager uses GraphX DAG + topologicalSort for activation ordering (98 plugin tests)
508520

509521
**MCP Server** :
510522

@@ -516,6 +528,9 @@ cd crates/webgpu_x && cargo test
516528
- Activity tracking: Persistent file-based logging of screenshots and activities
517529
- Data persistence: Screenshots saved to `.browserx/usage_data/screenshots/`, activity logs in JSONL format
518530
- Lazy initialization: Fast startup (<100ms) with services initialized on first use
531+
- Runtime integration: ServiceInitializer with BrowserPool delegation, health checks, metrics
532+
- Session management: SessionManager delegates to Runtime BrowserPool with critical shutdown ordering
533+
- Graph tools: `browserx_visualize_dom`, `browserx_dependency_graph`, `browserx_plugin_graph`
519534

520535
**DevTools** :
521536

@@ -524,29 +539,45 @@ cd crates/webgpu_x && cargo test
524539
- Event system: EventBus for cross-domain pub/sub communication
525540
- Test coverage: 847+ tests across 24 test files
526541

542+
**GraphX** :
543+
544+
- Graph data structures: Graph (undirected), DiGraph (directed), DAG (directed acyclic)
545+
- Algorithms: BFS, DFS, Dijkstra shortest path, topological sort, cycle detection, connected components
546+
- Layout engines: Force-directed (Fruchterman-Reingold), hierarchical (Sugiyama), radial, grid
547+
- SVG rendering: Headless SVG generation with themes, labels, arrowheads
548+
- Cross-codebase integration: Runtime PluginManager, Query Engine DependencyGraphBuilder, MCP visualization tools
549+
- Test coverage: 164 tests across graph structures, algorithms, layout, and rendering
550+
551+
**bytecodex** :
552+
553+
- Constant folding: Folds arithmetic on constant operands into single constants
554+
- Dead store elimination: Removes unused register stores
555+
- Peephole optimization: Pattern-matches small instruction windows
556+
- Bytecode validation: Opcode validity, operand counts, constant pool bounds, jump targets
557+
- Disassembly: Human-readable bytecode output
558+
- V8Compiler integration: `compile(source, { optimize: true })` runs bytecodex FFI pass (15 Rust tests)
559+
560+
**transportx** :
561+
562+
- QUIC/HTTP/3 transport: Connection management and stream multiplexing via quiche FFI
563+
527564
### 🚧 In Progress
528565

529566
**Browser Engine:**
530567

531568
- Layout engine: Box model calculation, block/flexbox/grid layout algorithms, text measurement
532569
- Paint engine: Display list generation, rasterization
533570
- Compositor: Layer management, tiling, GPU texture uploads, VSync synchronization
534-
- JavaScript execution: V8 bytecode compilation, JIT optimization, event loop integration
535571
- Full rendering pipeline: End-to-end integration from HTML to pixels
536572

537573
**Proxy Engine:**
538574

539-
- Load balancer implementations: Active load balancing algorithms (round-robin, least connections, IP hash)
540-
- WebSocket proxying: Full duplex proxying, frame handling
541575
- Metrics collection: Request tracking, latency histograms, throughput measurement
542576
- Distributed tracing: Trace context propagation, span collection
543577

544578
**Query Engine:**
545579

546-
- Browser adapter: Integration with browser engine for DOM/CSSOM queries
547-
- Proxy adapter: Integration with proxy engine for network/cache queries
548580
- Advanced SQL features: Subqueries, joins, aggregations, window functions
549-
- Query result formatting: Multiple output formats (JSON, CSV, table)
550581

551582
**Integration:**
552583

@@ -568,7 +599,6 @@ cd crates/webgpu_x && cargo test
568599

569600
- CLI interface: Interactive query shell for browser/proxy inspection
570601
- Web UI: Browser-based inspector for debugging and metrics visualization
571-
- DevTools protocol: Chrome DevTools Protocol compatibility
572602
- Performance profiler: CPU/memory/network profiling tools
573603

574604
**Testing & Quality:**

browser/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const compositor = engine.getCompositor();
136136

137137
### Prerequisites
138138

139-
- Deno 1.40+ (https://deno.land)
139+
- Deno 2.x+ (https://deno.land)
140140

141141
### Running the Browser
142142

@@ -267,9 +267,11 @@ View documentation in your IDE by hovering over method names.
267267
- **Paint Engine**: Display list generation and recording
268268
- **Compositor**: Layer composition, tiling, and GPU upload
269269

270-
### JavaScript Layer
270+
### JavaScript Layer (721 tests)
271271

272272
- **V8 Integration**: Full V8 isolate and context management
273+
- **Bytecode Compilation**: 11 bytecode operations (CALL, CONSTRUCT, GET/SET_PROPERTY, GET/SET_KEYED, CREATE_OBJECT/ARRAY/CLOSURE, LDA/STA_CONTEXT_SLOT)
274+
- **bytecodex FFI**: Rust-based optimization pass via `V8Compiler.compile(source, { optimize: true })`
273275
- **Event Loop**: Macro/micro task scheduling
274276
- **Web APIs**: window, console, setTimeout, DOM manipulation
275277
- **Garbage Collection**: Automatic memory management

0 commit comments

Comments
 (0)