auto merge of #2533 : Ms2ger/servo/callback-bindingdeclarations, r=jdm

This commit also includes improvements to the 'use' order in some of the
touched files.
This commit is contained in:
bors-servo 2014-05-31 13:16:12 -04:00
commit 362af39b83
9 changed files with 38 additions and 37 deletions

View file

@ -5202,8 +5202,9 @@ class GlobalGenRoots():
@staticmethod @staticmethod
def BindingDeclarations(config): def BindingDeclarations(config):
descriptors = [d.name for d in config.getDescriptors(register=True)] descriptors = (set(d.name + "Binding" for d in config.getDescriptors(register=True)) |
curr = CGList([CGGeneric("pub mod %sBinding;\n" % name) for name in descriptors]) set(d.unroll().module() for d in config.callbacks))
curr = CGList([CGGeneric("pub mod %s;\n" % name) for name in sorted(descriptors)])
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT) curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)
return curr return curr

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::InheritTypes::{DocumentDerived, EventCast, HTMLElementCast}; use dom::bindings::codegen::InheritTypes::{DocumentDerived, EventCast, HTMLElementCast};
use dom::bindings::codegen::InheritTypes::{HTMLHeadElementCast, TextCast, ElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLHeadElementCast, TextCast, ElementCast};
use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast};

View file

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::callback::CallbackContainer; use dom::bindings::callback::CallbackContainer;
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::BindingDeclarations::EventListenerBinding::EventListener; use dom::bindings::codegen::BindingDeclarations::EventListenerBinding::EventListener;
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::error::{Fallible, InvalidState}; use dom::bindings::error::{Fallible, InvalidState};
use dom::bindings::js::JSRef; use dom::bindings::js::JSRef;
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};

View file

@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::BindingDeclarations::HTMLBodyElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLBodyElementBinding;
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLElementCast};
use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::EventTargetCast;
use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLElementCast};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::Reflectable; use dom::bindings::utils::Reflectable;

View file

@ -2,24 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::BindingDeclarations::HTMLElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLElementBinding;
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFrameSetElementDerived}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFrameSetElementDerived};
use dom::bindings::codegen::InheritTypes::{HTMLElementDerived, HTMLBodyElementDerived};
use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::EventTargetCast;
use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::codegen::InheritTypes::{HTMLElementDerived, HTMLBodyElementDerived};
use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::{ErrorResult, Fallible};
use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, ElementTypeId, HTMLElementTypeId}; use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::node::{Node, ElementNodeTypeId, window_from_node}; use dom::node::{Node, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use dom::window::WindowMethods; use dom::window::WindowMethods;
use js::jsapi::JSContext;
use js::jsval::{JSVal, NullValue};
use servo_util::namespace; use servo_util::namespace;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use js::jsapi::JSContext;
use js::jsval::{JSVal, NullValue};
#[deriving(Encodable)] #[deriving(Encodable)]
pub struct HTMLElement { pub struct HTMLElement {
pub element: Element pub element: Element

View file

@ -2,17 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull};
use dom::bindings::codegen::BindingDeclarations::WindowBinding; use dom::bindings::codegen::BindingDeclarations::WindowBinding;
use dom::bindings::codegen::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull};
use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::EventTargetCast;
use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable}; use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable};
use dom::bindings::trace::{Traceable, Untraceable}; use dom::bindings::trace::{Traceable, Untraceable};
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};
use dom::browsercontext::BrowserContext; use dom::browsercontext::BrowserContext;
use dom::console::Console;
use dom::document::Document; use dom::document::Document;
use dom::element::Element; use dom::element::Element;
use dom::eventtarget::{EventTarget, WindowTypeId, EventTargetHelpers}; use dom::eventtarget::{EventTarget, WindowTypeId, EventTargetHelpers};
use dom::console::Console;
use dom::location::Location; use dom::location::Location;
use dom::navigator::Navigator; use dom::navigator::Navigator;
use dom::performance::Performance; use dom::performance::Performance;

View file

@ -2,23 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestBinding; use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestBinding;
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::str::ByteString;
use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestBinding::XMLHttpRequestResponseType; use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestBinding::XMLHttpRequestResponseType;
use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestBinding::XMLHttpRequestResponseTypeValues::{_empty, Text}; use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestBinding::XMLHttpRequestResponseTypeValues::{_empty, Text};
use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast, XMLHttpRequestDerived}; use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast, XMLHttpRequestDerived};
use dom::bindings::conversions::ToJSValConvertible;
use dom::bindings::error::{ErrorResult, InvalidState, Network, Syntax, Security}; use dom::bindings::error::{ErrorResult, InvalidState, Network, Syntax, Security};
use dom::bindings::error::Fallible;
use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable, OptionalRootedRootable};
use dom::bindings::str::ByteString;
use dom::bindings::trace::Untraceable;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::document::Document; use dom::document::Document;
use dom::event::Event; use dom::event::Event;
use dom::eventtarget::{EventTarget, EventTargetHelpers, XMLHttpRequestTargetTypeId}; use dom::eventtarget::{EventTarget, EventTargetHelpers, XMLHttpRequestTargetTypeId};
use dom::bindings::conversions::ToJSValConvertible;
use dom::bindings::error::Fallible;
use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable, OptionalRootedRootable};
use dom::bindings::trace::Untraceable;
use js::jsapi::{JS_AddObjectRoot, JS_RemoveObjectRoot, JSContext};
use js::jsval::{JSVal, NullValue};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::progressevent::ProgressEvent; use dom::progressevent::ProgressEvent;
use dom::window::Window; use dom::window::Window;
use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget; use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
@ -27,18 +25,9 @@ use net::resource_task::{ResourceTask, Load, LoadData, Payload, Done};
use script_task::{ScriptChan, XHRProgressMsg}; use script_task::{ScriptChan, XHRProgressMsg};
use servo_util::str::DOMString; use servo_util::str::DOMString;
use servo_util::url::{parse_url, try_parse_url}; use servo_util::url::{parse_url, try_parse_url};
use url::Url;
use libc; use js::jsapi::{JS_AddObjectRoot, JS_RemoveObjectRoot, JSContext};
use libc::c_void; use js::jsval::{JSVal, NullValue};
use std::cell::Cell;
use std::comm::channel;
use std::io::{BufReader, MemWriter};
use std::from_str::FromStr;
use std::ascii::StrAsciiExt;
use std::task::TaskBuilder;
use std::path::BytesContainer;
use ResponseHeaderCollection = http::headers::response::HeaderCollection; use ResponseHeaderCollection = http::headers::response::HeaderCollection;
use RequestHeaderCollection = http::headers::request::HeaderCollection; use RequestHeaderCollection = http::headers::request::HeaderCollection;
@ -47,6 +36,17 @@ use http::headers::{HeaderEnum, HeaderValueByteIterator};
use http::headers::request::Header; use http::headers::request::Header;
use http::method::{Method, Get, Head, Post, Connect, Trace}; use http::method::{Method, Get, Head, Post, Connect, Trace};
use libc;
use libc::c_void;
use std::cell::Cell;
use std::comm::channel;
use std::io::{BufReader, MemWriter};
use std::from_str::FromStr;
use std::ascii::StrAsciiExt;
use std::task::TaskBuilder;
use std::path::BytesContainer;
use url::Url;
// As send() start accepting more and more parameter types, // As send() start accepting more and more parameter types,
// change this to the appropriate type from UnionTypes, eg // change this to the appropriate type from UnionTypes, eg
// use SendParam = dom::bindings::codegen::UnionTypes::StringOrFormData; // use SendParam = dom::bindings::codegen::UnionTypes::StringOrFormData;

View file

@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::InheritTypes::XMLHttpRequestEventTargetDerived; use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::EventTargetCast;
use dom::bindings::codegen::InheritTypes::XMLHttpRequestEventTargetDerived;
use dom::bindings::js::JSRef; use dom::bindings::js::JSRef;
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};
use dom::eventtarget::{EventTarget, EventTargetHelpers, XMLHttpRequestTargetTypeId}; use dom::eventtarget::{EventTarget, EventTargetHelpers, XMLHttpRequestTargetTypeId};

View file

@ -48,7 +48,6 @@ pub mod dom {
pub mod str; pub mod str;
pub mod trace; pub mod trace;
pub mod codegen { pub mod codegen {
pub mod EventHandlerBinding;
pub mod InterfaceTypes; pub mod InterfaceTypes;
pub mod InheritTypes; pub mod InheritTypes;
pub mod PrototypeList; pub mod PrototypeList;