diff --git a/crates/gosub_css3/src/system.rs b/crates/gosub_css3/src/system.rs index 1c44c83c..22b07f32 100644 --- a/crates/gosub_css3/src/system.rs +++ b/crates/gosub_css3/src/system.rs @@ -5,7 +5,7 @@ use crate::matcher::property_definitions::get_css_definitions; use crate::matcher::shorthands::FixList; use crate::matcher::styling::{match_selector, CssProperties, CssProperty, DeclarationProperty}; use crate::stylesheet::{CssDeclaration, CssValue, Specificity}; -use crate::Css3; +use crate::{load_default_useragent_stylesheet, Css3}; use gosub_shared::document::DocumentHandle; use gosub_shared::errors::CssResult; use gosub_shared::node::NodeId; @@ -97,6 +97,10 @@ impl CssSystem for Css3System { fn inheritance>(tree: &mut T) { Self::resolve_inheritance(tree, tree.root(), &Vec::new()); } + + fn load_default_useragent_stylesheet() -> Self::Stylesheet { + load_default_useragent_stylesheet() + } } impl Css3System { diff --git a/crates/gosub_render_utils/src/render_tree.rs b/crates/gosub_render_utils/src/render_tree.rs index cd3d63aa..e65faca5 100644 --- a/crates/gosub_render_utils/src/render_tree.rs +++ b/crates/gosub_render_utils/src/render_tree.rs @@ -237,7 +237,9 @@ impl, C: CssSystem> RenderTree { else { //we need to remove it from the parent in the render tree and from the document - todo!("unrenderable node"); + // todo!("unrenderable node"); + + continue }; let data = node.data(); diff --git a/crates/gosub_renderer/src/render_tree.rs b/crates/gosub_renderer/src/render_tree.rs index 48e45b24..76dc92a1 100644 --- a/crates/gosub_renderer/src/render_tree.rs +++ b/crates/gosub_renderer/src/render_tree.rs @@ -87,11 +87,11 @@ pub(crate) fn load_html_rendertree, C: CssSystem> eprintln!("Parse error: {:?}", error); } - _ = doc_handle.get_mut(); + let mut doc = doc_handle.get_mut(); - // doc.add_stylesheet(C::load_default_useragent_stylesheet()?); - - // drop(doc); + doc.add_stylesheet(C::load_default_useragent_stylesheet()); + + drop(doc); generate_render_tree(DocumentHandle::clone(&doc_handle)) } diff --git a/crates/gosub_shared/src/traits/css3.rs b/crates/gosub_shared/src/traits/css3.rs index 76c8b575..3ea2e514 100644 --- a/crates/gosub_shared/src/traits/css3.rs +++ b/crates/gosub_shared/src/traits/css3.rs @@ -39,6 +39,9 @@ pub trait CssSystem: Clone { ) -> Option; fn inheritance>(tree: &mut T); + + fn load_default_useragent_stylesheet() -> Self::Stylesheet; + } pub trait CssStylesheet: PartialEq {