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

Handle elements and style attributes #43

open opened by pierrelf.com

Description#

Integrate CSS parsing with the HTML pipeline. Extract CSS from <style> elements and style attributes, parse them, and feed them into the style resolution system.

Acceptance Criteria#

  • During DOM construction or as a post-processing step:
    • Find all <style> elements in the document
    • Extract their text content
    • Parse each as a CSS stylesheet using the CSS parser
  • Parse inline style attributes on elements into declaration blocks
  • Collect all stylesheets in document order
  • Pass collected stylesheets + DOM to the style resolver
  • Update the browser pipeline (in browser crate) to:
    1. Parse HTML → DOM
    2. Extract and parse CSS from <style> elements
    3. Resolve styles (cascade)
    4. Pass styled tree to layout
  • Write integration tests: HTML with <style> block renders with correct styles

Dependencies#

  • CSS parser
  • Cascade and computed style resolution
  • HTML parser / DOM

Implementation Notes#

  • <link rel="stylesheet"> is deferred to Phase 8 (requires network)
  • For now, only <style> elements and inline style attributes
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mgavv3qqz42u