we (web engine): Experimental web browser project to understand the limits of Claude

Implement image resource loading: <img> element support master

Add img_loader module to the browser crate that loads images from the DOM: - Scan DOM for <img src="..."> elements in document order - Fetch image data via ResourceLoader with URL resolution - Detect format from magic bytes (PNG: 89504E47, JPEG: FFD8, GIF: GIF8) - Decode using image crate decoders (PNG, JPEG, GIF) - Parse width/height attributes with proportional scaling - Graceful degradation: failed loads store alt text, no crash Layout integration: - Add replaced_size field to LayoutBox for replaced elements - Accept image_sizes map in layout() for intrinsic/attribute dimensions - Replaced elements use their dimensions instead of child layout Render integration: - Add DrawImage variant to PaintCommand - Nearest-neighbor scaling with RGBA→BGRA conversion - Alpha compositing for semi-transparent image pixels 37 tests covering format detection, dimension parsing/resolution, DOM scanning, graceful failure, error display, and PNG decoding. Implements issue 3mhkt7br4jx25 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


+831 -29
5 changed files