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

Integrate computed styles into layout and render pipeline #45

open opened by pierrelf.com

Description#

Update the layout and render crates to use computed styles from the style crate instead of hardcoded tag-based defaults. This is the final integration step for Phase 4.

Acceptance Criteria#

  • Layout crate changes:
    • Remove hardcoded default_font_size(), default_margin(), display_type() functions
    • Read display, margin-*, padding-*, border-*-width, font-size, width, height from ComputedStyle
    • Resolve auto margins (centering)
    • Respect box-sizing: content-box (default) vs border-box
  • Render crate changes:
    • Read color from computed style for text rendering
    • Read background-color for box backgrounds
    • Render borders with correct width and color
    • Support text-decoration: underline
  • Browser crate changes:
    • Full pipeline: HTML → DOM → CSS parse → style resolve → layout → render → display
    • Both <style> and style="" attributes work
  • All existing tests updated or replaced to work with the new style-driven layout
  • Add integration tests: render an HTML page with <style> block and verify layout positions

Dependencies#

  • All previous Phase 4 issues

Implementation Notes#

  • This ties everything together
  • Existing layout tests may need updating since they relied on hardcoded defaults
  • The user-agent stylesheet in the style crate should produce equivalent results to the old hardcoded defaults for unstyled pages

Test milestone#

  • After this issue, we should be on track toward Acid1 compliance
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/3mgavvwxzn625