Commit graph

8 commits

Author SHA1 Message Date
Benedikt Willi
a65aaac61b Enhance DOM graph visualization to support PNG images and improve legend display 2026-01-13 14:24:00 +01:00
Benedikt Willi
762dd22e31 Implement image loading and rendering support in Bowser browser
This commit introduces support for loading and rendering images in the Bowser web browser, enhancing the rendering engine to handle various image sources. Key changes include:

- Updated README.md to reflect the new milestone status and added features for image support.
- Added `ImageLayout` class to manage image layout and loading.
- Implemented synchronous and asynchronous image loading in `src/network/images.py`, including caching mechanisms.
- Expanded the DOM parsing capabilities in `DocumentLayout` to handle `<img>` tags and manage their layout directives.
- Created a new `DrawImage` command in the rendering pipeline, which handles the drawing of both loaded images and placeholders for unloaded images.
- Introduced a task queue for managing asynchronous image loads, ensuring UI remains responsive during image fetching.
- Added unit tests for image loading, layout management, and the async task queue to ensure robust functionality and prevent regressions.
2026-01-12 17:36:14 +01:00
Benedikt Willi
2380f7be31 Enhance font handling and layout rendering by supporting font-family in layout lines, improving CSS rule parsing for multi-selectors, and updating start page styles to include emoji support. 2026-01-12 16:05:14 +01:00
Benedikt Willi
ae5913be2e Implement CSS parsing, selector matching, and style resolution
- Added a comprehensive CSS parser with support for tag, class, and ID selectors.
- Implemented property declaration parsing and inline style handling.
- Introduced a Selector class for specificity calculation and matching against HTML elements.
- Created a CSSRule class to represent individual CSS rules.
- Developed a StyleResolver class to compute final styles for elements, considering cascade and inheritance.
- Added integration tests for CSS parsing and style application in HTML documents.
- Updated HTML parser to retain <style> tags for CSS extraction.
- Enhanced tests for CSS parsing, inline styles, and computed styles.
2026-01-12 11:41:18 +01:00
Benedikt Willi
3838aa17af Add DOM Visualization Feature with Integrated Browser Support
- Introduced a new feature to visualize the Document Object Model (DOM) tree of the loaded web page.
- Implemented keyboard shortcut (Ctrl+Shift+D) for generating and displaying the DOM graph.
- Added core implementation files:
  - src/debug/dom_graph.py: Handles generation and rendering of graphs in DOT and SVG formats.
- Created templates and documentation for the new feature, including:
  - docs/DOM_VISUALIZATION.md: Overview and usage instructions.
  - docs/DOM_GRAPH_UX.md: User experience design documentation.
- Allowed the visualization to open in a new browser tab instead of an external viewer.
- Enhanced visual representation through color coding of different HTML elements.
- Implemented comprehensive tests for graph generation and page rendering.
- Updated README.md to include usage instructions for DOM visualization.
- Included test_holder.html as an example test page.
- Modified various components in the browser to integrate tab management and enhance the graphical rendering experience.
2026-01-10 00:19:21 +01:00
Benedikt Willi
fab66d1528 Implement Jinja2 templates for startpage and error pages
Features:
- Add Jinja2 template engine for page rendering
- Create startpage with Bowser branding and version info
- Create error page templates for 404, 500, and network errors
- Support for about:startpage special URL
- Custom error message support in templates
- Graceful fallback rendering if template fails
- Browser now starts with startpage when no URL provided

Templates:
- assets/pages/startpage.html - Beautiful purple gradient intro page
- assets/pages/error_404.html - Pink gradient 404 error page
- assets/pages/error_500.html - Red gradient 500 error page
- assets/pages/error_network.html - Orange gradient network error page

Code:
- src/templates.py - Template rendering utilities with Jinja2
- Updated main.py to use startpage as default
- Updated Frame.load() to handle about: URLs and render errors with templates
- Added 7 comprehensive template tests

All 62 core tests passing (excluding GTK-dependent tests)
2026-01-09 14:24:01 +01:00
Benedikt Willi
f1e4957e70 Initial commit: Setup Bowser educational web browser
- Added README.md with project description, building instructions, and development milestones.
- Created the project structure with directories for source code, assets, and tests.
- Implemented a basic entry point in main.py with argument parsing and logging configuration.
- Developed preliminary browser orchestration in browser.py, including tab management and navigation.
- Established a GTK-based UI framework in chrome.py, integrating key UI components including the address bar and navigation buttons.
- Incorporated HTTP request handling in http.py, with enhanced logging of requests and responses.
- Added initial assets: logo and images for browser UI.
- Configured dependencies in pyproject.toml for development and runtime environments.
- Initialized version control with uv.lock for dependency management.
2026-01-09 13:31:48 +01:00
Benedikt Willi
b0e693e50c Initial bowser project scaffold 2026-01-09 12:20:46 +01:00