aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
authorMariot Chauvin <mariot.chauvin@gmail.com>2017-03-10 10:27:58 +0000
committerMariot Chauvin <mariot.chauvin@gmail.com>2017-03-14 14:18:56 +0000
commitf8c7235f73865705f2f1104619ea3c753fbb3c9b (patch)
treead87b674786198983f5ef6e5a22e3602255b5af4 /components/script/dom/document.rs
parent1794c6673a80209e77c0c4205de072deac741b1f (diff)
downloadservo-f8c7235f73865705f2f1104619ea3c753fbb3c9b.tar.gz
servo-f8c7235f73865705f2f1104619ea3c753fbb3c9b.zip
Access browsing context without panic
Current browsing context accessor in Document unwrap the browsing context option which prevents document to handle correctly the case when there is no browsing context.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 29d7227dee9..14786820ffc 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -390,7 +390,7 @@ impl Document {
#[inline]
pub fn browsing_context(&self) -> Option<Root<BrowsingContext>> {
if self.has_browsing_context {
- Some(self.window.browsing_context())
+ self.window.maybe_browsing_context()
} else {
None
}