diff options
Diffstat (limited to 'src/components/script')
-rw-r--r-- | src/components/script/dom/bindings/element.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/bindings/utils.rs | 3 | ||||
-rw-r--r-- | src/components/script/dom/characterdata.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/event.rs | 2 | ||||
-rw-r--r-- | src/components/script/html/cssparse.rs | 4 | ||||
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 4 | ||||
-rw-r--r-- | src/components/script/script_task.rs | 4 |
7 files changed, 12 insertions, 9 deletions
diff --git a/src/components/script/dom/bindings/element.rs b/src/components/script/dom/bindings/element.rs index fa4e28534ec..e9336e3da2a 100644 --- a/src/components/script/dom/bindings/element.rs +++ b/src/components/script/dom/bindings/element.rs @@ -273,7 +273,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) -> JSBool { let node = unwrap(obj); do node.with_imm_element |elem| { - let s = str(copy elem.tag_name); + let s = str(elem.tag_name.clone()); *vp = domstring_to_jsval(cx, &s); } } diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index 728c1eb112e..c30eea5f1db 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -392,6 +392,7 @@ pub struct JSNativeHolder { propertyHooks: *NativePropertyHooks } +#[deriving(Clone)] pub enum ConstantVal { IntVal(i32), UintVal(u32), @@ -401,6 +402,7 @@ pub enum ConstantVal { VoidVal } +#[deriving(Clone)] pub struct ConstantSpec { name: *libc::c_char, value: ConstantVal @@ -853,6 +855,7 @@ impl DerivedWrapper for AbstractNode<ScriptView> { } } +#[deriving(ToStr)] pub enum Error { FailureUnknown } diff --git a/src/components/script/dom/characterdata.rs b/src/components/script/dom/characterdata.rs index d63fd75ec88..2d921fe07c5 100644 --- a/src/components/script/dom/characterdata.rs +++ b/src/components/script/dom/characterdata.rs @@ -23,7 +23,7 @@ impl CharacterData { } pub fn Data(&self) -> DOMString { - copy self.data + self.data.clone() } pub fn SetData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/event.rs b/src/components/script/dom/event.rs index ca97d1bc364..78ccfa7e759 100644 --- a/src/components/script/dom/event.rs +++ b/src/components/script/dom/event.rs @@ -55,7 +55,7 @@ impl Event { } pub fn Type(&self) -> DOMString { - copy self.type_ + self.type_.clone() } pub fn GetTarget(&self) -> Option<@mut EventTarget> { diff --git a/src/components/script/html/cssparse.rs b/src/components/script/html/cssparse.rs index 95a600682ac..0a04daf15ae 100644 --- a/src/components/script/html/cssparse.rs +++ b/src/components/script/html/cssparse.rs @@ -28,8 +28,8 @@ pub fn spawn_css_parser(provenance: StylesheetProvenance, do task::spawn { let url = do provenance_cell.with_ref |p| { match *p { - UrlProvenance(ref the_url) => copy *the_url, - InlineProvenance(ref the_url, _) => copy *the_url + UrlProvenance(ref the_url) => (*the_url).clone(), + InlineProvenance(ref the_url, _) => (*the_url).clone() } }; diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 43a4043bbd8..79403b643c2 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -185,7 +185,7 @@ fn js_script_listener(to_parent: SharedChan<HtmlDiscoveryMessage>, do task::spawn { let (input_port, input_chan) = comm::stream(); // TODO: change copy to move once we can move into closures - resource_task.send(Load(copy url, input_chan)); + resource_task.send(Load(url.clone(), input_chan)); let mut buf = ~[]; loop { @@ -403,7 +403,7 @@ pub fn parse_html(cx: *JSContext, None => {} Some(src) => { let img_url = make_url(src, Some(url2.clone())); - image_element.image = Some(copy img_url); + image_element.image = Some(img_url.clone()); // inform the image cache to load this, but don't store a handle. // TODO (Issue #84): don't prefetch if we are within a <noscript> // tag. diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 3386f058b08..4d6b5f2bda2 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -266,7 +266,7 @@ impl Page { // Send new document and relevant styles to layout. let reflow = ~Reflow { document_root: do frame.document.with_base |doc| { doc.root }, - url: copy self.url.get_ref().first(), + url: self.url.get_ref().first().clone(), goal: goal, window_size: self.window_size.get(), script_chan: script_chan, @@ -498,7 +498,7 @@ impl ScriptTask { js_info.js_compartment.define_functions(debug_fns); js_info.js_context.evaluate_script(js_info.js_compartment.global_obj, bytes, - copy url.path, + url.path.clone(), 1); } } |