mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
Auto merge of #6851 - dzbarsky:gCS, r=jdm
Return None as style for elements not in a document <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6851) <!-- Reviewable:end -->
This commit is contained in:
commit
e42fddd9cc
2 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue