mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
This commit is contained in:
parent
577370746e
commit
f87c2a8d76
291 changed files with 1774 additions and 1770 deletions
|
@ -8,7 +8,7 @@ use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods;
|
|||
use dom::bindings::error::Fallible;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::reflector::reflect_dom_object;
|
||||
use dom::bindings::root::{MutNullableDom, Root, RootedReference};
|
||||
use dom::bindings::root::{DomRoot, MutNullableDom, RootedReference};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use dom::eventtarget::EventTarget;
|
||||
|
@ -51,7 +51,7 @@ impl MouseEvent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_uninitialized(window: &Window) -> Root<MouseEvent> {
|
||||
pub fn new_uninitialized(window: &Window) -> DomRoot<MouseEvent> {
|
||||
reflect_dom_object(box MouseEvent::new_inherited(),
|
||||
window,
|
||||
MouseEventBinding::Wrap)
|
||||
|
@ -72,7 +72,7 @@ impl MouseEvent {
|
|||
shift_key: bool,
|
||||
meta_key: bool,
|
||||
button: i16,
|
||||
related_target: Option<&EventTarget>) -> Root<MouseEvent> {
|
||||
related_target: Option<&EventTarget>) -> DomRoot<MouseEvent> {
|
||||
let ev = MouseEvent::new_uninitialized(window);
|
||||
ev.InitMouseEvent(type_, bool::from(can_bubble), bool::from(cancelable),
|
||||
view, detail,
|
||||
|
@ -84,7 +84,7 @@ impl MouseEvent {
|
|||
|
||||
pub fn Constructor(window: &Window,
|
||||
type_: DOMString,
|
||||
init: &MouseEventBinding::MouseEventInit) -> Fallible<Root<MouseEvent>> {
|
||||
init: &MouseEventBinding::MouseEventInit) -> Fallible<DomRoot<MouseEvent>> {
|
||||
let bubbles = EventBubbles::from(init.parent.parent.parent.bubbles);
|
||||
let cancelable = EventCancelable::from(init.parent.parent.parent.cancelable);
|
||||
let event = MouseEvent::new(window,
|
||||
|
@ -148,7 +148,7 @@ impl MouseEventMethods for MouseEvent {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-relatedTarget
|
||||
fn GetRelatedTarget(&self) -> Option<Root<EventTarget>> {
|
||||
fn GetRelatedTarget(&self) -> Option<DomRoot<EventTarget>> {
|
||||
self.related_target.get()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue