From 01d28a3454dcb3d498ffd64ad69262d1391243e1 Mon Sep 17 00:00:00 2001 From: Joshua Thijssen Date: Thu, 19 Dec 2024 21:51:21 +0100 Subject: [PATCH] Removed typeface crate and moved font to shared crate --- Cargo.lock | 11 - crates/gosub_cairo/Cargo.toml | 1 - crates/gosub_cairo/src/debug/text.rs | 2 +- crates/gosub_cairo/src/elements/text.rs | 4 +- .../gosub_html5/benches/tree_construction.rs | 2 +- crates/gosub_html5/src/lib.rs | 2 +- .../src/testing/tree_construction.rs | 2 +- crates/gosub_shared/Cargo.toml | 1 - .../resources}/fonts/Roboto-Regular.ttf | Bin .../src/font.rs | 0 crates/gosub_shared/src/lib.rs | 3 + .../gosub_shared/src/render_backend/layout.rs | 2 +- crates/gosub_taffy/Cargo.toml | 1 - crates/gosub_taffy/src/compute/inline.rs | 5 +- crates/gosub_taffy/src/text.rs | 4 +- crates/gosub_typeface/Cargo.toml | 10 - crates/gosub_typeface/src/lib.rs | 312 ------------------ crates/gosub_vello/Cargo.toml | 1 - crates/gosub_vello/src/debug/text.rs | 2 +- docs/crates.md | 4 - src/bin/html5-parser-test.rs | 4 +- src/bin/parser-test.rs | 2 +- 22 files changed, 19 insertions(+), 356 deletions(-) rename {resources => crates/gosub_shared/resources}/fonts/Roboto-Regular.ttf (100%) rename crates/{gosub_typeface => gosub_shared}/src/font.rs (100%) delete mode 100644 crates/gosub_typeface/Cargo.toml delete mode 100644 crates/gosub_typeface/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index ff4c8373d..df63f85f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1707,7 +1707,6 @@ dependencies = [ "futures", "gosub_shared", "gosub_svg", - "gosub_typeface", "image", "kurbo", "log", @@ -1890,7 +1889,6 @@ dependencies = [ "encoding_rs", "futures", "getrandom 0.2.15", - "gosub_typeface", "image", "js-sys", "lazy_static", @@ -1924,20 +1922,12 @@ version = "0.1.0" dependencies = [ "anyhow", "gosub_shared", - "gosub_typeface", "log", "parley", "regex", "taffy", ] -[[package]] -name = "gosub_typeface" -version = "0.1.0" -dependencies = [ - "lazy_static", -] - [[package]] name = "gosub_useragent" version = "0.1.0" @@ -1975,7 +1965,6 @@ dependencies = [ "gosub_html5", "gosub_shared", "gosub_svg", - "gosub_typeface", "image", "log", "raw-window-handle", diff --git a/crates/gosub_cairo/Cargo.toml b/crates/gosub_cairo/Cargo.toml index 1bc143c0f..a630c220f 100644 --- a/crates/gosub_cairo/Cargo.toml +++ b/crates/gosub_cairo/Cargo.toml @@ -8,7 +8,6 @@ license = "MIT" [dependencies] gosub_shared = { path = "../gosub_shared" } -gosub_typeface = { path = "../gosub_typeface" } gosub_svg = { path = "../gosub_svg", features = ["resvg"] } image = "0.25.2" smallvec = "1.13.2" diff --git a/crates/gosub_cairo/src/debug/text.rs b/crates/gosub_cairo/src/debug/text.rs index 67dff3452..c3cb6afbd 100644 --- a/crates/gosub_cairo/src/debug/text.rs +++ b/crates/gosub_cairo/src/debug/text.rs @@ -4,7 +4,7 @@ use crate::elements::transform::GsTransform; use crate::Scene; use gosub_shared::render_backend::{Brush as _, Color as _, Transform as _}; use gosub_shared::types::Point; -use gosub_typeface::ROBOTO_FONT; +use gosub_shared::ROBOTO_FONT; use peniko::{Blob, Font}; use std::sync::{Arc, LazyLock}; diff --git a/crates/gosub_cairo/src/elements/text.rs b/crates/gosub_cairo/src/elements/text.rs index 9ed9c79d4..652ec7d25 100644 --- a/crates/gosub_cairo/src/elements/text.rs +++ b/crates/gosub_cairo/src/elements/text.rs @@ -1,8 +1,8 @@ use crate::CairoBackend; +use gosub_shared::font::{Glyph, GlyphID}; use gosub_shared::render_backend::geo::FP; use gosub_shared::render_backend::layout::{Decoration, TextLayout}; use gosub_shared::render_backend::{RenderText, Text as TText}; -use gosub_typeface::font::{Glyph, GlyphID}; use peniko::Font; use skrifa::instance::NormalizedCoord; use std::cell::RefCell; @@ -12,7 +12,7 @@ use std::rc::Rc; use crate::elements::brush::GsBrush; use crate::elements::color::GsColor; use freetype::{Face, Library}; -use gosub_typeface::ROBOTO_FONT; +use gosub_shared::ROBOTO_FONT; use kurbo::Stroke; use log::info; use once_cell::sync::Lazy; diff --git a/crates/gosub_html5/benches/tree_construction.rs b/crates/gosub_html5/benches/tree_construction.rs index 61bda103d..e0402784f 100644 --- a/crates/gosub_html5/benches/tree_construction.rs +++ b/crates/gosub_html5/benches/tree_construction.rs @@ -4,9 +4,9 @@ use gosub_html5::document::builder::DocumentBuilderImpl; use gosub_html5::document::document_impl::DocumentImpl; use gosub_html5::document::fragment::DocumentFragmentImpl; use gosub_html5::parser::Html5Parser; -use gosub_shared::traits::config::{HasCssSystem, HasDocument, HasHtmlParser}; use gosub_html5::testing::tree_construction; use gosub_html5::testing::tree_construction::Harness; +use gosub_shared::traits::config::{HasCssSystem, HasDocument, HasHtmlParser}; #[derive(Clone, Debug, PartialEq)] struct Config; diff --git a/crates/gosub_html5/src/lib.rs b/crates/gosub_html5/src/lib.rs index ed8186a35..4d31ae024 100644 --- a/crates/gosub_html5/src/lib.rs +++ b/crates/gosub_html5/src/lib.rs @@ -14,10 +14,10 @@ pub mod dom; pub mod errors; pub mod node; pub mod parser; +pub mod testing; pub mod tokenizer; #[allow(dead_code)] pub mod writer; -pub mod testing; /// Parses the given HTML string and returns a handle to the resulting DOM tree. pub fn html_compile(html: &str) -> DocumentHandle { diff --git a/crates/gosub_html5/src/testing/tree_construction.rs b/crates/gosub_html5/src/testing/tree_construction.rs index 71bb733a4..89f661367 100644 --- a/crates/gosub_html5/src/testing/tree_construction.rs +++ b/crates/gosub_html5/src/testing/tree_construction.rs @@ -3,8 +3,8 @@ mod generator; pub mod parser; pub mod result; -use generator::TreeOutputGenerator; use crate::node::{HTML_NAMESPACE, MATHML_NAMESPACE, SVG_NAMESPACE}; +use generator::TreeOutputGenerator; use gosub_shared::byte_stream::{ByteStream, Config, Encoding, Location}; use gosub_shared::document::DocumentHandle; use gosub_shared::node::NodeId; diff --git a/crates/gosub_shared/Cargo.toml b/crates/gosub_shared/Cargo.toml index 8da5853c8..0fc951c7f 100644 --- a/crates/gosub_shared/Cargo.toml +++ b/crates/gosub_shared/Cargo.toml @@ -19,7 +19,6 @@ derive_more = {version = "1.0.0", features = ["display"]} log = "0.4.22" raw-window-handle = "0.6.2" smallvec = "1.13.2" -gosub_typeface = { path = "../gosub_typeface"} image = "0.25.5" diff --git a/resources/fonts/Roboto-Regular.ttf b/crates/gosub_shared/resources/fonts/Roboto-Regular.ttf similarity index 100% rename from resources/fonts/Roboto-Regular.ttf rename to crates/gosub_shared/resources/fonts/Roboto-Regular.ttf diff --git a/crates/gosub_typeface/src/font.rs b/crates/gosub_shared/src/font.rs similarity index 100% rename from crates/gosub_typeface/src/font.rs rename to crates/gosub_shared/src/font.rs diff --git a/crates/gosub_shared/src/lib.rs b/crates/gosub_shared/src/lib.rs index 00225d61a..201ebff32 100644 --- a/crates/gosub_shared/src/lib.rs +++ b/crates/gosub_shared/src/lib.rs @@ -9,8 +9,11 @@ pub mod async_executor; pub mod byte_stream; pub mod document; pub mod errors; +pub mod font; pub mod node; pub mod render_backend; pub mod timing; pub mod traits; pub mod types; + +pub const ROBOTO_FONT: &[u8] = include_bytes!("../resources/fonts/Roboto-Regular.ttf"); diff --git a/crates/gosub_shared/src/render_backend/layout.rs b/crates/gosub_shared/src/render_backend/layout.rs index 2e48e71fa..9ecbdf544 100644 --- a/crates/gosub_shared/src/render_backend/layout.rs +++ b/crates/gosub_shared/src/render_backend/layout.rs @@ -1,9 +1,9 @@ use std::fmt::Debug; use super::geo::{Point, Rect, Size, SizeU32}; +use crate::font::{Font, Glyph}; use crate::traits::config::HasLayouter; use crate::types::Result; -use gosub_typeface::font::{Font, Glyph}; pub trait LayoutTree>: Sized + Debug + 'static { type NodeId: Debug + Copy + Clone + From + Into + PartialEq; diff --git a/crates/gosub_taffy/Cargo.toml b/crates/gosub_taffy/Cargo.toml index 72e9ffd04..0cf947556 100644 --- a/crates/gosub_taffy/Cargo.toml +++ b/crates/gosub_taffy/Cargo.toml @@ -7,7 +7,6 @@ license = "MIT" [dependencies] gosub_shared = { path = "../gosub_shared" } -gosub_typeface = { path = "../gosub_typeface" } taffy = "0.6.3" anyhow = "1.0.94" regex = "1.11.1" diff --git a/crates/gosub_taffy/src/compute/inline.rs b/crates/gosub_taffy/src/compute/inline.rs index 847e9812d..aedd7259b 100644 --- a/crates/gosub_taffy/src/compute/inline.rs +++ b/crates/gosub_taffy/src/compute/inline.rs @@ -10,11 +10,12 @@ use taffy::{ RunMode, Size, }; +use gosub_shared::font::Glyph; use gosub_shared::render_backend::geo; use gosub_shared::render_backend::layout::{Decoration, DecorationStyle, HasTextLayout, LayoutNode, LayoutTree}; use gosub_shared::traits::config::HasLayouter; use gosub_shared::traits::css3::{CssProperty, CssValue}; -use gosub_typeface::font::Glyph; +use gosub_shared::ROBOTO_FONT; use crate::text::{Font, TextLayout}; use crate::{Display, LayoutDocument, TaffyLayouter}; @@ -22,7 +23,7 @@ use crate::{Display, LayoutDocument, TaffyLayouter}; static FONT_CX: LazyLock> = LazyLock::new(|| { let mut ctx = FontContext::default(); - let fonts = ctx.collection.register_fonts(gosub_typeface::ROBOTO_FONT.to_vec()); + let fonts = ctx.collection.register_fonts(ROBOTO_FONT.to_vec()); ctx.collection .append_fallbacks(FallbackKey::new(Script::from("Latn"), None), fonts.iter().map(|f| f.0)); diff --git a/crates/gosub_taffy/src/text.rs b/crates/gosub_taffy/src/text.rs index 06bf2ace6..098fd820a 100644 --- a/crates/gosub_taffy/src/text.rs +++ b/crates/gosub_taffy/src/text.rs @@ -1,7 +1,7 @@ +use gosub_shared::font::Font as TFont; +use gosub_shared::font::Glyph; use gosub_shared::render_backend::layout::{Decoration, TextLayout as TLayout}; use gosub_shared::render_backend::Size; -use gosub_typeface::font::Font as TFont; -use gosub_typeface::font::Glyph; use parley::Font as PFont; #[derive(Debug, Clone)] diff --git a/crates/gosub_typeface/Cargo.toml b/crates/gosub_typeface/Cargo.toml deleted file mode 100644 index a9b88b5bc..000000000 --- a/crates/gosub_typeface/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "gosub_typeface" -version = "0.1.0" -edition = "2021" -authors = ["Gosub Community "] -license = "MIT" - -[dependencies] -lazy_static = "1.5.0" -#fontique = "0.1.0" diff --git a/crates/gosub_typeface/src/lib.rs b/crates/gosub_typeface/src/lib.rs deleted file mode 100644 index c380349d1..000000000 --- a/crates/gosub_typeface/src/lib.rs +++ /dev/null @@ -1,312 +0,0 @@ -// use std::sync::{Arc, Mutex}; -// -// use lazy_static::lazy_static; -// use rust_fontconfig::{FcFontCache, FcPattern}; -// -// pub const DEFAULT_FS: f32 = 12.0; //TODO: these need to be moved to somewhere and made configurable -// pub const DEFAULT_LH: f32 = 1.2; -// -// #[derive(Clone, PartialEq, Debug)] -// pub struct SharedFont { -// pub data: Arc>, -// pub ty: FontType, -// } -// -// impl SharedFont { -// pub fn new(data: Arc>) -> Self { -// Self { -// data, -// ty: FontType::Unknown, -// } -// } -// -// pub fn unknown(data: Arc>) -> Self { -// Self { -// data, -// ty: FontType::Unknown, -// } -// } -// } -// -// #[derive(Clone, PartialEq, Debug)] -// pub struct Font { -// pub data: Vec, -// pub ty: FontType, -// } -// -// #[derive(Clone, PartialEq, Debug)] -// pub enum FontType { -// TrueType, -// OpenType, -// Woff, -// Woff2, -// Svg, -// Unknown, -// //TODO: add others (maybe) -// } -// -// #[cfg(target_arch = "wasm32")] -// #[derive(Default, Clone, Debug, PartialEq, Eq)] -// pub struct FcPattern { -// name: Option, -// } -// -// #[cfg(not(target_arch = "wasm32"))] -// lazy_static! { -// pub static ref FONT_PATH_CACHE: FcFontCache = FcFontCache::build(); -// } -// -// const ROBOTO_REGULAR: &[u8] = include_bytes!("../../../resources/fonts/Roboto-Regular.ttf"); -// -// lazy_static! { -// pub static ref BACKUP_FONT: SharedFont = SharedFont { -// data: Arc::new(ROBOTO_REGULAR.to_vec()), -// ty: FontType::TrueType, -// }; -// } -// -// lazy_static! { -// pub static ref FONT_RENDERER_CACHE: Mutex = { -// let backup = TextRenderer { -// pattern: FcPattern { -// name: Some("Roboto".to_string()), -// ..Default::default() -// }, -// font: BACKUP_FONT.clone(), -// sizing: Vec::new(), -// }; -// -// Mutex::new(FontRendererCache::new(backup)) -// }; -// } -// -// pub struct FontRendererCache { -// renderers: Vec, -// pub backup: TextRenderer, -// } -// -// enum Index { -// Some(usize), -// Backup, -// } -// -// impl Index { -// fn is_backup(&self) -> bool { -// matches!(self, Self::Backup) -// } -// } -// -// impl From> for Index { -// fn from(index: Option) -> Self { -// match index { -// Some(index) => Self::Some(index), -// None => Self::Backup, -// } -// } -// } -// -// #[allow(dead_code)] -// enum IndexNoBackup { -// None, -// Some(usize), -// Insert(String), -// } -// -// impl IndexNoBackup { -// fn is_none(&self) -> bool { -// matches!(self, Self::None) -// } -// } -// -// impl From> for IndexNoBackup { -// fn from(index: Option) -> Self { -// match index { -// Some(index) => Self::Some(index), -// None => Self::None, -// } -// } -// } -// -// impl FontRendererCache { -// fn new(backup: TextRenderer) -> Self { -// Self { -// renderers: Vec::new(), -// backup, -// } -// } -// -// fn query_no_backup(&mut self, pattern: FcPattern) -> IndexNoBackup { -// let index: IndexNoBackup = self -// .renderers -// .iter() -// .position(|r| r.pattern == pattern) -// .into(); -// -// if index.is_none() { -// #[cfg(not(target_arch = "wasm32"))] -// { -// let Some(font_path) = FONT_PATH_CACHE.query(&pattern) else { -// return IndexNoBackup::None; -// }; -// -// return IndexNoBackup::Insert(font_path.path.clone()); -// } -// #[cfg(target_arch = "wasm32")] -// return IndexNoBackup::None; -// } -// -// index -// } -// -// fn query_font_no_backup(&mut self, pattern: FcPattern) -> Option { -// let font = self.query_no_backup(pattern); -// -// match font { -// IndexNoBackup::Some(index) => Some(SharedFont::clone(&self.renderers[index].font)), -// IndexNoBackup::Insert(path) => { -// let font_bytes = std::fs::read(&path).expect("Failed to read font file"); -// -// let font = SharedFont::unknown(Arc::new(font_bytes)); -// -// let r = TextRenderer { -// pattern: FcPattern { -// name: Some(path), -// ..Default::default() -// }, -// font: SharedFont::clone(&font), -// sizing: Vec::new(), -// }; -// -// self.renderers.push(r); -// -// Some(font) -// } -// IndexNoBackup::None => None, -// } -// } -// -// pub fn query(&mut self, pattern: FcPattern) -> &mut TextRenderer { -// if self.backup.pattern == pattern { -// return &mut self.backup; -// } -// -// // we need to do this with an index value because of https://github.com/rust-lang/rust/issues/21906 -// #[allow(unused_mut)] -// let mut index: Index = self -// .renderers -// .iter() -// .position(|r| r.pattern == pattern) -// .into(); -// -// if index.is_backup() { -// #[cfg(not(target_arch = "wasm32"))] -// { -// let Some(font_path) = FONT_PATH_CACHE.query(&pattern) else { -// return &mut self.backup; -// }; -// -// let Ok(font_bytes) = std::fs::read(&font_path.path) else { -// return &mut self.backup; -// }; -// -// let font = SharedFont::new(Arc::new(font_bytes)); -// -// let r = TextRenderer { -// pattern, -// font, -// sizing: Vec::new(), -// }; -// -// self.renderers.push(r); -// index = Index::Some(self.renderers.len() - 1); -// } -// #[cfg(target_arch = "wasm32")] -// return &mut self.backup; -// } -// -// match index { -// Index::Some(index) => &mut self.renderers[index], -// Index::Backup => &mut self.backup, -// } -// } -// -// pub fn query_ff(&mut self, font_family: Vec) -> &mut TextRenderer { -// let mut renderer = IndexNoBackup::None; -// for f in font_family { -// let pattern = FcPattern { -// name: Some(f), -// ..Default::default() -// }; -// -// let rend = self.query_no_backup(pattern); -// -// match rend { -// IndexNoBackup::Some(index) => { -// return &mut self.renderers[index]; -// } -// IndexNoBackup::Insert(path) => { -// renderer = IndexNoBackup::Insert(path); -// } -// IndexNoBackup::None => {} -// } -// } -// -// match renderer { -// IndexNoBackup::Some(index) => &mut self.renderers[index], //unreachable, but we handle it just in case -// IndexNoBackup::Insert(path) => { -// let font_bytes = std::fs::read(&path).expect("Failed to read font file"); -// let font = SharedFont::unknown(Arc::new(font_bytes)); -// -// let r = TextRenderer { -// pattern: FcPattern { -// name: Some(path), -// ..Default::default() -// }, -// font, -// sizing: Vec::new(), -// }; -// -// let idx = self.renderers.len(); -// self.renderers.push(r); -// &mut self.renderers[idx] -// } -// IndexNoBackup::None => &mut self.backup, -// } -// } -// -// pub fn query_all_shared(&mut self, font_family: Vec) -> Vec>> { -// let mut fonts = Vec::with_capacity(font_family.len()); -// -// for f in font_family { -// let pattern = FcPattern { -// name: Some(f), -// ..Default::default() -// }; -// -// let font = self.query_font_no_backup(pattern); -// -// if let Some(font) = font { -// fonts.push(font.data); -// } -// } -// -// fonts -// } -// } -// -// #[derive(Clone)] -// pub struct TextRenderer { -// pub pattern: FcPattern, -// pub font: SharedFont, -// pub sizing: Vec, -// } -// -// #[derive(Clone)] -// pub struct FontSizing { -// pub font_size: f32, -// pub line_height: f32, -// } - -pub mod font; - -pub const ROBOTO_FONT: &[u8] = include_bytes!("../../../resources/fonts/Roboto-Regular.ttf"); diff --git a/crates/gosub_vello/Cargo.toml b/crates/gosub_vello/Cargo.toml index 24514d0df..07b8e672c 100644 --- a/crates/gosub_vello/Cargo.toml +++ b/crates/gosub_vello/Cargo.toml @@ -7,7 +7,6 @@ license = "MIT" [dependencies] gosub_shared = { path = "../gosub_shared" } -gosub_typeface = { path = "../gosub_typeface" } gosub_svg = { path = "../gosub_svg" } vello = "0.3.0" vello_encoding = "0.3.0" diff --git a/crates/gosub_vello/src/debug/text.rs b/crates/gosub_vello/src/debug/text.rs index b4dbf1f27..0b9b68151 100644 --- a/crates/gosub_vello/src/debug/text.rs +++ b/crates/gosub_vello/src/debug/text.rs @@ -1,7 +1,7 @@ use crate::{Brush, Color, Scene, Transform}; use gosub_shared::render_backend::{Brush as _, Color as _, Transform as _}; use gosub_shared::types::Point; -use gosub_typeface::ROBOTO_FONT; +use gosub_shared::ROBOTO_FONT; use std::sync::{Arc, LazyLock}; use vello::peniko::{Blob, BrushRef, Fill, Font, Style, StyleRef}; use vello::skrifa; diff --git a/docs/crates.md b/docs/crates.md index 91cc4e0c9..59c1154fa 100644 --- a/docs/crates.md +++ b/docs/crates.md @@ -12,7 +12,6 @@ The engine is split up in a few different crates. This is done to keep the codeb * gosub_shared * gosub_svg * gosub_taffy -* gosub_typeface * gosub_useragent * gosub_v8 * gosub_vello @@ -52,9 +51,6 @@ Implementation of the SVG Document for `usvg` and optionally the `resvg` crates, ## gosub_taffy Implementation of layout traits for the `taffy` layouting system. -## gosub_typeface -Currently doesn't do much, but it is used to store fallback fonts and the `Font` trait - ## gosub_useragent This crate keeps a simple application with event loop renders html5 documents. It can be seen as a very simple browser. Ultimately, this crate will be removed in favor of an external application that will use the engine. diff --git a/src/bin/html5-parser-test.rs b/src/bin/html5-parser-test.rs index debadffde..5b73f75aa 100755 --- a/src/bin/html5-parser-test.rs +++ b/src/bin/html5-parser-test.rs @@ -3,10 +3,10 @@ use gosub_html5::document::builder::DocumentBuilderImpl; use gosub_html5::document::document_impl::DocumentImpl; use gosub_html5::document::fragment::DocumentFragmentImpl; use gosub_html5::parser::Html5Parser; -use gosub_shared::traits::config::{HasCssSystem, HasDocument, HasHtmlParser}; -use gosub_shared::types::Result; use gosub_html5::testing::tree_construction::fixture::{fixture_root_path, read_fixture_from_path}; use gosub_html5::testing::tree_construction::Harness; +use gosub_shared::traits::config::{HasCssSystem, HasDocument, HasHtmlParser}; +use gosub_shared::types::Result; use std::io::Write; use std::path::{Path, PathBuf}; use walkdir::WalkDir; diff --git a/src/bin/parser-test.rs b/src/bin/parser-test.rs index c75a0136b..65bc1f9b8 100755 --- a/src/bin/parser-test.rs +++ b/src/bin/parser-test.rs @@ -3,11 +3,11 @@ use gosub_html5::document::builder::DocumentBuilderImpl; use gosub_html5::document::document_impl::DocumentImpl; use gosub_html5::document::fragment::DocumentFragmentImpl; use gosub_html5::parser::Html5Parser; -use gosub_shared::traits::config::{HasCssSystem, HasDocument, HasHtmlParser}; use gosub_html5::testing::tree_construction::fixture::read_fixtures; use gosub_html5::testing::tree_construction::result::ResultStatus; use gosub_html5::testing::tree_construction::Harness; use gosub_html5::testing::tree_construction::Test; +use gosub_shared::traits::config::{HasCssSystem, HasDocument, HasHtmlParser}; /// Holds the results from all tests that are executed #[derive(Default)]