mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Auto merge of #11548 - kevgs:default_view2, r=Ms2ger
Make Document::DefaultView return a null value when there's no browsing context Fixes #11469. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11548) <!-- Reviewable:end -->
This commit is contained in:
commit
77e0089c12
7 changed files with 66 additions and 28 deletions
|
@ -2551,8 +2551,12 @@ impl DocumentMethods for Document {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-document-defaultview
|
||||
fn DefaultView(&self) -> Root<Window> {
|
||||
Root::from_ref(&*self.window)
|
||||
fn GetDefaultView(&self) -> Option<Root<Window>> {
|
||||
if self.browsing_context.is_none() {
|
||||
None
|
||||
} else {
|
||||
Some(Root::from_ref(&*self.window))
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-document-cookie
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue