mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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.
This commit is contained in:
parent
1794c6673a
commit
f8c7235f73
2 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue