auto merge of #2557 : saneyuki/servo/mut, r=jdm

related #2514
This commit is contained in:
bors-servo 2014-06-03 13:31:26 -04:00
commit 5a97f5fd79
2 changed files with 12 additions and 12 deletions

View file

@ -291,7 +291,7 @@ impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> {
} }
pub trait DocumentMethods { pub trait DocumentMethods {
fn Implementation(&mut self) -> Temporary<DOMImplementation>; fn Implementation(&self) -> Temporary<DOMImplementation>;
fn URL(&self) -> DOMString; fn URL(&self) -> DOMString;
fn DocumentURI(&self) -> DOMString; fn DocumentURI(&self) -> DOMString;
fn CompatMode(&self) -> DOMString; fn CompatMode(&self) -> DOMString;
@ -326,7 +326,7 @@ pub trait DocumentMethods {
fn Scripts(&self) -> Temporary<HTMLCollection>; fn Scripts(&self) -> Temporary<HTMLCollection>;
fn Anchors(&self) -> Temporary<HTMLCollection>; fn Anchors(&self) -> Temporary<HTMLCollection>;
fn Applets(&self) -> Temporary<HTMLCollection>; fn Applets(&self) -> Temporary<HTMLCollection>;
fn Location(&mut self) -> Temporary<Location>; fn Location(&self) -> Temporary<Location>;
fn Children(&self) -> Temporary<HTMLCollection>; fn Children(&self) -> Temporary<HTMLCollection>;
fn GetOnload(&self) -> Option<EventHandlerNonNull>; fn GetOnload(&self) -> Option<EventHandlerNonNull>;
fn SetOnload(&mut self, listener: Option<EventHandlerNonNull>); fn SetOnload(&mut self, listener: Option<EventHandlerNonNull>);
@ -334,7 +334,7 @@ pub trait DocumentMethods {
impl<'a> DocumentMethods for JSRef<'a, Document> { impl<'a> DocumentMethods for JSRef<'a, Document> {
// http://dom.spec.whatwg.org/#dom-document-implementation // http://dom.spec.whatwg.org/#dom-document-implementation
fn Implementation(&mut self) -> Temporary<DOMImplementation> { fn Implementation(&self) -> Temporary<DOMImplementation> {
if self.implementation.get().is_none() { if self.implementation.get().is_none() {
let window = self.window.root(); let window = self.window.root();
self.implementation.assign(Some(DOMImplementation::new(&*window))); self.implementation.assign(Some(DOMImplementation::new(&*window)));
@ -800,7 +800,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) HTMLCollection::create(&*window, NodeCast::from_ref(self), filter)
} }
fn Location(&mut self) -> Temporary<Location> { fn Location(&self) -> Temporary<Location> {
let mut window = self.window.root(); let mut window = self.window.root();
window.Location() window.Location()
} }

View file

@ -119,16 +119,16 @@ pub trait WindowMethods {
fn Alert(&self, s: DOMString); fn Alert(&self, s: DOMString);
fn Close(&self); fn Close(&self);
fn Document(&self) -> Temporary<Document>; fn Document(&self) -> Temporary<Document>;
fn Location(&mut self) -> Temporary<Location>; fn Location(&self) -> Temporary<Location>;
fn Console(&mut self) -> Temporary<Console>; fn Console(&self) -> Temporary<Console>;
fn Navigator(&mut self) -> Temporary<Navigator>; fn Navigator(&self) -> Temporary<Navigator>;
fn SetTimeout(&mut self, _cx: *mut JSContext, callback: JSVal, timeout: i32) -> i32; fn SetTimeout(&mut self, _cx: *mut JSContext, callback: JSVal, timeout: i32) -> i32;
fn ClearTimeout(&mut self, handle: i32); fn ClearTimeout(&mut self, handle: i32);
fn SetInterval(&mut self, _cx: *mut JSContext, callback: JSVal, timeout: i32) -> i32; fn SetInterval(&mut self, _cx: *mut JSContext, callback: JSVal, timeout: i32) -> i32;
fn ClearInterval(&mut self, handle: i32); fn ClearInterval(&mut self, handle: i32);
fn Window(&self) -> Temporary<Window>; fn Window(&self) -> Temporary<Window>;
fn Self(&self) -> Temporary<Window>; fn Self(&self) -> Temporary<Window>;
fn Performance(&mut self) -> Temporary<Performance>; fn Performance(&self) -> Temporary<Performance>;
fn GetOnload(&self) -> Option<EventHandlerNonNull>; fn GetOnload(&self) -> Option<EventHandlerNonNull>;
fn SetOnload(&mut self, listener: Option<EventHandlerNonNull>); fn SetOnload(&mut self, listener: Option<EventHandlerNonNull>);
fn GetOnunload(&self) -> Option<EventHandlerNonNull>; fn GetOnunload(&self) -> Option<EventHandlerNonNull>;
@ -155,7 +155,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
Temporary::new(frame.get_ref().document.clone()) Temporary::new(frame.get_ref().document.clone())
} }
fn Location(&mut self) -> Temporary<Location> { fn Location(&self) -> Temporary<Location> {
if self.location.get().is_none() { if self.location.get().is_none() {
let page = self.deref().page.clone(); let page = self.deref().page.clone();
let location = Location::new(self, page); let location = Location::new(self, page);
@ -164,7 +164,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
Temporary::new(self.location.get().get_ref().clone()) Temporary::new(self.location.get().get_ref().clone())
} }
fn Console(&mut self) -> Temporary<Console> { fn Console(&self) -> Temporary<Console> {
if self.console.get().is_none() { if self.console.get().is_none() {
let console = Console::new(self); let console = Console::new(self);
self.console.assign(Some(console)); self.console.assign(Some(console));
@ -172,7 +172,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
Temporary::new(self.console.get().get_ref().clone()) Temporary::new(self.console.get().get_ref().clone())
} }
fn Navigator(&mut self) -> Temporary<Navigator> { fn Navigator(&self) -> Temporary<Navigator> {
if self.navigator.get().is_none() { if self.navigator.get().is_none() {
let navigator = Navigator::new(self); let navigator = Navigator::new(self);
self.navigator.assign(Some(navigator)); self.navigator.assign(Some(navigator));
@ -209,7 +209,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
self.Window() self.Window()
} }
fn Performance(&mut self) -> Temporary<Performance> { fn Performance(&self) -> Temporary<Performance> {
if self.performance.get().is_none() { if self.performance.get().is_none() {
let performance = Performance::new(self); let performance = Performance::new(self);
self.performance.assign(Some(performance)); self.performance.assign(Some(performance));