mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Extract mutability out of Reflectable trait.
This commit is contained in:
parent
bba3eefde8
commit
8653450b6e
5 changed files with 24 additions and 6 deletions
|
@ -73,11 +73,15 @@ impl Reflector {
|
|||
pub trait Reflectable {
|
||||
/// Returns the receiver's reflector.
|
||||
fn reflector(&self) -> &Reflector;
|
||||
/// Initializes the Reflector
|
||||
fn init_reflector(&mut self, obj: *mut JSObject);
|
||||
|
||||
/// Returns the global object of the realm that the Reflectable was created in.
|
||||
fn global(&self) -> GlobalRoot where Self: Sized {
|
||||
global_root_from_reflector(self)
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait to initialize the `Reflector` for a DOM object.
|
||||
pub trait MutReflectable: Reflectable {
|
||||
/// Initializes the Reflector
|
||||
fn init_reflector(&mut self, obj: *mut JSObject);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue