Skip to content

Commit

Permalink
Rename |wrapper| to |reflector_| in Reflectable implementations for D…
Browse files Browse the repository at this point in the history
…OM objects.
  • Loading branch information
bholley committed Oct 9, 2013
1 parent 92e91c5 commit 5ed8b9e
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/components/script/dom/bindings/domparser.rs
Expand Up @@ -14,7 +14,7 @@ use std::cast;

impl Reflectable for DOMParser {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down
4 changes: 2 additions & 2 deletions src/components/script/dom/bindings/node.rs
Expand Up @@ -99,7 +99,7 @@ impl Reflectable for AbstractNode<ScriptView> {
fn reflector(&mut self) -> &mut Reflector {
do self.with_mut_base |base| {
unsafe {
cast::transmute(&base.wrapper)
cast::transmute(&base.reflector_)
}
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@ impl Traceable for Node<ScriptView> {
}
}
}
debug!("tracing %p?:", self.wrapper.get_jsobject());
debug!("tracing %p?:", self.reflector_.get_jsobject());
trace_node(tracer, self.parent_node, "parent");
trace_node(tracer, self.first_child, "first child");
trace_node(tracer, self.last_child, "last child");
Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/blob.rs
Expand Up @@ -11,20 +11,20 @@ use js::jsapi::{JSContext, JSObject};
use std::cast;

pub struct Blob {
wrapper: Reflector
reflector_: Reflector
}

impl Blob {
pub fn new() -> @mut Blob {
@mut Blob {
wrapper: Reflector::new()
reflector_: Reflector::new()
}
}
}

impl Reflectable for Blob {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/clientrect.rs
Expand Up @@ -12,7 +12,7 @@ use js::glue::RUST_OBJECT_TO_JSVAL;
use std::cast;

pub struct ClientRect {
wrapper: Reflector,
reflector_: Reflector,
top: f32,
bottom: f32,
left: f32,
Expand All @@ -26,7 +26,7 @@ impl ClientRect {
bottom: bottom,
left: left,
right: right,
wrapper: Reflector::new()
reflector_: Reflector::new()
};
rect.init_wrapper(cx, scope);
rect
Expand Down Expand Up @@ -64,7 +64,7 @@ impl ClientRect {
impl Reflectable for ClientRect {
fn reflector(&mut self) -> &mut Reflector {
unsafe {
cast::transmute(&self.wrapper)
cast::transmute(&self.reflector_)
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/clientrectlist.rs
Expand Up @@ -12,14 +12,14 @@ use js::jsapi::{JSObject, JSContext};
use std::cast;

pub struct ClientRectList {
wrapper: Reflector,
reflector_: Reflector,
rects: ~[@mut ClientRect]
}

impl ClientRectList {
pub fn new(rects: ~[@mut ClientRect], cx: *JSContext, scope: *JSObject) -> @mut ClientRectList {
let list = @mut ClientRectList {
wrapper: Reflector::new(),
reflector_: Reflector::new(),
rects: rects
};
list.init_wrapper(cx, scope);
Expand Down Expand Up @@ -51,7 +51,7 @@ impl ClientRectList {
impl Reflectable for ClientRectList {
fn reflector(&mut self) -> &mut Reflector {
unsafe {
cast::transmute(&self.wrapper)
cast::transmute(&self.reflector_)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/script/dom/document.rs
Expand Up @@ -92,7 +92,7 @@ pub enum DocumentType {

pub struct Document {
root: Option<AbstractNode<ScriptView>>,
wrapper: Reflector,
reflector_: Reflector,
window: Option<@mut Window>,
doctype: DocumentType,
title: ~str
Expand All @@ -103,7 +103,7 @@ impl Document {
pub fn new(window: Option<@mut Window>, doctype: DocumentType) -> Document {
Document {
root: None,
wrapper: Reflector::new(),
reflector_: Reflector::new(),
window: window,
doctype: doctype,
title: ~""
Expand Down Expand Up @@ -175,7 +175,7 @@ impl DerivedWrapper for AbstractDocument {
impl Reflectable for Document {
fn reflector(&mut self) -> &mut Reflector {
unsafe {
cast::transmute(&self.wrapper)
cast::transmute(&self.reflector_)
}
}

Expand Down Expand Up @@ -502,7 +502,7 @@ impl Traceable for Document {
debug!("tracing root node");
do root.with_base |node| {
JS_CallTracer(tracer as *JSTracer,
node.wrapper.object,
node.reflector_.object,
JSTRACE_OBJECT as u32);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/script/dom/domparser.rs
Expand Up @@ -15,14 +15,14 @@ use dom::window::Window;

pub struct DOMParser {
owner: @mut Window, //XXXjdm Document instead?
wrapper: Reflector
reflector_: Reflector
}

impl DOMParser {
pub fn new(owner: @mut Window) -> @mut DOMParser {
let parser = @mut DOMParser {
owner: owner,
wrapper: Reflector::new()
reflector_: Reflector::new()
};

// TODO(tkuehn): This just handles the top-level page. Need to handle subframes.
Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/event.rs
Expand Up @@ -26,7 +26,7 @@ pub enum Event_ {
}

pub struct Event {
wrapper: Reflector,
reflector_: Reflector,
type_: DOMString,
default_prevented: bool,
cancelable: bool,
Expand All @@ -37,7 +37,7 @@ pub struct Event {
impl Event {
pub fn new(type_: &DOMString) -> Event {
Event {
wrapper: Reflector::new(),
reflector_: Reflector::new(),
type_: (*type_).clone(),
default_prevented: false,
cancelable: true,
Expand Down Expand Up @@ -115,7 +115,7 @@ impl Event {

impl Reflectable for Event {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/eventtarget.rs
Expand Up @@ -12,13 +12,13 @@ use js::jsapi::{JSObject, JSContext, JSVal};
use std::cast;

pub struct EventTarget {
wrapper: Reflector
reflector_: Reflector
}

impl EventTarget {
pub fn new() -> ~EventTarget {
~EventTarget {
wrapper: Reflector::new()
reflector_: Reflector::new()
}
}

Expand All @@ -29,7 +29,7 @@ impl EventTarget {

impl Reflectable for EventTarget {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/formdata.rs
Expand Up @@ -21,14 +21,14 @@ enum FormDatum {

pub struct FormData {
data: HashMap<~str, FormDatum>,
wrapper: Reflector
reflector_: Reflector
}

impl FormData {
pub fn new() -> @mut FormData {
@mut FormData {
data: HashMap::new(),
wrapper: Reflector::new()
reflector_: Reflector::new()
}
}

Expand All @@ -52,7 +52,7 @@ impl FormData {
impl Reflectable for FormData {
fn reflector(&mut self) -> &mut Reflector {
unsafe {
cast::transmute(&self.wrapper)
cast::transmute(&self.reflector_)
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/htmlcollection.rs
Expand Up @@ -15,14 +15,14 @@ use std::ptr;

pub struct HTMLCollection {
elements: ~[AbstractNode<ScriptView>],
wrapper: Reflector
reflector_: Reflector
}

impl HTMLCollection {
pub fn new(elements: ~[AbstractNode<ScriptView>], cx: *JSContext, scope: *JSObject) -> @mut HTMLCollection {
let collection = @mut HTMLCollection {
elements: elements,
wrapper: Reflector::new()
reflector_: Reflector::new()
};
collection.init_wrapper(cx, scope);
collection
Expand Down Expand Up @@ -71,7 +71,7 @@ impl BindingObject for HTMLCollection {
impl Reflectable for HTMLCollection {
fn reflector(&mut self) -> &mut Reflector {
unsafe {
cast::transmute(&self.wrapper)
cast::transmute(&self.reflector_)
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/navigator.rs
Expand Up @@ -12,13 +12,13 @@ use js::jsapi::{JSContext, JSObject};
use std::cast;

pub struct Navigator {
wrapper: Reflector
reflector_: Reflector
}

impl Navigator {
pub fn new() -> @mut Navigator {
@mut Navigator {
wrapper: Reflector::new()
reflector_: Reflector::new()
}
}

Expand Down Expand Up @@ -89,7 +89,7 @@ impl Navigator {

impl Reflectable for Navigator {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down
8 changes: 4 additions & 4 deletions src/components/script/dom/node.rs
Expand Up @@ -62,8 +62,8 @@ pub struct AbstractNodeChildrenIterator<View> {
/// the script task, this is the unit type `()`. For the layout task, this is
/// `LayoutData`.
pub struct Node<View> {
/// The JavaScript wrapper for this node.
wrapper: Reflector,
/// The JavaScript reflector for this node.
reflector_: Reflector,

/// The type of node that this is.
type_id: NodeTypeId,
Expand Down Expand Up @@ -465,7 +465,7 @@ impl Node<ScriptView> {

pub fn new(type_id: NodeTypeId) -> Node<ScriptView> {
Node {
wrapper: Reflector::new(),
reflector_: Reflector::new(),
type_id: type_id,

abstract: None,
Expand Down Expand Up @@ -791,7 +791,7 @@ impl VoidPtrLike for AbstractNode<LayoutView> {

impl Reflectable for Node<ScriptView> {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&mut self.wrapper) }
unsafe { cast::transmute(&mut self.reflector_) }
}

fn wrap_object_shared(@mut self, _cx: *JSContext, _scope: *JSObject) -> *JSObject {
Expand Down
6 changes: 3 additions & 3 deletions src/components/script/dom/validitystate.rs
Expand Up @@ -8,14 +8,14 @@ use js::jsapi::{JSContext, JSObject};
use std::cast;

pub struct ValidityState {
wrapper: Reflector,
reflector_: Reflector,
state: u8
}

impl ValidityState {
pub fn valid() -> ValidityState {
ValidityState {
wrapper: Reflector::new(),
reflector_: Reflector::new(),
state: 0
}
}
Expand Down Expand Up @@ -61,7 +61,7 @@ impl ValidityState {

impl Reflectable for ValidityState {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down
8 changes: 4 additions & 4 deletions src/components/script/dom/window.rs
Expand Up @@ -43,7 +43,7 @@ pub struct Window {
page: @mut Page,
script_chan: ScriptChan,
compositor: @ScriptListener,
wrapper: Reflector,
reflector_: Reflector,
timer_chan: SharedChan<TimerControlMsg>,
navigator: Option<@mut Navigator>,
image_cache_task: ImageCacheTask,
Expand Down Expand Up @@ -137,7 +137,7 @@ impl Window {

impl Reflectable for Window {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(&self.wrapper) }
unsafe { cast::transmute(&self.reflector_) }
}

fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
Expand Down Expand Up @@ -203,7 +203,7 @@ impl Window {
page: page,
script_chan: script_chan.clone(),
compositor: compositor,
wrapper: Reflector::new(),
reflector_: Reflector::new(),
timer_chan: {
let (timer_port, timer_chan) = comm::stream::<TimerControlMsg>();
let id = page.id.clone();
Expand Down Expand Up @@ -254,7 +254,7 @@ impl Traceable for Window {
(*tracer).debugPrintArg = name as *libc::c_void;
debug!("tracing document");
JS_CallTracer(tracer as *JSTracer,
doc.wrapper.object,
doc.reflector_.object,
JSTRACE_OBJECT as u32);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/script/dom/windowproxy.rs
Expand Up @@ -8,13 +8,13 @@ use script_task::page_from_context;
use js::jsapi::{JSContext, JSObject};

pub struct WindowProxy {
wrapper: Reflector
reflector_: Reflector
}

impl WindowProxy {
pub fn new() -> @mut WindowProxy {
@mut WindowProxy {
wrapper: Reflector::new()
reflector_: Reflector::new()
}
}

Expand Down

5 comments on commit 5ed8b9e

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at bholley@5ed8b9e

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging bholley/servo/reflector_rename = 5ed8b9e into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bholley/servo/reflector_rename = 5ed8b9e merged ok, testing candidate = 89dd9dd

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 89dd9dd

Please sign in to comment.