diff options
author | David Zbarsky <dzbarsky@gmail.com> | 2015-07-30 12:36:08 -0400 |
---|---|---|
committer | David Zbarsky <dzbarsky@gmail.com> | 2015-07-30 12:36:08 -0400 |
commit | 36145d0686989d654b38aecb6db8ef139d9f8895 (patch) | |
tree | 59f00bb10f07e127c06c934f3431265a07f1354f /components/script/dom/cssstyledeclaration.rs | |
parent | acbca7b3aaf18866f7a1a79d9684149897bf4305 (diff) | |
download | servo-36145d0686989d654b38aecb6db8ef139d9f8895.tar.gz servo-36145d0686989d654b38aecb6db8ef139d9f8895.zip |
Return None as style for elements not in a document
Diffstat (limited to 'components/script/dom/cssstyledeclaration.rs')
-rw-r--r-- | components/script/dom/cssstyledeclaration.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index 99e70f9c387..180a356dd90 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -99,6 +99,11 @@ impl<'a> PrivateCSSStyleDeclarationHelpers for &'a CSSStyleDeclaration { fn get_computed_style(self, property: &Atom) -> Option<DOMString> { let owner = self.owner.root(); let node = NodeCast::from_ref(owner.r()); + if !node.is_in_doc() { + // TODO: Node should be matched against the style rules of this window. + // Firefox is currently the only browser to implement this. + return None; + } let addr = node.to_trusted_node_address(); window_from_node(owner.r()).resolved_style_query(addr, self.pseudo.clone(), property) } |