pub(crate) trait UAShadowRoot<ShadowTree> {
// Required methods
fn store_for_shadow_tree(
&self,
cx: &mut JSContext,
shadow_root: DomRoot<ShadowRoot>,
);
fn borrow_for_shadow_tree(&self) -> Ref<'_, Option<ShadowTree>>;
// Provided method
fn ensure_shadow_tree(
&self,
cx: &mut JSContext,
element: &Element,
) -> Ref<'_, ShadowTree> { ... }
}