Skip to main content

orinium_browser/browser/core/
mod.rs

1//! Browser core: application lifecycle, tab management, and engine integration.
2//!
3//! This module contains the core glue between the browser engine (`engine`)
4//! and the platform (`platform`). It exposes the high-level application
5//! entrypoint [`BrowserApp`], the [`Tab`] abstraction, and command primitives.
6//!
7//! Processing flow (high-level)
8//! - Resource acquisition: `resource_loader` / platform network → HTML/CSS input
9//! - Parsing: HTML tokenizer/parser → DOM
10//! - Style resolution: CSS parser + cascade → computed style
11//! - Layout: layout builder produces layout tree
12//! - Render model: generate draw commands from layout tree
13//! - Platform render: platform renderer consumes draw commands and composites output
14//!
15//! Quick example (for contributors)
16//! ```no_run
17//! use orinium_browser::browser::{BrowserApp, BrowserUi, Tab};
18//!
19//! // Navigate the tab to a resource or URL (error handling elided)
20//! let mut tab = Tab::default();
21//! tab.navigate("resource:///test/test.html".parse().unwrap());
22//!
23//! // Create browser with the pre-configured tab and run it
24//! let mut browser = BrowserApp::default();
25//! browser.set_default_ui(BrowserUi::with_tab(tab));
26//! browser.run().unwrap();
27//! ```
28//!
29//! Contributor notes
30//! - Prefer small, focused commits that add tests for new behavior.
31//! - Read module-level docs in `engine` (parser / layouter) and `platform`
32//!   (network / renderer) before changing cross-cutting logic.
33//! - Typical edit cycle: add unit tests → implement change in `engine` → verify
34//!   draw-command output → ensure platform paints correctly.
35//!
36//! See submodules for specifics and examples.
37
38mod app;
39mod command;
40pub mod resource_loader;
41pub mod tab;
42pub mod ui;
43pub mod webview;
44
45pub use app::BrowserApp;
46pub use command::BrowserCommand;
47pub use tab::Tab;
48pub use ui::{
49    BasicChrome, BasicContextMenu, BrowserRenderer, BrowserUi, Chrome, ChromeAction,
50    ChromeEventResult, ClickContext, ContextMenu, MenuEventResult, MenuItem, RenderState,
51};