diff options
-rw-r--r-- | components/script/dom/browsercontext.rs | 2 | ||||
-rw-r--r-- | components/script/dom/dedicatedworkerglobalscope.rs | 2 | ||||
-rw-r--r-- | components/script/dom/element.rs | 2 | ||||
-rw-r--r-- | components/script/dom/eventtarget.rs | 1 | ||||
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 3 | ||||
-rw-r--r-- | components/script/dom/node.rs | 3 | ||||
-rw-r--r-- | components/script/dom/servohtmlparser.rs | 1 | ||||
-rw-r--r-- | components/script/dom/window.rs | 2 | ||||
-rw-r--r-- | components/script/dom/worker.rs | 2 | ||||
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 2 | ||||
-rw-r--r-- | components/script/lib.rs | 2 | ||||
-rw-r--r-- | components/script/parse/html.rs | 2 | ||||
-rw-r--r-- | components/script/script_task.rs | 2 | ||||
-rw-r--r-- | components/script/timers.rs | 1 |
14 files changed, 27 insertions, 0 deletions
diff --git a/components/script/dom/browsercontext.rs b/components/script/dom/browsercontext.rs index 2c7ba17c649..9cc2a94fdb9 100644 --- a/components/script/dom/browsercontext.rs +++ b/components/script/dom/browsercontext.rs @@ -47,6 +47,7 @@ impl BrowserContext { self.window_proxy } + #[allow(unsafe_blocks)] fn create_window_proxy(&mut self) { let win = self.active_window().root(); let win = win.r(); @@ -117,6 +118,7 @@ static PROXY_HANDLER: ProxyTraps = ProxyTraps { trace: None }; +#[allow(unsafe_blocks)] pub fn new_window_proxy_handler() -> WindowProxyHandler { unsafe { WindowProxyHandler(CreateWrapperProxyHandler(&PROXY_HANDLER)) diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index 90145ca610e..6f8242086f0 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -197,6 +197,7 @@ trait PrivateDedicatedWorkerGlobalScopeHelpers { } impl<'a> PrivateDedicatedWorkerGlobalScopeHelpers for JSRef<'a, DedicatedWorkerGlobalScope> { + #[allow(unsafe_blocks)] fn handle_event(self, msg: ScriptMsg) { match msg { ScriptMsg::DOMMessage(data, nbytes) => { @@ -229,6 +230,7 @@ impl<'a> PrivateDedicatedWorkerGlobalScopeHelpers for JSRef<'a, DedicatedWorkerG } impl<'a> DedicatedWorkerGlobalScopeMethods for JSRef<'a, DedicatedWorkerGlobalScope> { + #[allow(unsafe_blocks)] fn PostMessage(self, cx: *mut JSContext, message: JSVal) -> ErrorResult { let mut data = ptr::null_mut(); let mut nbytes = 0; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index ec43612be70..df99f4dc91d 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1283,12 +1283,14 @@ impl<'a> VirtualMethods for JSRef<'a, Element> { } impl<'a> style::TElement<'a> for JSRef<'a, Element> { + #[allow(unsafe_blocks)] fn get_attr(self, namespace: &Namespace, attr: &Atom) -> Option<&'a str> { self.get_attribute(namespace.clone(), attr).root().map(|attr| { // This transmute is used to cheat the lifetime restriction. unsafe { mem::transmute(attr.r().value().as_slice()) } }) } + #[allow(unsafe_blocks)] fn get_attrs(self, attr: &Atom) -> Vec<&'a str> { self.get_attributes(attr).into_iter().map(|attr| attr.root()).map(|attr| { // This transmute is used to cheat the lifetime restriction. diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index e266306f627..71203d386a2 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -186,6 +186,7 @@ impl<'a> EventTargetHelpers for JSRef<'a, EventTarget> { }).map(|entry| entry.listener.get_listener())) } + #[allow(unsafe_blocks)] fn set_event_handler_uncompiled(self, cx: *mut JSContext, url: Url, diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 85e1a214666..22da5bb20d7 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -304,6 +304,7 @@ pub trait HTMLInputElementHelpers { fn get_indeterminate_state(self) -> bool; } +#[allow(unsafe_blocks)] fn broadcast_radio_checked(broadcaster: JSRef<HTMLInputElement>, group: Option<&str>) { //TODO: if not in document, use root ancestor instead of document let owner = broadcaster.form_owner().root(); @@ -606,6 +607,7 @@ impl<'a> Activatable for JSRef<'a, HTMLInputElement> { } // https://html.spec.whatwg.org/multipage/interaction.html#run-pre-click-activation-steps + #[allow(unsafe_blocks)] fn pre_click_activation(&self) { let mut cache = self.activation_state.borrow_mut(); let ty = self.input_type.get(); @@ -758,6 +760,7 @@ impl<'a> Activatable for JSRef<'a, HTMLInputElement> { } // https://html.spec.whatwg.org/multipage/forms.html#implicit-submission + #[allow(unsafe_blocks)] fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool) { let doc = document_from_node(*self).root(); let node: JSRef<Node> = NodeCast::from_ref(doc.r()); diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 849f912bf35..b65dee52b6b 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -171,6 +171,7 @@ impl NodeFlags { #[unsafe_destructor] impl Drop for Node { + #[allow(unsafe_blocks)] fn drop(&mut self) { unsafe { self.reap_layout_data(); @@ -779,6 +780,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { } // http://dom.spec.whatwg.org/#dom-parentnode-queryselectorall + #[allow(unsafe_blocks)] fn query_selector_all(self, selectors: DOMString) -> Fallible<Temporary<NodeList>> { // Step 1. unsafe { @@ -878,6 +880,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { /// If the given untrusted node address represents a valid DOM node in the given runtime, /// returns it. +#[allow(unsafe_blocks)] pub fn from_untrusted_node_address(runtime: *mut JSRuntime, candidate: UntrustedNodeAddress) -> Temporary<Node> { unsafe { diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs index d06a50c04c8..7c7b2bec69d 100644 --- a/components/script/dom/servohtmlparser.rs +++ b/components/script/dom/servohtmlparser.rs @@ -99,6 +99,7 @@ impl tree_builder::Tracer<TrustedNodeAddress> for Tracer { } impl JSTraceable for ServoHTMLParser { + #[allow(unsafe_blocks)] fn trace(&self, trc: *mut JSTracer) { self.reflector_.trace(trc); diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index cba425f41e9..91d023eec18 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -295,6 +295,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> { debug!("{}", message); } + #[allow(unsafe_blocks)] fn Gc(self) { unsafe { JS_GC(JS_GetRuntime(self.get_cx())); @@ -328,6 +329,7 @@ impl<'a, T: Reflectable> ScriptHelpers for JSRef<'a, T> { self.evaluate_script_on_global_with_result(code, "") } + #[allow(unsafe_blocks)] fn evaluate_script_on_global_with_result(self, code: &str, filename: &str) -> JSVal { let this = self.reflector().get_jsobject(); let cx = global_object_for_js_object(this).root().r().get_cx(); diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 7e615cc9f6a..d3681900db3 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -80,6 +80,7 @@ impl Worker { Ok(Temporary::from_rooted(worker.r())) } + #[allow(unsafe_blocks)] pub fn handle_message(address: TrustedWorkerAddress, data: *mut u64, nbytes: size_t) { let worker = address.to_temporary().root(); @@ -100,6 +101,7 @@ impl Worker { } impl<'a> WorkerMethods for JSRef<'a, Worker> { + #[allow(unsafe_blocks)] fn PostMessage(self, cx: *mut JSContext, message: JSVal) -> ErrorResult { let mut data = ptr::null_mut(); let mut nbytes = 0; diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 79349cbf674..beee21798af 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -206,6 +206,7 @@ impl XMLHttpRequest { xhr.r().process_partial_response(progress); } + #[allow(unsafe_blocks)] fn fetch(fetch_type: &SyncOrAsync, resource_task: ResourceTask, mut load_data: LoadData, terminate_receiver: Receiver<TerminateReason>, cors_request: Result<Option<CORSRequest>,()>, gen_id: GenerationId, @@ -690,6 +691,7 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { } } } + #[allow(unsafe_blocks)] fn Response(self, cx: *mut JSContext) -> JSVal { match self.response_type.get() { _empty | Text => { diff --git a/components/script/lib.rs b/components/script/lib.rs index 33610bb1b6b..bd4b19745a4 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -4,6 +4,7 @@ #![feature(default_type_params, globs, macro_rules, phase, unsafe_destructor)] +#![deny(unsafe_blocks)] #![deny(unused_imports)] #![deny(unused_variables)] #![allow(non_snake_case)] @@ -51,6 +52,7 @@ pub mod dom { pub mod macros; /// The code to expose the DOM to JavaScript through IDL bindings. + #[allow(unsafe_blocks)] pub mod bindings { pub mod cell; pub mod global; diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 8b8fc52ca19..156994e5ea1 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#![allow(unsafe_blocks)] + use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, HTMLScriptElementCast}; diff --git a/components/script/script_task.rs b/components/script/script_task.rs index cb757d97f93..976c2b78011 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -5,6 +5,8 @@ //! The script task is the task that owns the DOM in memory, runs JavaScript, and spawns parsing //! and layout tasks. +#![allow(unsafe_blocks)] + use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; diff --git a/components/script/timers.rs b/components/script/timers.rs index f453c7677c3..c9a5495b30d 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -105,6 +105,7 @@ impl TimerManager { } } + #[allow(unsafe_blocks)] pub fn set_timeout_or_interval(&self, callback: TimerCallback, arguments: Vec<JSVal>, |