use std::cell::RefCell; use we_html::parse_html; use we_layout::layout; use we_platform::appkit; use we_platform::cg::BitmapContext; use we_render::Renderer; use we_style::computed::{extract_stylesheets, resolve_styles}; use we_text::font::{self, Font}; /// Default HTML page shown when no file argument is provided. const DEFAULT_HTML: &str = r#"
This is a from-scratch web browser engine written in pure Rust.
Zero external crate dependencies. Every subsystem is implemented in Rust.
HTML5 tokenizer, DOM tree, block layout, CSS cascade, and software rendering.
"#; /// Browser state kept in thread-local storage so the resize handler can /// access it. All AppKit callbacks run on the main thread. struct BrowserState { html: String, font: Font, bitmap: Box