зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #2533 - Include modules with only callbacks in BindingDeclarations (from Ms2ger:callback-bindingdeclarations); r=jdm
This commit also includes improvements to the 'use' order in some of the touched files. Source-Repo: https://github.com/servo/servo Source-Revision: 362af39b83b5eea56523bed8cc6e67c383e70a3d
This commit is contained in:
Родитель
ec199a1227
Коммит
82824c6149
|
@ -5202,8 +5202,9 @@ class GlobalGenRoots():
|
|||
@staticmethod
|
||||
def BindingDeclarations(config):
|
||||
|
||||
descriptors = [d.name for d in config.getDescriptors(register=True)]
|
||||
curr = CGList([CGGeneric("pub mod %sBinding;\n" % name) for name in descriptors])
|
||||
descriptors = (set(d.name + "Binding" for d in config.getDescriptors(register=True)) |
|
||||
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)
|
||||
return curr
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::InheritTypes::{DocumentDerived, EventCast, HTMLElementCast};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLHeadElementCast, TextCast, ElementCast};
|
||||
use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast};
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::callback::CallbackContainer;
|
||||
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::BindingDeclarations::EventListenerBinding::EventListener;
|
||||
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::error::{Fallible, InvalidState};
|
||||
use dom::bindings::js::JSRef;
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* 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::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
|
||||
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::{HTMLBodyElementDerived, HTMLElementCast};
|
||||
use dom::bindings::error::ErrorResult;
|
||||
use dom::bindings::js::{JSRef, Temporary};
|
||||
use dom::bindings::utils::Reflectable;
|
||||
|
|
|
@ -2,24 +2,25 @@
|
|||
* 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::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::BindingDeclarations::HTMLElementBinding;
|
||||
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFrameSetElementDerived};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLElementDerived, HTMLBodyElementDerived};
|
||||
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::js::{JSRef, Temporary};
|
||||
use dom::document::Document;
|
||||
use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
|
||||
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
|
||||
use dom::node::{Node, ElementNodeTypeId, window_from_node};
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use dom::window::WindowMethods;
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsval::{JSVal, NullValue};
|
||||
use servo_util::namespace;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsval::{JSVal, NullValue};
|
||||
|
||||
#[deriving(Encodable)]
|
||||
pub struct HTMLElement {
|
||||
pub element: Element
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
* 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::BindingDeclarations::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull};
|
||||
use dom::bindings::codegen::BindingDeclarations::WindowBinding;
|
||||
use dom::bindings::codegen::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull};
|
||||
use dom::bindings::codegen::InheritTypes::EventTargetCast;
|
||||
use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable};
|
||||
use dom::bindings::trace::{Traceable, Untraceable};
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::browsercontext::BrowserContext;
|
||||
use dom::console::Console;
|
||||
use dom::document::Document;
|
||||
use dom::element::Element;
|
||||
use dom::eventtarget::{EventTarget, WindowTypeId, EventTargetHelpers};
|
||||
use dom::console::Console;
|
||||
use dom::location::Location;
|
||||
use dom::navigator::Navigator;
|
||||
use dom::performance::Performance;
|
||||
|
|
|
@ -2,23 +2,21 @@
|
|||
* 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::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
|
||||
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::XMLHttpRequestResponseTypeValues::{_empty, Text};
|
||||
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::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::event::Event;
|
||||
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::window::Window;
|
||||
use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
|
||||
|
@ -27,18 +25,9 @@ use net::resource_task::{ResourceTask, Load, LoadData, Payload, Done};
|
|||
use script_task::{ScriptChan, XHRProgressMsg};
|
||||
use servo_util::str::DOMString;
|
||||
use servo_util::url::{parse_url, try_parse_url};
|
||||
use url::Url;
|
||||
|
||||
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 js::jsapi::{JS_AddObjectRoot, JS_RemoveObjectRoot, JSContext};
|
||||
use js::jsval::{JSVal, NullValue};
|
||||
|
||||
use ResponseHeaderCollection = http::headers::response::HeaderCollection;
|
||||
use RequestHeaderCollection = http::headers::request::HeaderCollection;
|
||||
|
@ -47,6 +36,17 @@ use http::headers::{HeaderEnum, HeaderValueByteIterator};
|
|||
use http::headers::request::Header;
|
||||
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,
|
||||
// change this to the appropriate type from UnionTypes, eg
|
||||
// use SendParam = dom::bindings::codegen::UnionTypes::StringOrFormData;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* 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::InheritTypes::XMLHttpRequestEventTargetDerived;
|
||||
use dom::bindings::codegen::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::BindingDeclarations::EventHandlerBinding::EventHandlerNonNull;
|
||||
use dom::bindings::codegen::InheritTypes::EventTargetCast;
|
||||
use dom::bindings::codegen::InheritTypes::XMLHttpRequestEventTargetDerived;
|
||||
use dom::bindings::js::JSRef;
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::eventtarget::{EventTarget, EventTargetHelpers, XMLHttpRequestTargetTypeId};
|
||||
|
@ -129,4 +129,4 @@ impl<'a> XMLHttpRequestEventTargetMethods for JSRef<'a, XMLHttpRequestEventTarge
|
|||
let eventtarget: &mut JSRef<EventTarget> = EventTargetCast::from_mut_ref(self);
|
||||
eventtarget.set_event_handler_common("loadend", listener)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ pub mod dom {
|
|||
pub mod str;
|
||||
pub mod trace;
|
||||
pub mod codegen {
|
||||
pub mod EventHandlerBinding;
|
||||
pub mod InterfaceTypes;
|
||||
pub mod InheritTypes;
|
||||
pub mod PrototypeList;
|
||||
|
|
Загрузка…
Ссылка в новой задаче