Implement CSS resource loading: <link rel="stylesheet"> and <style> support
Add css_loader module to the browser crate that collects CSS from the DOM:
- Scan DOM for <style> elements (inline CSS) and <link rel="stylesheet"> (external)
- Fetch external stylesheets via ResourceLoader with encoding detection
- Resolve @import rules recursively (max depth 5 to prevent cycles)
- Basic media attribute support (screen, all)
- Type attribute validation (text/css default)
- Graceful degradation: failed loads are silently skipped
- Merge all rules into a single Stylesheet in document order
37 tests covering DOM scanning, classification, media matching, text
collection, import resolution, error handling, and edge cases.
Implements issue 3mhkt6vtv3q2g
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
authored by
tangled.org
79c45463
295a1c8b