diff --git a/crates/ui/src/html/mod.rs b/crates/ui/src/html/mod.rs
index 3d27a1b21..f55a22446 100644
--- a/crates/ui/src/html/mod.rs
+++ b/crates/ui/src/html/mod.rs
@@ -20,6 +20,7 @@ mod style;
mod svg;
mod text;
+use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::sync::Arc;
@@ -51,7 +52,7 @@ pub(crate) const CONTEXT: &str = "HtmlView";
/// repaints neither parse nor cascade.
pub struct HtmlState {
source: Arc,
- doc: Document,
+ doc: Rc,
sheet: Stylesheet,
media: MediaSlots,
computed: Option>,
@@ -67,7 +68,7 @@ pub struct HtmlState {
impl HtmlState {
pub fn new(html: impl Into>) -> Self {
let source: Arc = html.into();
- let doc = Document::parse(&source);
+ let doc = Rc::new(Document::parse(&source));
let sheet = Stylesheet::parse_all(&doc.stylesheets);
Self {
source,
@@ -141,7 +142,7 @@ impl HtmlState {
return;
}
self.source = Arc::from(html);
- self.doc = Document::parse(&self.source);
+ self.doc = Rc::new(Document::parse(&self.source));
self.sheet = Stylesheet::parse_all(&self.doc.stylesheets);
self.media.clear();
self.computed = None;
@@ -217,6 +218,11 @@ struct Computed {
before: HashMap,
after: HashMap,
pictures: HashMap,
+ /// The ``s of the page's `