forked from mirrors/gecko-dev
		
	 d4e45231ec
			
		
	
	
		d4e45231ec
		
	
	
	
	
		
			
			The integration is off by default for now. You can try it out with `./mach build --features "script/plugins/clippy"`. We're using a branch of clippy with some of the lints changed to Allow, either because they don't apply to us, or because they're noisy and dwarf other warnings (but still should be fixed) After going through the rest of Servo's warnings I'll figure out which lints we should be keeping. There's a cargo bug with optional deps that makes it hard for this to work with Cargo.lock -- so this PR contains no changes to lockfiles (and running the build with clippy on may dirty the lockfile, though it gets fixed later) Source-Repo: https://github.com/servo/servo Source-Revision: 50e1c967e4299c1515575f73d407f5f6b977d818
		
			
				
	
	
		
			53 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
| /* This Source Code Form is subject to the terms of the Mozilla Public
 | |
|  * 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/. */
 | |
| 
 | |
| use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
 | |
| use dom::bindings::codegen::Bindings::XMLHttpRequestEventTargetBinding::XMLHttpRequestEventTargetMethods;
 | |
| use dom::bindings::codegen::InheritTypes::EventTargetCast;
 | |
| use dom::bindings::codegen::InheritTypes::XMLHttpRequestEventTargetDerived;
 | |
| use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId};
 | |
| 
 | |
| #[derive(JSTraceable, Copy, Clone, PartialEq, HeapSizeOf)]
 | |
| pub enum XMLHttpRequestEventTargetTypeId {
 | |
|     XMLHttpRequest,
 | |
|     XMLHttpRequestUpload,
 | |
| }
 | |
| 
 | |
| #[dom_struct]
 | |
| #[derive(HeapSizeOf)]
 | |
| pub struct XMLHttpRequestEventTarget {
 | |
|     eventtarget: EventTarget,
 | |
| }
 | |
| 
 | |
| impl XMLHttpRequestEventTarget {
 | |
|     pub fn new_inherited(type_id: XMLHttpRequestEventTargetTypeId) -> XMLHttpRequestEventTarget {
 | |
|         XMLHttpRequestEventTarget {
 | |
|             eventtarget: EventTarget::new_inherited(EventTargetTypeId::XMLHttpRequestEventTarget(type_id))
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     #[inline]
 | |
|     pub fn eventtarget(&self) -> &EventTarget {
 | |
|         &self.eventtarget
 | |
|     }
 | |
| }
 | |
| impl XMLHttpRequestEventTargetDerived for EventTarget {
 | |
|     fn is_xmlhttprequesteventtarget(&self) -> bool {
 | |
|         match *self.type_id() {
 | |
|             EventTargetTypeId::XMLHttpRequestEventTarget(_) => true,
 | |
|             _ => false
 | |
|         }
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| impl<'a> XMLHttpRequestEventTargetMethods for &'a XMLHttpRequestEventTarget {
 | |
|     event_handler!(loadstart, GetOnloadstart, SetOnloadstart);
 | |
|     event_handler!(progress, GetOnprogress, SetOnprogress);
 | |
|     event_handler!(abort, GetOnabort, SetOnabort);
 | |
|     event_handler!(error, GetOnerror, SetOnerror);
 | |
|     event_handler!(load, GetOnload, SetOnload);
 | |
|     event_handler!(timeout, GetOntimeout, SetOntimeout);
 | |
|     event_handler!(loadend, GetOnloadend, SetOnloadend);
 | |
| }
 |