mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Rename Reflectable::global_scope to global
This commit is contained in:
parent
b6bbd41e11
commit
d8e92bb271
37 changed files with 151 additions and 151 deletions
|
@ -42,11 +42,11 @@ pub enum FetchedData {
|
|||
// https://fetch.spec.whatwg.org/#concept-body-consume-body
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn consume_body<T: BodyOperations + Reflectable>(object: &T, body_type: BodyType) -> Rc<Promise> {
|
||||
let promise = Promise::new(&object.global_scope());
|
||||
let promise = Promise::new(&object.global());
|
||||
|
||||
// Step 1
|
||||
if object.get_body_used() || object.is_locked() {
|
||||
promise.reject_error(promise.global_scope().get_cx(), Error::Type(
|
||||
promise.reject_error(promise.global().get_cx(), Error::Type(
|
||||
"The response's stream is disturbed or locked".to_string()));
|
||||
return promise;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ pub fn consume_body_with_promise<T: BodyOperations + Reflectable>(object: &T,
|
|||
body_type,
|
||||
object.get_mime_type());
|
||||
|
||||
let cx = promise.global_scope().get_cx();
|
||||
let cx = promise.global().get_cx();
|
||||
match pkg_data_results {
|
||||
Ok(results) => {
|
||||
match results {
|
||||
|
@ -98,7 +98,7 @@ fn run_package_data_algorithm<T: BodyOperations + Reflectable>(object: &T,
|
|||
body_type: BodyType,
|
||||
mime_type: Ref<Vec<u8>>)
|
||||
-> Fallible<FetchedData> {
|
||||
let global = object.global_scope();
|
||||
let global = object.global();
|
||||
let cx = global.get_cx();
|
||||
let mime = &*mime_type;
|
||||
match body_type {
|
||||
|
|
|
@ -3170,7 +3170,7 @@ class CGCallGenerator(CGThing):
|
|||
if static:
|
||||
glob = "&global"
|
||||
else:
|
||||
glob = "&this.global_scope()"
|
||||
glob = "&this.global()"
|
||||
|
||||
self.cgRoot.append(CGGeneric(
|
||||
"let result = match result {\n"
|
||||
|
|
|
@ -93,7 +93,7 @@ impl<T: Reflectable + JSTraceable + Iterable> IterableIterator<T> {
|
|||
iterable: JS::from_ref(iterable),
|
||||
index: Cell::new(0),
|
||||
};
|
||||
reflect_dom_object(iterator, &*iterable.global_scope(), wrap)
|
||||
reflect_dom_object(iterator, &*iterable.global(), wrap)
|
||||
}
|
||||
|
||||
/// Return the next value from the iterable object.
|
||||
|
|
|
@ -80,7 +80,7 @@ pub trait Reflectable {
|
|||
fn reflector(&self) -> &Reflector;
|
||||
|
||||
/// Returns the global scope of the realm that the Reflectable was created in.
|
||||
fn global_scope(&self) -> Root<GlobalScope> where Self: Sized {
|
||||
fn global(&self) -> Root<GlobalScope> where Self: Sized {
|
||||
GlobalScope::from_reflector(self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ impl Blob {
|
|||
}
|
||||
};
|
||||
|
||||
Blob::new(&parent.global_scope(), blob_impl, relative_content_type.into())
|
||||
Blob::new(&parent.global(), blob_impl, relative_content_type.into())
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#constructorBlob
|
||||
|
@ -143,7 +143,7 @@ impl Blob {
|
|||
let (buffer, is_new_buffer) = match *f.cache.borrow() {
|
||||
Some(ref bytes) => (bytes.clone(), false),
|
||||
None => {
|
||||
let bytes = read_file(&self.global_scope(), f.id.clone())?;
|
||||
let bytes = read_file(&self.global(), f.id.clone())?;
|
||||
(bytes, true)
|
||||
}
|
||||
};
|
||||
|
@ -188,7 +188,7 @@ impl Blob {
|
|||
/// valid or invalid Blob URL.
|
||||
fn promote(&self, set_valid: bool) -> Uuid {
|
||||
let mut bytes = vec![];
|
||||
let global_url = self.global_scope().get_url();
|
||||
let global_url = self.global().get_url();
|
||||
|
||||
match *self.blob_impl.borrow_mut() {
|
||||
BlobImpl::Sliced(_, _) => {
|
||||
|
@ -248,7 +248,7 @@ impl Blob {
|
|||
/// Get a FileID representing sliced parent-blob content
|
||||
fn create_sliced_url_id(&self, parent_id: &Uuid,
|
||||
rel_pos: &RelativePos, parent_len: u64) -> Uuid {
|
||||
let origin = get_blob_origin(&self.global_scope().get_url());
|
||||
let origin = get_blob_origin(&self.global().get_url());
|
||||
|
||||
let (tx, rx) = ipc::channel().unwrap();
|
||||
let msg = FileManagerThreadMsg::AddSlicedURLEntry(parent_id.clone(),
|
||||
|
@ -277,7 +277,7 @@ impl Blob {
|
|||
/// Cleanups at the time of destruction/closing
|
||||
fn clean_up_file_resource(&self) {
|
||||
if let BlobImpl::File(ref f) = *self.blob_impl.borrow() {
|
||||
let origin = get_blob_origin(&self.global_scope().get_url());
|
||||
let origin = get_blob_origin(&self.global().get_url());
|
||||
|
||||
let (tx, rx) = ipc::channel().unwrap();
|
||||
|
||||
|
@ -288,7 +288,7 @@ impl Blob {
|
|||
}
|
||||
|
||||
fn send_to_file_manager(&self, msg: FileManagerThreadMsg) {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let resource_threads = global.resource_threads();
|
||||
let _ = resource_threads.send(CoreResourceMsg::ToFileManager(msg));
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ impl Bluetooth {
|
|||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
|
||||
self.global_scope().as_window().bluetooth_thread()
|
||||
self.global().as_window().bluetooth_thread()
|
||||
}
|
||||
|
||||
fn request_device(&self, option: &RequestDeviceOptions) -> Fallible<Root<BluetoothDevice>> {
|
||||
|
@ -103,7 +103,7 @@ impl Bluetooth {
|
|||
// Step 12-13.
|
||||
match device {
|
||||
Ok(device) => {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let ad_data = BluetoothAdvertisingData::new(&global,
|
||||
device.appearance,
|
||||
device.tx_power,
|
||||
|
@ -275,8 +275,8 @@ pub fn result_to_promise<T: ToJSValConvertible>(global: &GlobalScope,
|
|||
-> Rc<Promise> {
|
||||
let p = Promise::new(global);
|
||||
match bluetooth_result {
|
||||
Ok(v) => p.resolve_native(p.global_scope().get_cx(), &v),
|
||||
Err(e) => p.reject_error(p.global_scope().get_cx(), e),
|
||||
Ok(v) => p.resolve_native(p.global().get_cx(), &v),
|
||||
Err(e) => p.reject_error(p.global().get_cx(), e),
|
||||
}
|
||||
p
|
||||
}
|
||||
|
@ -297,6 +297,6 @@ impl BluetoothMethods for Bluetooth {
|
|||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice
|
||||
fn RequestDevice(&self, option: &RequestDeviceOptions) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.request_device(option))
|
||||
result_to_promise(&self.global(), self.request_device(option))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ impl BluetoothDeviceMethods for BluetoothDevice {
|
|||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt
|
||||
fn Gatt(&self) -> Root<BluetoothRemoteGATTServer> {
|
||||
self.gatt.or_init(|| {
|
||||
BluetoothRemoteGATTServer::new(&self.global_scope(), self)
|
||||
BluetoothRemoteGATTServer::new(&self.global(), self)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
|
||||
self.global_scope().as_window().bluetooth_thread()
|
||||
self.global().as_window().bluetooth_thread()
|
||||
}
|
||||
|
||||
fn get_instance_id(&self) -> String {
|
||||
|
@ -93,7 +93,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
let descriptor = receiver.recv().unwrap();
|
||||
match descriptor {
|
||||
Ok(descriptor) => {
|
||||
Ok(BluetoothRemoteGATTDescriptor::new(&self.global_scope(),
|
||||
Ok(BluetoothRemoteGATTDescriptor::new(&self.global(),
|
||||
self,
|
||||
DOMString::from(descriptor.uuid),
|
||||
descriptor.instance_id))
|
||||
|
@ -124,7 +124,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
match descriptors_vec {
|
||||
Ok(descriptor_vec) => {
|
||||
Ok(descriptor_vec.into_iter()
|
||||
.map(|desc| BluetoothRemoteGATTDescriptor::new(&self.global_scope(),
|
||||
.map(|desc| BluetoothRemoteGATTDescriptor::new(&self.global(),
|
||||
self,
|
||||
DOMString::from(desc.uuid),
|
||||
desc.instance_id))
|
||||
|
@ -212,7 +212,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptor
|
||||
fn GetDescriptor(&self, descriptor: BluetoothDescriptorUUID) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_descriptor(descriptor))
|
||||
result_to_promise(&self.global(), self.get_descriptor(descriptor))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
@ -220,7 +220,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
fn GetDescriptors(&self,
|
||||
descriptor: Option<BluetoothDescriptorUUID>)
|
||||
-> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_descriptors(descriptor))
|
||||
result_to_promise(&self.global(), self.get_descriptors(descriptor))
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-value
|
||||
|
@ -231,12 +231,12 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-readvalue
|
||||
fn ReadValue(&self) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.read_value())
|
||||
result_to_promise(&self.global(), self.read_value())
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-writevalue
|
||||
fn WriteValue(&self, value: Vec<u8>) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.write_value(value))
|
||||
result_to_promise(&self.global(), self.write_value(value))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ impl BluetoothRemoteGATTDescriptor {
|
|||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
|
||||
self.global_scope().as_window().bluetooth_thread()
|
||||
self.global().as_window().bluetooth_thread()
|
||||
}
|
||||
|
||||
fn get_instance_id(&self) -> String {
|
||||
|
@ -135,12 +135,12 @@ impl BluetoothRemoteGATTDescriptorMethods for BluetoothRemoteGATTDescriptor {
|
|||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-readvalue
|
||||
fn ReadValue(&self) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.read_value())
|
||||
result_to_promise(&self.global(), self.read_value())
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-writevalue
|
||||
fn WriteValue(&self, value: Vec<u8>) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.write_value(value))
|
||||
result_to_promise(&self.global(), self.write_value(value))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ impl BluetoothRemoteGATTServer {
|
|||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
|
||||
self.global_scope().as_window().bluetooth_thread()
|
||||
self.global().as_window().bluetooth_thread()
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
|
||||
|
@ -78,7 +78,7 @@ impl BluetoothRemoteGATTServer {
|
|||
let service = receiver.recv().unwrap();
|
||||
match service {
|
||||
Ok(service) => {
|
||||
Ok(BluetoothRemoteGATTService::new(&self.global_scope(),
|
||||
Ok(BluetoothRemoteGATTService::new(&self.global(),
|
||||
&self.device.get(),
|
||||
DOMString::from(service.uuid),
|
||||
service.is_primary,
|
||||
|
@ -110,7 +110,7 @@ impl BluetoothRemoteGATTServer {
|
|||
match services_vec {
|
||||
Ok(service_vec) => {
|
||||
Ok(service_vec.into_iter()
|
||||
.map(|service| BluetoothRemoteGATTService::new(&self.global_scope(),
|
||||
.map(|service| BluetoothRemoteGATTService::new(&self.global(),
|
||||
&self.device.get(),
|
||||
DOMString::from(service.uuid),
|
||||
service.is_primary,
|
||||
|
@ -138,7 +138,7 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
|||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
|
||||
fn Connect(&self) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.connect())
|
||||
result_to_promise(&self.global(), self.connect())
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-disconnect
|
||||
|
@ -161,7 +161,7 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
|||
#[allow(unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservice
|
||||
fn GetPrimaryService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_primary_service(service))
|
||||
result_to_promise(&self.global(), self.get_primary_service(service))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
@ -169,6 +169,6 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
|||
fn GetPrimaryServices(&self,
|
||||
service: Option<BluetoothServiceUUID>)
|
||||
-> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_primary_services(service))
|
||||
result_to_promise(&self.global(), self.get_primary_services(service))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ impl BluetoothRemoteGATTService {
|
|||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
|
||||
self.global_scope().as_window().bluetooth_thread()
|
||||
self.global().as_window().bluetooth_thread()
|
||||
}
|
||||
|
||||
fn get_instance_id(&self) -> String {
|
||||
|
@ -82,7 +82,7 @@ impl BluetoothRemoteGATTService {
|
|||
let characteristic = receiver.recv().unwrap();
|
||||
match characteristic {
|
||||
Ok(characteristic) => {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let properties = BluetoothCharacteristicProperties::new(&global,
|
||||
characteristic.broadcast,
|
||||
characteristic.read,
|
||||
|
@ -126,7 +126,7 @@ impl BluetoothRemoteGATTService {
|
|||
match characteristics_vec {
|
||||
Ok(characteristic_vec) => {
|
||||
for characteristic in characteristic_vec {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let properties = BluetoothCharacteristicProperties::new(&global,
|
||||
characteristic.broadcast,
|
||||
characteristic.read,
|
||||
|
@ -167,7 +167,7 @@ impl BluetoothRemoteGATTService {
|
|||
let service = receiver.recv().unwrap();
|
||||
match service {
|
||||
Ok(service) => {
|
||||
Ok(BluetoothRemoteGATTService::new(&self.global_scope(),
|
||||
Ok(BluetoothRemoteGATTService::new(&self.global(),
|
||||
&self.device.get(),
|
||||
DOMString::from(service.uuid),
|
||||
service.is_primary,
|
||||
|
@ -201,7 +201,7 @@ impl BluetoothRemoteGATTService {
|
|||
match services_vec {
|
||||
Ok(service_vec) => {
|
||||
Ok(service_vec.into_iter()
|
||||
.map(|service| BluetoothRemoteGATTService::new(&self.global_scope(),
|
||||
.map(|service| BluetoothRemoteGATTService::new(&self.global(),
|
||||
&self.device.get(),
|
||||
DOMString::from(service.uuid),
|
||||
service.is_primary,
|
||||
|
@ -236,7 +236,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
|||
fn GetCharacteristic(&self,
|
||||
characteristic: BluetoothCharacteristicUUID)
|
||||
-> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_characteristic(characteristic))
|
||||
result_to_promise(&self.global(), self.get_characteristic(characteristic))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
@ -244,7 +244,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
|||
fn GetCharacteristics(&self,
|
||||
characteristic: Option<BluetoothCharacteristicUUID>)
|
||||
-> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_characteristics(characteristic))
|
||||
result_to_promise(&self.global(), self.get_characteristics(characteristic))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
@ -252,7 +252,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
|||
fn GetIncludedService(&self,
|
||||
service: BluetoothServiceUUID)
|
||||
-> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_included_service(service))
|
||||
result_to_promise(&self.global(), self.get_included_service(service))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
@ -260,6 +260,6 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
|||
fn GetIncludedServices(&self,
|
||||
service: Option<BluetoothServiceUUID>)
|
||||
-> Rc<Promise> {
|
||||
result_to_promise(&self.global_scope(), self.get_included_services(service))
|
||||
result_to_promise(&self.global(), self.get_included_services(service))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1016,12 +1016,12 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
|
||||
let sw = cmp::max(1, sw.abs().to_u32().unwrap());
|
||||
let sh = cmp::max(1, sh.abs().to_u32().unwrap());
|
||||
Ok(ImageData::new(&self.global_scope(), sw, sh, None))
|
||||
Ok(ImageData::new(&self.global(), sw, sh, None))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createimagedata
|
||||
fn CreateImageData_(&self, imagedata: &ImageData) -> Fallible<Root<ImageData>> {
|
||||
Ok(ImageData::new(&self.global_scope(),
|
||||
Ok(ImageData::new(&self.global(),
|
||||
imagedata.Width(),
|
||||
imagedata.Height(),
|
||||
None))
|
||||
|
@ -1077,7 +1077,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
chunk[2] = UNPREMULTIPLY_TABLE[256 * alpha + chunk[2] as usize];
|
||||
}
|
||||
|
||||
Ok(ImageData::new(&self.global_scope(), sw, sh, Some(data)))
|
||||
Ok(ImageData::new(&self.global(), sw, sh, Some(data)))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata
|
||||
|
@ -1121,7 +1121,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
x1: Finite<f64>,
|
||||
y1: Finite<f64>)
|
||||
-> Root<CanvasGradient> {
|
||||
CanvasGradient::new(&self.global_scope(),
|
||||
CanvasGradient::new(&self.global(),
|
||||
CanvasGradientStyle::Linear(LinearGradientStyle::new(*x0,
|
||||
*y0,
|
||||
*x1,
|
||||
|
@ -1142,7 +1142,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
return Err(Error::IndexSize);
|
||||
}
|
||||
|
||||
Ok(CanvasGradient::new(&self.global_scope(),
|
||||
Ok(CanvasGradient::new(&self.global(),
|
||||
CanvasGradientStyle::Radial(RadialGradientStyle::new(*x0,
|
||||
*y0,
|
||||
*r0,
|
||||
|
@ -1182,7 +1182,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
}
|
||||
|
||||
if let Ok(rep) = RepetitionStyle::from_str(&repetition) {
|
||||
Ok(CanvasPattern::new(&self.global_scope(),
|
||||
Ok(CanvasPattern::new(&self.global(),
|
||||
image_data,
|
||||
image_size,
|
||||
rep,
|
||||
|
|
|
@ -463,50 +463,50 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
|
|||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-translate
|
||||
fn Translate(&self, tx: f64, ty: f64, tz: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).TranslateSelf(tx, ty, tz)
|
||||
DOMMatrix::from_readonly(&self.global(), self).TranslateSelf(tx, ty, tz)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-scale
|
||||
fn Scale(&self, scaleX: f64, scaleY: Option<f64>, scaleZ: f64,
|
||||
originX: f64, originY: f64, originZ: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self)
|
||||
DOMMatrix::from_readonly(&self.global(), self)
|
||||
.ScaleSelf(scaleX, scaleY, scaleZ, originX, originY, originZ)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-scale3d
|
||||
fn Scale3d(&self, scale: f64, originX: f64, originY: f64, originZ: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self)
|
||||
DOMMatrix::from_readonly(&self.global(), self)
|
||||
.Scale3dSelf(scale, originX, originY, originZ)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-rotate
|
||||
fn Rotate(&self, rotX: f64, rotY: Option<f64>, rotZ: Option<f64>) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).RotateSelf(rotX, rotY, rotZ)
|
||||
DOMMatrix::from_readonly(&self.global(), self).RotateSelf(rotX, rotY, rotZ)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-rotatefromvector
|
||||
fn RotateFromVector(&self, x: f64, y: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).RotateFromVectorSelf(x, y)
|
||||
DOMMatrix::from_readonly(&self.global(), self).RotateFromVectorSelf(x, y)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-rotateaxisangle
|
||||
fn RotateAxisAngle(&self, x: f64, y: f64, z: f64, angle: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).RotateAxisAngleSelf(x, y, z, angle)
|
||||
DOMMatrix::from_readonly(&self.global(), self).RotateAxisAngleSelf(x, y, z, angle)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-skewx
|
||||
fn SkewX(&self, sx: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).SkewXSelf(sx)
|
||||
DOMMatrix::from_readonly(&self.global(), self).SkewXSelf(sx)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-skewy
|
||||
fn SkewY(&self, sy: f64) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).SkewYSelf(sy)
|
||||
DOMMatrix::from_readonly(&self.global(), self).SkewYSelf(sy)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-multiply
|
||||
fn Multiply(&self, other: &DOMMatrixInit) -> Fallible<Root<DOMMatrix>> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).MultiplySelf(&other)
|
||||
DOMMatrix::from_readonly(&self.global(), self).MultiplySelf(&other)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipx
|
||||
|
@ -517,7 +517,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
|
|||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
let matrix = flip.post_mul(&self.matrix.borrow());
|
||||
DOMMatrix::new(&self.global_scope(), is2D, matrix)
|
||||
DOMMatrix::new(&self.global(), is2D, matrix)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipy
|
||||
|
@ -528,12 +528,12 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
|
|||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
let matrix = flip.post_mul(&self.matrix.borrow());
|
||||
DOMMatrix::new(&self.global_scope(), is2D, matrix)
|
||||
DOMMatrix::new(&self.global(), is2D, matrix)
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-inverse
|
||||
fn Inverse(&self) -> Root<DOMMatrix> {
|
||||
DOMMatrix::from_readonly(&self.global_scope(), self).InvertSelf()
|
||||
DOMMatrix::from_readonly(&self.global(), self).InvertSelf()
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-transformpoint
|
||||
|
@ -541,7 +541,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
|
|||
let matrix = self.matrix.borrow();
|
||||
let result = matrix.transform_point4d(&Point4D::new(point.x, point.y, point.z, point.w));
|
||||
DOMPoint::new(
|
||||
&self.global_scope(),
|
||||
&self.global(),
|
||||
result.x as f64,
|
||||
result.y as f64,
|
||||
result.z as f64,
|
||||
|
|
|
@ -107,7 +107,7 @@ impl DOMQuadMethods for DOMQuad {
|
|||
let right = self.p1.X().max(self.p2.X()).max(self.p3.X()).max(self.p4.X());
|
||||
let bottom = self.p1.Y().max(self.p2.Y()).max(self.p3.Y()).max(self.p4.Y());
|
||||
|
||||
DOMRect::new(&self.global_scope(),
|
||||
DOMRect::new(&self.global(),
|
||||
left,
|
||||
top,
|
||||
right - left,
|
||||
|
|
|
@ -51,7 +51,7 @@ fn dispatch_to_listeners(event: &Event, target: &EventTarget, event_path: &[&Eve
|
|||
assert!(!event.stop_propagation());
|
||||
assert!(!event.stop_immediate());
|
||||
|
||||
let window = match Root::downcast::<Window>(target.global_scope()) {
|
||||
let window = match Root::downcast::<Window>(target.global()) {
|
||||
Some(window) => {
|
||||
if window.need_emit_timeline_marker(TimelineMarkerType::DOMEvent) {
|
||||
Some(window)
|
||||
|
|
|
@ -154,7 +154,7 @@ impl CompiledEventListener {
|
|||
match *handler {
|
||||
CommonEventHandler::ErrorEventHandler(ref handler) => {
|
||||
if let Some(event) = event.downcast::<ErrorEvent>() {
|
||||
let cx = object.global_scope().get_cx();
|
||||
let cx = object.global().get_cx();
|
||||
rooted!(in(cx) let error = event.Error(cx));
|
||||
let return_value = handler.Call_(object,
|
||||
EventOrString::String(event.Message()),
|
||||
|
@ -200,7 +200,7 @@ impl CompiledEventListener {
|
|||
|
||||
CommonEventHandler::EventHandler(ref handler) => {
|
||||
if let Ok(value) = handler.Call_(object, event, exception_handle) {
|
||||
let cx = object.global_scope().get_cx();
|
||||
let cx = object.global().get_cx();
|
||||
rooted!(in(cx) let value = value);
|
||||
let value = value.handle();
|
||||
|
||||
|
@ -498,7 +498,7 @@ impl EventTarget {
|
|||
bubbles: EventBubbles,
|
||||
cancelable: EventCancelable)
|
||||
-> Root<Event> {
|
||||
let event = Event::new(&self.global_scope(), Atom::from(name), bubbles, cancelable);
|
||||
let event = Event::new(&self.global(), Atom::from(name), bubbles, cancelable);
|
||||
|
||||
event.fire(self);
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ impl FileReader {
|
|||
fr.change_ready_state(FileReaderReadyState::Done);
|
||||
*fr.result.borrow_mut() = None;
|
||||
|
||||
let exception = DOMException::new(&fr.global_scope(), error);
|
||||
let exception = DOMException::new(&fr.global(), error);
|
||||
fr.error.set(Some(&exception));
|
||||
|
||||
fr.dispatch_progress_event(atom!("error"), 0, None);
|
||||
|
@ -288,7 +288,7 @@ impl FileReaderMethods for FileReader {
|
|||
// Steps 1 & 3
|
||||
*self.result.borrow_mut() = None;
|
||||
|
||||
let exception = DOMException::new(&self.global_scope(), DOMErrorName::AbortError);
|
||||
let exception = DOMException::new(&self.global(), DOMErrorName::AbortError);
|
||||
self.error.set(Some(&exception));
|
||||
|
||||
self.terminate_ongoing_reading();
|
||||
|
@ -316,7 +316,7 @@ impl FileReaderMethods for FileReader {
|
|||
|
||||
impl FileReader {
|
||||
fn dispatch_progress_event(&self, type_: Atom, loaded: u64, total: Option<u64>) {
|
||||
let progressevent = ProgressEvent::new(&self.global_scope(),
|
||||
let progressevent = ProgressEvent::new(&self.global(),
|
||||
type_, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable,
|
||||
total.is_some(), loaded, total.unwrap_or(0));
|
||||
progressevent.upcast::<Event>().fire(self.upcast());
|
||||
|
@ -333,7 +333,7 @@ impl FileReader {
|
|||
return Err(Error::InvalidState);
|
||||
}
|
||||
// Step 2
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
if blob.IsClosed() {
|
||||
let exception = DOMException::new(&global, DOMErrorName::InvalidStateError);
|
||||
self.error.set(Some(&exception));
|
||||
|
@ -355,7 +355,7 @@ impl FileReader {
|
|||
let fr = Trusted::new(self);
|
||||
let gen_id = self.generation_id.get();
|
||||
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let wrapper = global.get_runnable_wrapper();
|
||||
let task_source = global.file_reading_task_source();
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ impl FormData {
|
|||
|
||||
let bytes = blob.get_bytes().unwrap_or(vec![]);
|
||||
|
||||
File::new(&self.global_scope(), BlobImpl::new_from_bytes(bytes), name, None, "")
|
||||
File::new(&self.global(), BlobImpl::new_from_bytes(bytes), name, None, "")
|
||||
}
|
||||
|
||||
pub fn datums(&self) -> Vec<FormDatum> {
|
||||
|
|
|
@ -65,7 +65,7 @@ impl HTMLFormControlsCollectionMethods for HTMLFormControlsCollection {
|
|||
// Step 4-5
|
||||
let once = iter::once(Root::upcast::<Node>(elem));
|
||||
let list = once.chain(peekable.map(Root::upcast));
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let window = global.as_window();
|
||||
Some(RadioNodeListOrElement::RadioNodeList(RadioNodeList::new_simple_list(window, list)))
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ impl HTMLLinkElement {
|
|||
credentials_mode: CredentialsMode::Include,
|
||||
use_url_credentials: true,
|
||||
origin: document.url().clone(),
|
||||
pipeline_id: Some(self.global_scope().pipeline_id()),
|
||||
pipeline_id: Some(self.global().pipeline_id()),
|
||||
referrer_url: Some(document.url().clone()),
|
||||
referrer_policy: referrer_policy,
|
||||
.. RequestInit::default()
|
||||
|
|
|
@ -242,7 +242,7 @@ fn fetch_a_classic_script(script: &HTMLScriptElement,
|
|||
_ => CredentialsMode::Include,
|
||||
},
|
||||
origin: doc.url().clone(),
|
||||
pipeline_id: Some(script.global_scope().pipeline_id()),
|
||||
pipeline_id: Some(script.global().pipeline_id()),
|
||||
referrer_url: Some(doc.url().clone()),
|
||||
referrer_policy: doc.get_referrer_policy(),
|
||||
.. RequestInit::default()
|
||||
|
|
|
@ -79,7 +79,7 @@ impl NavigatorMethods for Navigator {
|
|||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-navigator-bluetooth
|
||||
fn Bluetooth(&self) -> Root<Bluetooth> {
|
||||
self.bluetooth.or_init(|| Bluetooth::new(&self.global_scope()))
|
||||
self.bluetooth.or_init(|| Bluetooth::new(&self.global()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#navigatorlanguage
|
||||
|
@ -89,12 +89,12 @@ impl NavigatorMethods for Navigator {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
|
||||
fn Plugins(&self) -> Root<PluginArray> {
|
||||
self.plugins.or_init(|| PluginArray::new(&self.global_scope()))
|
||||
self.plugins.or_init(|| PluginArray::new(&self.global()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-mimetypes
|
||||
fn MimeTypes(&self) -> Root<MimeTypeArray> {
|
||||
self.mime_types.or_init(|| MimeTypeArray::new(&self.global_scope()))
|
||||
self.mime_types.or_init(|| MimeTypeArray::new(&self.global()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-javaenabled
|
||||
|
@ -105,7 +105,7 @@ impl NavigatorMethods for Navigator {
|
|||
// https://w3c.github.io/ServiceWorker/#navigator-service-worker-attribute
|
||||
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
|
||||
self.service_worker.or_init(|| {
|
||||
ServiceWorkerContainer::new(&self.global_scope())
|
||||
ServiceWorkerContainer::new(&self.global())
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ impl PromiseHelper for Rc<Promise> {
|
|||
impl Drop for Promise {
|
||||
#[allow(unsafe_code)]
|
||||
fn drop(&mut self) {
|
||||
let cx = self.global_scope().get_cx();
|
||||
let cx = self.global().get_cx();
|
||||
unsafe {
|
||||
RemoveRawValueRoot(cx, self.permanent_js_root.get_unsafe());
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ impl Promise {
|
|||
|
||||
#[allow(unsafe_code, unrooted_must_root)]
|
||||
pub fn duplicate(&self) -> Rc<Promise> {
|
||||
let cx = self.global_scope().get_cx();
|
||||
let cx = self.global().get_cx();
|
||||
unsafe {
|
||||
Promise::new_with_js_promise(self.reflector().get_jsobject(), cx)
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ impl Promise {
|
|||
pub fn reject_error(&self, cx: *mut JSContext, error: Error) {
|
||||
rooted!(in(cx) let mut v = UndefinedValue());
|
||||
unsafe {
|
||||
error.to_jsval(cx, &self.global_scope(), v.handle_mut());
|
||||
error.to_jsval(cx, &self.global(), v.handle_mut());
|
||||
}
|
||||
self.reject(cx, v.handle());
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ impl Promise {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn append_native_handler(&self, handler: &PromiseNativeHandler) {
|
||||
let cx = self.global_scope().get_cx();
|
||||
let cx = self.global().get_cx();
|
||||
rooted!(in(cx) let resolve_func =
|
||||
create_native_handler_function(cx,
|
||||
handler.reflector().get_jsobject(),
|
||||
|
|
|
@ -305,7 +305,7 @@ impl Request {
|
|||
let r = Request::from_net_request(global,
|
||||
false,
|
||||
request);
|
||||
r.headers.or_init(|| Headers::for_request(&r.global_scope()));
|
||||
r.headers.or_init(|| Headers::for_request(&r.global()));
|
||||
|
||||
// Step 27
|
||||
let mut headers_copy = r.Headers();
|
||||
|
@ -429,7 +429,7 @@ impl Request {
|
|||
let body_used = r.body_used.get();
|
||||
let mime_type = r.mime_type.borrow().clone();
|
||||
let headers_guard = r.Headers().get_guard();
|
||||
let r_clone = Request::new(&r.global_scope(), url, is_service_worker_global_scope);
|
||||
let r_clone = Request::new(&r.global(), url, is_service_worker_global_scope);
|
||||
r_clone.request.borrow_mut().pipeline_id.set(req.pipeline_id.get());
|
||||
{
|
||||
let mut borrowed_r_request = r_clone.request.borrow_mut();
|
||||
|
@ -549,7 +549,7 @@ impl RequestMethods for Request {
|
|||
|
||||
// https://fetch.spec.whatwg.org/#dom-request-headers
|
||||
fn Headers(&self) -> Root<Headers> {
|
||||
self.headers.or_init(|| Headers::new(&self.global_scope()))
|
||||
self.headers.or_init(|| Headers::new(&self.global()))
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#dom-request-type
|
||||
|
|
|
@ -292,7 +292,7 @@ impl ResponseMethods for Response {
|
|||
|
||||
// https://fetch.spec.whatwg.org/#dom-response-headers
|
||||
fn Headers(&self) -> Root<Headers> {
|
||||
self.headers_reflector.or_init(|| Headers::for_response(&self.global_scope()))
|
||||
self.headers_reflector.or_init(|| Headers::for_response(&self.global()))
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#dom-response-clone
|
||||
|
@ -301,7 +301,7 @@ impl ResponseMethods for Response {
|
|||
// TODO: This step relies on body and stream, which are still unimplemented.
|
||||
|
||||
// Step 2
|
||||
let new_response = Response::new(&self.global_scope());
|
||||
let new_response = Response::new(&self.global());
|
||||
new_response.Headers().set_guard(self.Headers().get_guard());
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-response-clone
|
||||
|
|
|
@ -90,7 +90,7 @@ impl ServiceWorkerMethods for ServiceWorker {
|
|||
let data = try!(StructuredCloneData::write(cx, message));
|
||||
let msg_vec = DOMMessage(data.move_to_arraybuffer());
|
||||
let _ =
|
||||
self.global_scope()
|
||||
self.global()
|
||||
.constellation_chan()
|
||||
.send(ScriptMsg::ForwardDOMMessage(msg_vec, self.scope_url.clone()));
|
||||
Ok(())
|
||||
|
|
|
@ -58,7 +58,7 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
|
|||
script_url: USVString,
|
||||
options: &RegistrationOptions) -> Fallible<Root<ServiceWorkerRegistration>> {
|
||||
let USVString(ref script_url) = script_url;
|
||||
let api_base_url = self.global_scope().api_base_url();
|
||||
let api_base_url = self.global().api_base_url();
|
||||
// Step 3-4
|
||||
let script_url = match api_base_url.join(script_url) {
|
||||
Ok(url) => url,
|
||||
|
@ -96,7 +96,7 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
|
|||
return Err(Error::Type("Scope URL contains forbidden characters".to_owned()));
|
||||
}
|
||||
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let worker_registration = ServiceWorkerRegistration::new(&global,
|
||||
script_url,
|
||||
scope.clone(),
|
||||
|
|
|
@ -40,11 +40,11 @@ impl Storage {
|
|||
}
|
||||
|
||||
fn get_url(&self) -> Url {
|
||||
self.global_scope().get_url()
|
||||
self.global().get_url()
|
||||
}
|
||||
|
||||
fn get_storage_thread(&self) -> IpcSender<StorageThreadMsg> {
|
||||
self.global_scope().resource_threads().sender()
|
||||
self.global().resource_threads().sender()
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ impl Storage {
|
|||
/// https://html.spec.whatwg.org/multipage/#send-a-storage-notification
|
||||
fn broadcast_change_notification(&self, key: Option<String>, old_value: Option<String>,
|
||||
new_value: Option<String>) {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let window = global.as_window();
|
||||
let task_source = window.dom_manipulation_task_source();
|
||||
let trusted_storage = Trusted::new(self);
|
||||
|
@ -182,7 +182,7 @@ impl Runnable for StorageEventRunnable {
|
|||
let this = *self;
|
||||
let storage_root = this.element.root();
|
||||
let storage = storage_root.r();
|
||||
let global = storage.global_scope();
|
||||
let global = storage.global();
|
||||
let ev_url = storage.get_url();
|
||||
|
||||
let storage_event = StorageEvent::new(
|
||||
|
|
|
@ -113,7 +113,7 @@ impl TestBindingMethods for TestBinding {
|
|||
fn EnumAttribute(&self) -> TestEnum { TestEnum::_empty }
|
||||
fn SetEnumAttribute(&self, _: TestEnum) {}
|
||||
fn InterfaceAttribute(&self) -> Root<Blob> {
|
||||
Blob::new(&self.global_scope(), BlobImpl::new_from_bytes(vec![]), "".to_owned())
|
||||
Blob::new(&self.global(), BlobImpl::new_from_bytes(vec![]), "".to_owned())
|
||||
}
|
||||
fn SetInterfaceAttribute(&self, _: &Blob) {}
|
||||
fn UnionAttribute(&self) -> HTMLElementOrLong { HTMLElementOrLong::Long(0) }
|
||||
|
@ -209,7 +209,7 @@ impl TestBindingMethods for TestBinding {
|
|||
fn SetAttr_to_automatically_rename(&self, _: DOMString) {}
|
||||
fn GetEnumAttributeNullable(&self) -> Option<TestEnum> { Some(TestEnum::_empty) }
|
||||
fn GetInterfaceAttributeNullable(&self) -> Option<Root<Blob>> {
|
||||
Some(Blob::new(&self.global_scope(), BlobImpl::new_from_bytes(vec![]), "".to_owned()))
|
||||
Some(Blob::new(&self.global(), BlobImpl::new_from_bytes(vec![]), "".to_owned()))
|
||||
}
|
||||
fn SetInterfaceAttributeNullable(&self, _: Option<&Blob>) {}
|
||||
fn GetInterfaceAttributeWeak(&self) -> Option<Root<URL>> {
|
||||
|
@ -264,7 +264,7 @@ impl TestBindingMethods for TestBinding {
|
|||
fn ReceiveByteString(&self) -> ByteString { ByteString::new(vec!()) }
|
||||
fn ReceiveEnum(&self) -> TestEnum { TestEnum::_empty }
|
||||
fn ReceiveInterface(&self) -> Root<Blob> {
|
||||
Blob::new(&self.global_scope(), BlobImpl::new_from_bytes(vec![]), "".to_owned())
|
||||
Blob::new(&self.global(), BlobImpl::new_from_bytes(vec![]), "".to_owned())
|
||||
}
|
||||
fn ReceiveAny(&self, _: *mut JSContext) -> JSVal { NullValue() }
|
||||
fn ReceiveObject(&self, cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
|
@ -287,7 +287,7 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
fn ReceiveSequence(&self) -> Vec<i32> { vec![1] }
|
||||
fn ReceiveInterfaceSequence(&self) -> Vec<Root<Blob>> {
|
||||
vec![Blob::new(&self.global_scope(), BlobImpl::new_from_bytes(vec![]), "".to_owned())]
|
||||
vec![Blob::new(&self.global(), BlobImpl::new_from_bytes(vec![]), "".to_owned())]
|
||||
}
|
||||
|
||||
fn ReceiveNullableBoolean(&self) -> Option<bool> { Some(false) }
|
||||
|
@ -308,7 +308,7 @@ impl TestBindingMethods for TestBinding {
|
|||
fn ReceiveNullableByteString(&self) -> Option<ByteString> { Some(ByteString::new(vec!())) }
|
||||
fn ReceiveNullableEnum(&self) -> Option<TestEnum> { Some(TestEnum::_empty) }
|
||||
fn ReceiveNullableInterface(&self) -> Option<Root<Blob>> {
|
||||
Some(Blob::new(&self.global_scope(), BlobImpl::new_from_bytes(vec![]), "".to_owned()))
|
||||
Some(Blob::new(&self.global(), BlobImpl::new_from_bytes(vec![]), "".to_owned()))
|
||||
}
|
||||
fn ReceiveNullableObject(&self, cx: *mut JSContext) -> Option<NonZero<*mut JSObject>> {
|
||||
self.GetObjectAttributeNullable(cx)
|
||||
|
@ -655,12 +655,12 @@ impl TestBindingMethods for TestBinding {
|
|||
|
||||
#[allow(unrooted_must_root)]
|
||||
fn ReturnResolvedPromise(&self, cx: *mut JSContext, v: HandleValue) -> Fallible<Rc<Promise>> {
|
||||
Promise::Resolve(&self.global_scope(), cx, v)
|
||||
Promise::Resolve(&self.global(), cx, v)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
fn ReturnRejectedPromise(&self, cx: *mut JSContext, v: HandleValue) -> Fallible<Rc<Promise>> {
|
||||
Promise::Reject(&self.global_scope(), cx, v)
|
||||
Promise::Reject(&self.global(), cx, v)
|
||||
}
|
||||
|
||||
fn PromiseResolveNative(&self, cx: *mut JSContext, p: &Promise, v: HandleValue) {
|
||||
|
@ -672,7 +672,7 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
|
||||
fn PromiseRejectWithTypeError(&self, p: &Promise, s: USVString) {
|
||||
p.reject_error(self.global_scope().get_cx(), Error::Type(s.0));
|
||||
p.reject_error(self.global().get_cx(), Error::Type(s.0));
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
@ -682,7 +682,7 @@ impl TestBindingMethods for TestBinding {
|
|||
promise: TrustedPromise::new(promise),
|
||||
value: value,
|
||||
};
|
||||
let _ = self.global_scope()
|
||||
let _ = self.global()
|
||||
.schedule_callback(
|
||||
OneshotTimerCallback::TestBindingCallback(cb),
|
||||
MsDuration::new(delay));
|
||||
|
@ -692,7 +692,7 @@ impl TestBindingMethods for TestBinding {
|
|||
fn PromiseNativeHandler(&self,
|
||||
resolve: Option<Rc<SimpleCallback>>,
|
||||
reject: Option<Rc<SimpleCallback>>) -> Rc<Promise> {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let handler = PromiseNativeHandler::new(&global,
|
||||
resolve.map(SimpleHandler::new),
|
||||
reject.map(SimpleHandler::new));
|
||||
|
@ -721,7 +721,7 @@ impl TestBindingMethods for TestBinding {
|
|||
|
||||
#[allow(unrooted_must_root)]
|
||||
fn PromiseAttribute(&self) -> Rc<Promise> {
|
||||
Promise::new(&self.global_scope())
|
||||
Promise::new(&self.global())
|
||||
}
|
||||
|
||||
fn AcceptPromise(&self, _promise: &Promise) {
|
||||
|
@ -751,7 +751,7 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
|
||||
fn AdvanceClock(&self, ms: i32, tick: bool) {
|
||||
self.global_scope().as_window().advance_animation_clock(ms, tick);
|
||||
self.global().as_window().advance_animation_clock(ms, tick);
|
||||
}
|
||||
|
||||
fn Panic(&self) { panic!("explicit panic from script") }
|
||||
|
@ -788,7 +788,7 @@ impl TestBindingCallback {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn invoke(self) {
|
||||
let p = self.promise.root();
|
||||
let cx = p.global_scope().get_cx();
|
||||
let cx = p.global().get_cx();
|
||||
let _ac = JSAutoCompartment::new(cx, p.reflector().get_jsobject().get());
|
||||
p.resolve_native(cx, &self.value);
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ impl URLMethods for URL {
|
|||
// https://url.spec.whatwg.org/#dom-url-searchparams
|
||||
fn SearchParams(&self) -> Root<URLSearchParams> {
|
||||
self.search_params.or_init(|| {
|
||||
URLSearchParams::new(&self.global_scope(), Some(self))
|
||||
URLSearchParams::new(&self.global(), Some(self))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ impl WebGLProgram {
|
|||
.unwrap();
|
||||
|
||||
receiver.recv().unwrap().map(|(size, ty, name)|
|
||||
WebGLActiveInfo::new(&self.global_scope(), size, ty, DOMString::from(name)))
|
||||
WebGLActiveInfo::new(&self.global(), size, ty, DOMString::from(name)))
|
||||
}
|
||||
|
||||
/// glGetActiveAttrib
|
||||
|
@ -244,7 +244,7 @@ impl WebGLProgram {
|
|||
.unwrap();
|
||||
|
||||
receiver.recv().unwrap().map(|(size, ty, name)|
|
||||
WebGLActiveInfo::new(&self.global_scope(), size, ty, DOMString::from(name)))
|
||||
WebGLActiveInfo::new(&self.global(), size, ty, DOMString::from(name)))
|
||||
}
|
||||
|
||||
/// glGetAttribLocation
|
||||
|
|
|
@ -1153,27 +1153,27 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
// generated objects, either here or in the webgl thread
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||
fn CreateBuffer(&self) -> Option<Root<WebGLBuffer>> {
|
||||
WebGLBuffer::maybe_new(&self.global_scope(), self.ipc_renderer.clone())
|
||||
WebGLBuffer::maybe_new(&self.global(), self.ipc_renderer.clone())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6
|
||||
fn CreateFramebuffer(&self) -> Option<Root<WebGLFramebuffer>> {
|
||||
WebGLFramebuffer::maybe_new(&self.global_scope(), self.ipc_renderer.clone())
|
||||
WebGLFramebuffer::maybe_new(&self.global(), self.ipc_renderer.clone())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7
|
||||
fn CreateRenderbuffer(&self) -> Option<Root<WebGLRenderbuffer>> {
|
||||
WebGLRenderbuffer::maybe_new(&self.global_scope(), self.ipc_renderer.clone())
|
||||
WebGLRenderbuffer::maybe_new(&self.global(), self.ipc_renderer.clone())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
||||
fn CreateTexture(&self) -> Option<Root<WebGLTexture>> {
|
||||
WebGLTexture::maybe_new(&self.global_scope(), self.ipc_renderer.clone())
|
||||
WebGLTexture::maybe_new(&self.global(), self.ipc_renderer.clone())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn CreateProgram(&self) -> Option<Root<WebGLProgram>> {
|
||||
WebGLProgram::maybe_new(&self.global_scope(), self.ipc_renderer.clone())
|
||||
WebGLProgram::maybe_new(&self.global(), self.ipc_renderer.clone())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
|
@ -1185,7 +1185,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
return None;
|
||||
}
|
||||
}
|
||||
WebGLShader::maybe_new(&self.global_scope(), self.ipc_renderer.clone(), shader_type)
|
||||
WebGLShader::maybe_new(&self.global(), self.ipc_renderer.clone(), shader_type)
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||
|
@ -1479,7 +1479,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
name: DOMString) -> Option<Root<WebGLUniformLocation>> {
|
||||
program.and_then(|p| {
|
||||
handle_potential_webgl_error!(self, p.get_uniform_location(name), None)
|
||||
.map(|location| WebGLUniformLocation::new(&self.global_scope(), location, p.id()))
|
||||
.map(|location| WebGLUniformLocation::new(&self.global(), location, p.id()))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ impl WebSocket {
|
|||
address: address,
|
||||
};
|
||||
|
||||
self.global_scope()
|
||||
self.global()
|
||||
.script_chan()
|
||||
.send(CommonScriptMsg::RunnableMsg(WebSocketEvent, task))
|
||||
.unwrap();
|
||||
|
@ -436,7 +436,7 @@ impl WebSocketMethods for WebSocket {
|
|||
self.ready_state.set(WebSocketRequestState::Closing);
|
||||
|
||||
let address = Trusted::new(self);
|
||||
let sender = self.global_scope().networking_task_source();
|
||||
let sender = self.global().networking_task_source();
|
||||
fail_the_websocket_connection(address, sender);
|
||||
}
|
||||
WebSocketRequestState::Open => {
|
||||
|
@ -470,7 +470,7 @@ impl Runnable for ConnectionEstablishedTask {
|
|||
|
||||
// Step 1: Protocols.
|
||||
if !self.protocols.is_empty() && self.headers.get::<WebSocketProtocol>().is_none() {
|
||||
let sender = ws.global_scope().networking_task_source();
|
||||
let sender = ws.global().networking_task_source();
|
||||
fail_the_websocket_connection(self.address, sender);
|
||||
return;
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ impl Runnable for ConnectionEstablishedTask {
|
|||
if let Some(cookies) = self.headers.get_raw("set-cookie") {
|
||||
for cookie in cookies.iter() {
|
||||
if let Ok(cookie_value) = String::from_utf8(cookie.clone()) {
|
||||
let _ = ws.global_scope().core_resource_thread().send(
|
||||
let _ = ws.global().core_resource_thread().send(
|
||||
SetCookiesForUrl(ws.url.clone(), cookie_value, HTTP));
|
||||
}
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ impl Runnable for CloseTask {
|
|||
let clean_close = !self.failed;
|
||||
let code = self.code.unwrap_or(close_code::NO_STATUS);
|
||||
let reason = DOMString::from(self.reason.unwrap_or("".to_owned()));
|
||||
let close_event = CloseEvent::new(&ws.global_scope(),
|
||||
let close_event = CloseEvent::new(&ws.global(),
|
||||
atom!("close"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
|
@ -586,7 +586,7 @@ impl Runnable for MessageReceivedTask {
|
|||
}
|
||||
|
||||
// Step 2-5.
|
||||
let global = ws.global_scope();
|
||||
let global = ws.global();
|
||||
// global.get_cx() returns a valid `JSContext` pointer, so this is safe.
|
||||
unsafe {
|
||||
let cx = global.get_cx();
|
||||
|
|
|
@ -128,7 +128,7 @@ impl Worker {
|
|||
return;
|
||||
}
|
||||
|
||||
let global = worker.global_scope();
|
||||
let global = worker.global();
|
||||
let target = worker.upcast();
|
||||
let _ac = JSAutoCompartment::new(global.get_cx(), target.reflector().get_jsobject().get());
|
||||
rooted!(in(global.get_cx()) let mut message = UndefinedValue());
|
||||
|
@ -143,7 +143,7 @@ impl Worker {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
fn dispatch_error(&self, error_info: ErrorInfo) {
|
||||
let global = self.global_scope();
|
||||
let global = self.global();
|
||||
let event = ErrorEvent::new(&global,
|
||||
atom!("error"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
|
|
|
@ -210,7 +210,7 @@ impl XMLHttpRequest {
|
|||
}
|
||||
|
||||
fn sync_in_window(&self) -> bool {
|
||||
self.sync.get() && self.global_scope().is::<Window>()
|
||||
self.sync.get() && self.global().is::<Window>()
|
||||
}
|
||||
|
||||
fn initiate_async_xhr(context: Arc<Mutex<XHRContext>>,
|
||||
|
@ -282,7 +282,7 @@ impl LoadOrigin for XMLHttpRequest {
|
|||
}
|
||||
|
||||
fn pipeline_id(&self) -> Option<PipelineId> {
|
||||
Some(self.global_scope().pipeline_id())
|
||||
Some(self.global().pipeline_id())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
fn Open_(&self, method: ByteString, url: USVString, async: bool,
|
||||
username: Option<USVString>, password: Option<USVString>) -> ErrorResult {
|
||||
// Step 1
|
||||
if let Some(window) = Root::downcast::<Window>(self.global_scope()) {
|
||||
if let Some(window) = Root::downcast::<Window>(self.global()) {
|
||||
if !window.Document().r().is_fully_active() {
|
||||
return Err(Error::InvalidState);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
}
|
||||
|
||||
// Step 2
|
||||
let base = self.global_scope().api_base_url();
|
||||
let base = self.global().api_base_url();
|
||||
// Step 6
|
||||
let mut parsed_url = match base.join(&url.0) {
|
||||
Ok(parsed) => parsed,
|
||||
|
@ -571,7 +571,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
// preference is enabled, we allow bypassing the CORS check.
|
||||
// This is a temporary measure until we figure out Servo privilege
|
||||
// story. See https://github.com/servo/servo/issues/9582
|
||||
if let Some(win) = Root::downcast::<Window>(self.global_scope()) {
|
||||
if let Some(win) = Root::downcast::<Window>(self.global()) {
|
||||
let is_root_pipeline = win.parent_info().is_none();
|
||||
is_root_pipeline && PREFS.is_mozbrowser_enabled()
|
||||
} else {
|
||||
|
@ -594,7 +594,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
use_cors_preflight: has_handlers,
|
||||
credentials_mode: credentials_mode,
|
||||
use_url_credentials: use_url_credentials,
|
||||
origin: self.global_scope().get_url(),
|
||||
origin: self.global().get_url(),
|
||||
referrer_url: self.referrer_url.clone(),
|
||||
referrer_policy: self.referrer_policy.clone(),
|
||||
pipeline_id: self.pipeline_id(),
|
||||
|
@ -649,7 +649,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
|
||||
self.fetch_time.set(time::now().to_timespec().sec);
|
||||
|
||||
let rv = self.fetch(request, &self.global_scope());
|
||||
let rv = self.fetch(request, &self.global());
|
||||
// Step 10
|
||||
if self.sync.get() {
|
||||
return rv;
|
||||
|
@ -740,7 +740,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
// https://xhr.spec.whatwg.org/#the-responsetype-attribute
|
||||
fn SetResponseType(&self, response_type: XMLHttpRequestResponseType) -> ErrorResult {
|
||||
// Step 1
|
||||
if self.global_scope().is::<WorkerGlobalScope>() && response_type == XMLHttpRequestResponseType::Document {
|
||||
if self.global().is::<WorkerGlobalScope>() && response_type == XMLHttpRequestResponseType::Document {
|
||||
return Ok(());
|
||||
}
|
||||
match self.ready_state.get() {
|
||||
|
@ -824,7 +824,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
fn GetResponseXML(&self) -> Fallible<Option<Root<Document>>> {
|
||||
// TODO(#2823): Until [Exposed] is implemented, this attribute needs to return null
|
||||
// explicitly in the worker scope.
|
||||
if self.global_scope().is::<WorkerGlobalScope>() {
|
||||
if self.global().is::<WorkerGlobalScope>() {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
|
@ -855,7 +855,7 @@ impl XMLHttpRequest {
|
|||
fn change_ready_state(&self, rs: XMLHttpRequestState) {
|
||||
assert!(self.ready_state.get() != rs);
|
||||
self.ready_state.set(rs);
|
||||
let event = Event::new(&self.global_scope(),
|
||||
let event = Event::new(&self.global(),
|
||||
atom!("readystatechange"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::Cancelable);
|
||||
|
@ -971,7 +971,7 @@ impl XMLHttpRequest {
|
|||
self.ready_state.set(XMLHttpRequestState::Loading);
|
||||
}
|
||||
let event = Event::new(
|
||||
&self.global_scope(),
|
||||
&self.global(),
|
||||
atom!("readystatechange"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::Cancelable);
|
||||
|
@ -1043,7 +1043,7 @@ impl XMLHttpRequest {
|
|||
}
|
||||
|
||||
fn dispatch_progress_event(&self, upload: bool, type_: Atom, loaded: u64, total: Option<u64>) {
|
||||
let progressevent = ProgressEvent::new(&self.global_scope(),
|
||||
let progressevent = ProgressEvent::new(&self.global(),
|
||||
type_,
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
|
@ -1078,12 +1078,12 @@ impl XMLHttpRequest {
|
|||
});
|
||||
let duration = Length::new(duration_ms as u64);
|
||||
*self.timeout_cancel.borrow_mut() =
|
||||
Some(self.global_scope().schedule_callback(callback, duration));
|
||||
Some(self.global().schedule_callback(callback, duration));
|
||||
}
|
||||
|
||||
fn cancel_timeout(&self) {
|
||||
if let Some(handle) = self.timeout_cancel.borrow_mut().take() {
|
||||
self.global_scope().unschedule_callback(handle);
|
||||
self.global().unschedule_callback(handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1110,7 +1110,7 @@ impl XMLHttpRequest {
|
|||
|
||||
// Step 3, 4
|
||||
let bytes = self.response.borrow().to_vec();
|
||||
let blob = Blob::new(&self.global_scope(), BlobImpl::new_from_bytes(bytes), mime);
|
||||
let blob = Blob::new(&self.global(), BlobImpl::new_from_bytes(bytes), mime);
|
||||
self.response_blob.set(Some(blob.r()));
|
||||
blob
|
||||
}
|
||||
|
@ -1195,7 +1195,7 @@ impl XMLHttpRequest {
|
|||
|
||||
fn document_text_html(&self) -> Root<Document>{
|
||||
let charset = self.final_charset().unwrap_or(UTF_8);
|
||||
let wr = self.global_scope();
|
||||
let wr = self.global();
|
||||
let decoded = charset.decode(&self.response.borrow(), DecoderTrap::Replace).unwrap();
|
||||
let document = self.new_doc(IsHTMLDocument::HTMLDocument);
|
||||
// TODO: Disable scripting while parsing
|
||||
|
@ -1208,7 +1208,7 @@ impl XMLHttpRequest {
|
|||
|
||||
fn handle_xml(&self) -> Root<Document> {
|
||||
let charset = self.final_charset().unwrap_or(UTF_8);
|
||||
let wr = self.global_scope();
|
||||
let wr = self.global();
|
||||
let decoded = charset.decode(&self.response.borrow(), DecoderTrap::Replace).unwrap();
|
||||
let document = self.new_doc(IsHTMLDocument::NonHTMLDocument);
|
||||
// TODO: Disable scripting while parsing
|
||||
|
@ -1220,7 +1220,7 @@ impl XMLHttpRequest {
|
|||
}
|
||||
|
||||
fn new_doc(&self, is_html_document: IsHTMLDocument) -> Root<Document> {
|
||||
let wr = self.global_scope();
|
||||
let wr = self.global();
|
||||
let win = wr.as_window();
|
||||
let doc = win.Document();
|
||||
let doc = doc.r();
|
||||
|
|
|
@ -76,7 +76,7 @@ pub fn Fetch(global: &GlobalScope, input: RequestOrUSVString, init: &RequestInit
|
|||
// Step 2
|
||||
let request = match Request::Constructor(global, input, init) {
|
||||
Err(e) => {
|
||||
promise.reject_error(promise.global_scope().get_cx(), e);
|
||||
promise.reject_error(promise.global().get_cx(), e);
|
||||
return promise;
|
||||
},
|
||||
Ok(r) => r.get_request(),
|
||||
|
@ -124,13 +124,13 @@ impl FetchResponseListener for FetchContext {
|
|||
|
||||
// JSAutoCompartment needs to be manually made.
|
||||
// Otherwise, Servo will crash.
|
||||
let promise_cx = promise.global_scope().get_cx();
|
||||
let promise_cx = promise.global().get_cx();
|
||||
let _ac = JSAutoCompartment::new(promise_cx, promise.reflector().get_jsobject().get());
|
||||
match fetch_metadata {
|
||||
// Step 4.1
|
||||
Err(_) => {
|
||||
promise.reject_error(
|
||||
promise.global_scope().get_cx(),
|
||||
promise.global().get_cx(),
|
||||
Error::Type("Network error occurred".to_string()));
|
||||
self.fetch_promise = Some(TrustedPromise::new(promise));
|
||||
return;
|
||||
|
|
|
@ -489,7 +489,7 @@ impl JsTimerTask {
|
|||
// step 4.2
|
||||
match *&self.callback {
|
||||
InternalTimerCallback::StringTimerCallback(ref code_str) => {
|
||||
let global = this.global_scope();
|
||||
let global = this.global();
|
||||
let cx = global.get_cx();
|
||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||
|
||||
|
@ -514,7 +514,7 @@ impl JsTimerTask {
|
|||
// reschedule repeating timers when they were not canceled as part of step 4.2.
|
||||
if self.is_interval == IsInterval::Interval &&
|
||||
timers.active_timers.borrow().contains_key(&self.handle) {
|
||||
timers.initialize_and_schedule(&this.global_scope(), self);
|
||||
timers.initialize_and_schedule(&this.global(), self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue