mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make Document::DefaultView return a null value when there's no browsing context
This commit is contained in:
parent
a80767993b
commit
3bb093cc16
7 changed files with 66 additions and 28 deletions
|
@ -1297,7 +1297,10 @@ impl Element {
|
|||
}
|
||||
|
||||
// Step 5
|
||||
let win = doc.DefaultView();
|
||||
let win = match doc.GetDefaultView() {
|
||||
None => return,
|
||||
Some(win) => win,
|
||||
};
|
||||
|
||||
// Step 7
|
||||
if *self.root_element() == *self {
|
||||
|
@ -1635,7 +1638,10 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// Step 3
|
||||
let win = doc.DefaultView();
|
||||
let win = match doc.GetDefaultView() {
|
||||
None => return 0.0,
|
||||
Some(win) => win,
|
||||
};
|
||||
|
||||
// Step 5
|
||||
if *self.root_element() == *self {
|
||||
|
@ -1683,7 +1689,10 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// Step 5
|
||||
let win = doc.DefaultView();
|
||||
let win = match doc.GetDefaultView() {
|
||||
None => return,
|
||||
Some(win) => win,
|
||||
};
|
||||
|
||||
// Step 7
|
||||
if *self.root_element() == *self {
|
||||
|
@ -1721,7 +1730,10 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// Step 3
|
||||
let win = doc.DefaultView();
|
||||
let win = match doc.GetDefaultView() {
|
||||
None => return 0.0,
|
||||
Some(win) => win,
|
||||
};
|
||||
|
||||
// Step 5
|
||||
if *self.root_element() == *self {
|
||||
|
@ -1769,7 +1781,10 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// Step 5
|
||||
let win = doc.DefaultView();
|
||||
let win = match doc.GetDefaultView() {
|
||||
None => return,
|
||||
Some(win) => win,
|
||||
};
|
||||
|
||||
// Step 7
|
||||
if *self.root_element() == *self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue