mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Rename Promise::new to Promise::new_in_current_compartment
This commit is contained in:
parent
6fa1853bb1
commit
782b58587a
25 changed files with 93 additions and 51 deletions
|
@ -3129,9 +3129,10 @@ impl Document {
|
|||
}
|
||||
|
||||
// https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen
|
||||
#[allow(unsafe_code)]
|
||||
pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise> {
|
||||
// Step 1
|
||||
let promise = Promise::new(&self.global());
|
||||
let promise = unsafe { Promise::new_in_current_compartment(&self.global()) };
|
||||
let mut error = false;
|
||||
|
||||
// Step 4
|
||||
|
@ -3195,10 +3196,11 @@ impl Document {
|
|||
}
|
||||
|
||||
// https://fullscreen.spec.whatwg.org/#exit-fullscreen
|
||||
#[allow(unsafe_code)]
|
||||
pub fn exit_fullscreen(&self) -> Rc<Promise> {
|
||||
let global = self.global();
|
||||
// Step 1
|
||||
let promise = Promise::new(&global);
|
||||
let promise = unsafe { Promise::new_in_current_compartment(&global) };
|
||||
// Step 2
|
||||
if self.fullscreen_element.get().is_none() {
|
||||
promise.reject_error(Error::Type(String::from("fullscreen is null")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue