Skip to content
Permalink
Browse files

Rename shadow_root_from_node to containing_shadow_root

  • Loading branch information...
ferjm committed Apr 22, 2019
1 parent e4f34fd commit 9d52feffbbfd77a1e5432ae108e338d572e07eb8
Showing with 4 additions and 4 deletions.
  1. +2 −2 components/script/dom/node.rs
  2. +2 −2 components/script/stylesheet_loader.rs
@@ -2827,7 +2827,7 @@ pub fn document_from_node<T: DerivedFrom<Node> + DomObject>(derived: &T) -> DomR
derived.upcast().owner_doc()
}

pub fn shadow_root_from_node<T: DerivedFrom<Node> + DomObject>(
pub fn containing_shadow_root<T: DerivedFrom<Node> + DomObject>(
derived: &T,
) -> Option<DomRoot<ShadowRoot>> {
derived.upcast().owner_shadow_root()
@@ -2837,7 +2837,7 @@ pub fn shadow_root_from_node<T: DerivedFrom<Node> + DomObject>(
pub fn stylesheets_owner_from_node<T: DerivedFrom<Node> + DomObject>(
derived: &T,
) -> StyleSheetListOwner {
if let Some(shadow_root) = shadow_root_from_node(derived) {
if let Some(shadow_root) = containing_shadow_root(derived) {
StyleSheetListOwner::ShadowRoot(Dom::from_ref(&*shadow_root))
} else {
StyleSheetListOwner::Document(Dom::from_ref(&*document_from_node(derived)))
@@ -13,7 +13,7 @@ use crate::dom::eventtarget::EventTarget;
use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::htmllinkelement::{HTMLLinkElement, RequestGenerationId};
use crate::dom::node::{document_from_node, shadow_root_from_node, window_from_node};
use crate::dom::node::{containing_shadow_root, document_from_node, window_from_node};
use crate::dom::performanceresourcetiming::InitiatorType;
use crate::dom::shadowroot::ShadowRoot;
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
@@ -270,7 +270,7 @@ impl<'a> StylesheetLoader<'a> {
integrity_metadata: String,
) {
let document = document_from_node(self.elem);
let shadow_root = shadow_root_from_node(self.elem).map(|sr| Trusted::new(&*sr));
let shadow_root = containing_shadow_root(self.elem).map(|sr| Trusted::new(&*sr));
let gen = self
.elem
.downcast::<HTMLLinkElement>()

0 comments on commit 9d52fef

Please sign in to comment.
You can’t perform that action at this time.