mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-26 19:45:54 +03:00
Merge branch 'master' of git://github.com/rustwasm/wasm-bindgen
This commit is contained in:
commit
751f226170
17
CHANGELOG.md
17
CHANGELOG.md
@ -32,6 +32,23 @@ Released YYYY-MM-DD.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## 0.2.17
|
||||
|
||||
Released 2018-08-16.
|
||||
|
||||
### Added
|
||||
|
||||
* Greatly expanded documentation in the wasm-bindgen guide.
|
||||
* Added bindings to `js-sys` for `Intl.DateTimeFormat`
|
||||
* Added a number of `extends` attributes for types in `js-sys`
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed compile on latest nightly with latest `proc-macro2`
|
||||
* Fixed compilation in some scenarios on Windows with paths in `module` paths
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## 0.2.16
|
||||
|
||||
Released 2018-08-13.
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
@ -27,12 +27,12 @@ serde-serialize = ["serde", "serde_json", "std"]
|
||||
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.16" }
|
||||
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.17" }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.16' }
|
||||
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.17' }
|
||||
serde_derive = "1.0"
|
||||
wasm-bindgen-test-crate-a = { path = 'tests/crates/a' }
|
||||
wasm-bindgen-test-crate-b = { path = 'tests/crates/b' }
|
||||
@ -50,6 +50,7 @@ members = [
|
||||
"crates/webidl-tests",
|
||||
"examples/add",
|
||||
"examples/asm.js",
|
||||
"examples/canvas",
|
||||
"examples/char",
|
||||
"examples/closures",
|
||||
"examples/comments",
|
||||
@ -64,6 +65,7 @@ members = [
|
||||
"examples/performance",
|
||||
"examples/smorgasboard",
|
||||
"examples/wasm-in-wasm",
|
||||
"examples/webaudio",
|
||||
"tests/no-std",
|
||||
]
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
|
||||
@ -21,4 +21,4 @@ proc-macro2 = "0.4.8"
|
||||
quote = '0.6'
|
||||
serde_json = "1.0"
|
||||
syn = { version = '0.14', features = ['full', 'visit'] }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.16" }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.17" }
|
||||
|
@ -21,6 +21,10 @@ pub struct Program {
|
||||
pub consts: Vec<Const>,
|
||||
/// rust submodules
|
||||
pub modules: Vec<Module>,
|
||||
/// "dictionaries", generated for WebIDL, which are basically just "typed
|
||||
/// objects" in the sense that they represent a JS object with a particular
|
||||
/// shape in JIT parlance.
|
||||
pub dictionaries: Vec<Dictionary>,
|
||||
}
|
||||
|
||||
/// A rust to js interface. Allows interaction with rust objects/functions
|
||||
@ -253,6 +257,21 @@ pub struct Module {
|
||||
pub imports: Vec<Import>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
|
||||
#[derive(Clone)]
|
||||
pub struct Dictionary {
|
||||
pub name: Ident,
|
||||
pub fields: Vec<DictionaryField>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
|
||||
#[derive(Clone)]
|
||||
pub struct DictionaryField {
|
||||
pub name: Ident,
|
||||
pub required: bool,
|
||||
pub ty: syn::Type,
|
||||
}
|
||||
|
||||
impl Program {
|
||||
pub(crate) fn shared(&self) -> Result<shared::Program, Diagnostic> {
|
||||
Ok(shared::Program {
|
||||
|
@ -74,6 +74,9 @@ impl TryToTokens for ast::Program {
|
||||
errors.push(e);
|
||||
}
|
||||
}
|
||||
for d in self.dictionaries.iter() {
|
||||
d.to_tokens(tokens);
|
||||
}
|
||||
|
||||
Diagnostic::from_vec(errors)?;
|
||||
|
||||
@ -1135,6 +1138,153 @@ impl<'a> TryToTokens for ast::Module {
|
||||
}
|
||||
}
|
||||
|
||||
impl ToTokens for ast::Dictionary {
|
||||
fn to_tokens(&self, tokens: &mut TokenStream) {
|
||||
let name = &self.name;
|
||||
let mut methods = TokenStream::new();
|
||||
for field in self.fields.iter() {
|
||||
field.to_tokens(&mut methods);
|
||||
}
|
||||
let required_names = &self.fields.iter()
|
||||
.filter(|f| f.required)
|
||||
.map(|f| &f.name)
|
||||
.collect::<Vec<_>>();
|
||||
let required_types = &self.fields.iter()
|
||||
.filter(|f| f.required)
|
||||
.map(|f| &f.ty)
|
||||
.collect::<Vec<_>>();
|
||||
let required_names2 = required_names;
|
||||
let required_names3 = required_names;
|
||||
|
||||
let const_name = Ident::new(&format!("_CONST_{}", name), Span::call_site());
|
||||
(quote! {
|
||||
#[derive(Clone, Debug)]
|
||||
#[repr(transparent)]
|
||||
pub struct #name {
|
||||
obj: ::js_sys::Object,
|
||||
}
|
||||
|
||||
impl #name {
|
||||
pub fn new(#(#required_names: #required_types),*) -> #name {
|
||||
let mut _ret = #name { obj: ::js_sys::Object::new() };
|
||||
#(_ret.#required_names2(#required_names3);)*
|
||||
return _ret
|
||||
}
|
||||
|
||||
#methods
|
||||
}
|
||||
|
||||
#[allow(bad_style)]
|
||||
const #const_name: () = {
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen::describe::WasmDescribe;
|
||||
use wasm_bindgen::convert::*;
|
||||
use wasm_bindgen::{JsValue, JsCast};
|
||||
use wasm_bindgen::__rt::core::mem::ManuallyDrop;
|
||||
|
||||
// interop w/ JsValue
|
||||
impl From<#name> for JsValue {
|
||||
fn from(val: #name) -> JsValue {
|
||||
val.obj.into()
|
||||
}
|
||||
}
|
||||
impl AsRef<JsValue> for #name {
|
||||
fn as_ref(&self) -> &JsValue { self.obj.as_ref() }
|
||||
}
|
||||
impl AsMut<JsValue> for #name {
|
||||
fn as_mut(&mut self) -> &mut JsValue { self.obj.as_mut() }
|
||||
}
|
||||
|
||||
// Boundary conversion impls
|
||||
impl WasmDescribe for #name {
|
||||
fn describe() {
|
||||
Object::describe();
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoWasmAbi for #name {
|
||||
type Abi = <Object as IntoWasmAbi>::Abi;
|
||||
fn into_abi(self, extra: &mut Stack) -> Self::Abi {
|
||||
self.obj.into_abi(extra)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoWasmAbi for &'a #name {
|
||||
type Abi = <&'a Object as IntoWasmAbi>::Abi;
|
||||
fn into_abi(self, extra: &mut Stack) -> Self::Abi {
|
||||
(&self.obj).into_abi(extra)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromWasmAbi for #name {
|
||||
type Abi = <Object as FromWasmAbi>::Abi;
|
||||
unsafe fn from_abi(abi: Self::Abi, extra: &mut Stack) -> Self {
|
||||
#name { obj: Object::from_abi(abi, extra) }
|
||||
}
|
||||
}
|
||||
|
||||
impl OptionIntoWasmAbi for #name {
|
||||
fn none() -> Self::Abi { Object::none() }
|
||||
}
|
||||
impl<'a> OptionIntoWasmAbi for &'a #name {
|
||||
fn none() -> Self::Abi { <&'a Object>::none() }
|
||||
}
|
||||
impl OptionFromWasmAbi for #name {
|
||||
fn is_none(abi: &Self::Abi) -> bool { Object::is_none(abi) }
|
||||
}
|
||||
|
||||
impl RefFromWasmAbi for #name {
|
||||
type Abi = <Object as RefFromWasmAbi>::Abi;
|
||||
type Anchor = ManuallyDrop<#name>;
|
||||
|
||||
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut Stack) -> Self::Anchor {
|
||||
let tmp = <Object as RefFromWasmAbi>::ref_from_abi(js, extra);
|
||||
ManuallyDrop::new(#name {
|
||||
obj: ManuallyDrop::into_inner(tmp),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl JsCast for #name {
|
||||
fn instanceof(val: &JsValue) -> bool {
|
||||
Object::instanceof(val)
|
||||
}
|
||||
|
||||
fn unchecked_from_js(val: JsValue) -> Self {
|
||||
#name { obj: Object::unchecked_from_js(val) }
|
||||
}
|
||||
|
||||
fn unchecked_from_js_ref(val: &JsValue) -> &Self {
|
||||
unsafe { &*(val as *const JsValue as *const #name) }
|
||||
}
|
||||
|
||||
fn unchecked_from_js_mut(val: &mut JsValue) -> &mut Self {
|
||||
unsafe { &mut *(val as *mut JsValue as *mut #name) }
|
||||
}
|
||||
}
|
||||
};
|
||||
}).to_tokens(tokens);
|
||||
}
|
||||
}
|
||||
|
||||
impl ToTokens for ast::DictionaryField {
|
||||
fn to_tokens(&self, tokens: &mut TokenStream) {
|
||||
let name = &self.name;
|
||||
let ty = &self.ty;
|
||||
(quote! {
|
||||
pub fn #name(&mut self, val: #ty) -> &mut Self {
|
||||
use wasm_bindgen::JsValue;
|
||||
::js_sys::Reflect::set(
|
||||
self.obj.as_ref(),
|
||||
&JsValue::from(stringify!(#name)),
|
||||
&JsValue::from(val),
|
||||
);
|
||||
self
|
||||
}
|
||||
}).to_tokens(tokens);
|
||||
}
|
||||
}
|
||||
|
||||
/// Emits the necessary glue tokens for "descriptor", generating an appropriate
|
||||
/// symbol name as well as attributes around the descriptor function itself.
|
||||
struct Descriptor<'a, T>(&'a Ident, T);
|
||||
|
@ -84,6 +84,7 @@ impl ImportedTypes for ast::Program {
|
||||
{
|
||||
self.imports.imported_types(f);
|
||||
self.consts.imported_types(f);
|
||||
self.dictionaries.imported_types(f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,21 +299,44 @@ impl ImportedTypes for ast::Const {
|
||||
}
|
||||
}
|
||||
|
||||
impl ImportedTypes for ast::Dictionary {
|
||||
fn imported_types<F>(&self, f: &mut F)
|
||||
where
|
||||
F: FnMut(&Ident, ImportedTypeKind),
|
||||
{
|
||||
f(&self.name, ImportedTypeKind::Definition);
|
||||
for field in self.fields.iter() {
|
||||
field.imported_types(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ImportedTypes for ast::DictionaryField {
|
||||
fn imported_types<F>(&self, f: &mut F)
|
||||
where
|
||||
F: FnMut(&Ident, ImportedTypeKind),
|
||||
{
|
||||
self.ty.imported_types(f);
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove any methods, statics, &c, that reference types that are *not*
|
||||
/// defined.
|
||||
pub trait RemoveUndefinedImports {
|
||||
fn remove_undefined_imports<F>(&mut self, is_defined: &F)
|
||||
fn remove_undefined_imports<F>(&mut self, is_defined: &F) -> bool
|
||||
where
|
||||
F: Fn(&Ident) -> bool;
|
||||
}
|
||||
|
||||
impl RemoveUndefinedImports for ast::Program {
|
||||
fn remove_undefined_imports<F>(&mut self, is_defined: &F)
|
||||
fn remove_undefined_imports<F>(&mut self, is_defined: &F) -> bool
|
||||
where
|
||||
F: Fn(&Ident) -> bool,
|
||||
{
|
||||
self.imports.remove_undefined_imports(is_defined);
|
||||
self.consts.remove_undefined_imports(is_defined);
|
||||
let a = self.imports.remove_undefined_imports(is_defined);
|
||||
let b = self.consts.remove_undefined_imports(is_defined);
|
||||
let c = self.dictionaries.remove_undefined_imports(is_defined);
|
||||
a || b || c
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,10 +344,11 @@ impl<T> RemoveUndefinedImports for Vec<T>
|
||||
where
|
||||
T: ImportedTypeReferences,
|
||||
{
|
||||
fn remove_undefined_imports<F>(&mut self, is_defined: &F)
|
||||
fn remove_undefined_imports<F>(&mut self, is_defined: &F) -> bool
|
||||
where
|
||||
F: Fn(&Ident) -> bool,
|
||||
{
|
||||
let before = self.len();
|
||||
self.retain(|x| {
|
||||
let mut all_defined = true;
|
||||
x.imported_type_references(&mut |id| {
|
||||
@ -336,5 +361,6 @@ where
|
||||
});
|
||||
all_defined
|
||||
});
|
||||
before != self.len()
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
use proc_macro2::*;
|
||||
use quote::ToTokens;
|
||||
use quote::{ToTokens, TokenStreamExt};
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! err_span {
|
||||
@ -79,13 +79,13 @@ impl ToTokens for Diagnostic {
|
||||
Repr::Single { text, span } => {
|
||||
let cs2 = (Span::call_site(), Span::call_site());
|
||||
let (start, end) = span.unwrap_or(cs2);
|
||||
dst.extend(Some(Ident::new("compile_error", start).into()));
|
||||
dst.extend(Some(Punct::new('!', Spacing::Alone).into()));
|
||||
dst.append(Ident::new("compile_error", start));
|
||||
dst.append(Punct::new('!', Spacing::Alone));
|
||||
let mut message = TokenStream::new();
|
||||
message.extend(Some(Literal::string(text).into()));
|
||||
message.append(Literal::string(text));
|
||||
let mut group = Group::new(Delimiter::Brace, message);
|
||||
group.set_span(end);
|
||||
dst.extend(Some(group.into()));
|
||||
dst.append(group);
|
||||
}
|
||||
Repr::Multi { diagnostics } => {
|
||||
for diagnostic in diagnostics {
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-cli-support"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support"
|
||||
@ -17,6 +17,6 @@ parity-wasm = "0.31"
|
||||
serde = "1.0"
|
||||
serde_json = "1.0"
|
||||
tempfile = "3.0"
|
||||
wasm-bindgen-shared = { path = "../shared", version = '=0.2.16' }
|
||||
wasm-bindgen-shared = { path = "../shared", version = '=0.2.17' }
|
||||
wasm-gc-api = "0.1.9"
|
||||
wasmi = "0.3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-cli"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli"
|
||||
@ -23,8 +23,8 @@ rouille = { version = "2.1.0", default-features = false }
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.16" }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.16" }
|
||||
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.17" }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.17" }
|
||||
openssl = { version = '0.10.11', optional = true }
|
||||
|
||||
[features]
|
||||
|
@ -7,12 +7,12 @@ license = "MIT/Apache-2.0"
|
||||
name = "wasm-bindgen-futures"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures"
|
||||
readme = "./README.md"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
|
||||
[dependencies]
|
||||
futures = "0.1.20"
|
||||
js-sys = { path = "../js-sys", version = '0.2.1' }
|
||||
wasm-bindgen = { path = "../..", version = '0.2.16' }
|
||||
wasm-bindgen = { path = "../..", version = '0.2.17' }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
wasm-bindgen-test = { path = '../test', version = '0.2.16' }
|
||||
wasm-bindgen-test = { path = '../test', version = '0.2.17' }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "js-sys"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
readme = "./README.md"
|
||||
categories = ["wasm"]
|
||||
@ -18,9 +18,9 @@ test = false
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen = { path = "../..", version = "0.2.16" }
|
||||
wasm-bindgen = { path = "../..", version = "0.2.17" }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
futures = "0.1.20"
|
||||
wasm-bindgen-test = { path = '../test', version = '=0.2.16' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '=0.2.16' }
|
||||
wasm-bindgen-test = { path = '../test', version = '=0.2.17' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '=0.2.17' }
|
||||
|
@ -683,8 +683,7 @@ extern "C" {
|
||||
// Float32Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
// TODO Uncomment this once TypedArray is added:
|
||||
// #[wasm_bindgen(extends = Object, extends = TypedArray)]
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Float32Array;
|
||||
|
||||
@ -737,8 +736,7 @@ extern "C" {
|
||||
// Float64Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
// TODO Uncomment this once TypedArray is added:
|
||||
// #[wasm_bindgen(extends = Object, extends = TypedArray)]
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Float64Array;
|
||||
|
||||
@ -914,6 +912,7 @@ extern {
|
||||
// Int8Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Int8Array;
|
||||
|
||||
@ -966,6 +965,7 @@ extern "C" {
|
||||
// Int16Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Int16Array;
|
||||
|
||||
@ -1018,6 +1018,7 @@ extern "C" {
|
||||
// Int32Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Int32Array;
|
||||
|
||||
@ -2539,6 +2540,7 @@ extern {
|
||||
// Uint8Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Uint8Array;
|
||||
|
||||
@ -2591,6 +2593,7 @@ extern "C" {
|
||||
// Uint8ClampedArray
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Uint8ClampedArray;
|
||||
|
||||
@ -2645,6 +2648,7 @@ extern "C" {
|
||||
// Uint16Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Uint16Array;
|
||||
|
||||
@ -2697,6 +2701,7 @@ extern "C" {
|
||||
// Uint32Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Uint32Array;
|
||||
|
||||
|
@ -8,6 +8,7 @@ fn range_error() {
|
||||
let error = RangeError::new("out of range yo");
|
||||
assert!(error.is_instance_of::<RangeError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
assert!(error.is_instance_of::<Object>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "out of range yo");
|
||||
|
@ -8,6 +8,7 @@ fn reference_error() {
|
||||
let error = ReferenceError::new("bad reference, fool");
|
||||
assert!(error.is_instance_of::<ReferenceError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
assert!(error.is_instance_of::<Object>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "bad reference, fool");
|
||||
|
@ -8,6 +8,7 @@ fn syntax_error() {
|
||||
let error = SyntaxError::new("msg");
|
||||
assert!(error.is_instance_of::<SyntaxError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
assert!(error.is_instance_of::<Object>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "msg");
|
||||
|
@ -8,6 +8,7 @@ fn type_error() {
|
||||
let error = TypeError::new("msg");
|
||||
assert!(error.is_instance_of::<TypeError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
assert!(error.is_instance_of::<Object>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "msg");
|
||||
|
@ -1,5 +1,6 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use js_sys::*;
|
||||
|
||||
macro_rules! each {
|
||||
@ -16,6 +17,19 @@ macro_rules! each {
|
||||
)
|
||||
}
|
||||
|
||||
macro_rules! test_inheritence {
|
||||
($arr:ident) => ({
|
||||
let arr = $arr::new(&JsValue::undefined());
|
||||
assert!(arr.is_instance_of::<$arr>());
|
||||
let _: &Object = arr.as_ref();
|
||||
assert!(arr.is_instance_of::<Object>());
|
||||
})
|
||||
}
|
||||
#[wasm_bindgen_test]
|
||||
fn inheritence() {
|
||||
each!(test_inheritence);
|
||||
}
|
||||
|
||||
macro_rules! test_undefined {
|
||||
($arr:ident) => ({
|
||||
let arr = $arr::new(&JsValue::undefined());
|
||||
|
@ -8,6 +8,7 @@ fn uri_error() {
|
||||
let error = UriError::new("msg");
|
||||
assert!(error.is_instance_of::<UriError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
assert!(error.is_instance_of::<Object>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "msg");
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support"
|
||||
@ -18,5 +18,5 @@ extra-traits = ["syn/extra-traits"]
|
||||
syn = { version = '0.14', features = ['full'] }
|
||||
quote = '0.6'
|
||||
proc-macro2 = "0.4.9"
|
||||
wasm-bindgen-backend = { path = "../backend", version = "=0.2.16" }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.16" }
|
||||
wasm-bindgen-backend = { path = "../backend", version = "=0.2.17" }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.17" }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro"
|
||||
@ -18,5 +18,5 @@ spans = ["wasm-bindgen-macro-support/spans"]
|
||||
xxx_debug_only_print_generated_code = []
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.16" }
|
||||
wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.17" }
|
||||
quote = "0.6"
|
||||
|
@ -12,12 +12,6 @@ extern "C" {
|
||||
#[wasm_bindgen(y)]
|
||||
fn bar();
|
||||
|
||||
#[wasm_bindgen z]
|
||||
fn bar();
|
||||
|
||||
#[wasm_bindgen(z2) x]
|
||||
fn bar();
|
||||
|
||||
#[wasm_bindgen { }]
|
||||
fn bar();
|
||||
}
|
||||
|
@ -13,20 +13,8 @@ error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
||||
error: malformed #[wasm_bindgen] attribute
|
||||
--> $DIR/invalid-attr.rs:15:5
|
||||
|
|
||||
15 | #[wasm_bindgen z]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: malformed #[wasm_bindgen] attribute
|
||||
--> $DIR/invalid-attr.rs:18:5
|
||||
|
|
||||
18 | #[wasm_bindgen(z2) x]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: malformed #[wasm_bindgen] attribute
|
||||
--> $DIR/invalid-attr.rs:21:5
|
||||
|
|
||||
21 | #[wasm_bindgen { }]
|
||||
15 | #[wasm_bindgen { }]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-test-macro"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
description = "Internal testing macro for wasm-bindgen"
|
||||
license = "MIT/Apache-2.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-test"
|
||||
version = "0.2.16"
|
||||
version = "0.2.17"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
description = "Internal testing crate for wasm-bindgen"
|
||||
license = "MIT/Apache-2.0"
|
||||
@ -11,9 +11,9 @@ console_error_panic_hook = '0.1'
|
||||
futures = "0.1"
|
||||
js-sys = { path = '../js-sys', version = '0.2.1' }
|
||||
scoped-tls = "0.1"
|
||||
wasm-bindgen = { path = '../..', version = '0.2.16' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '0.2.16' }
|
||||
wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.2.16' }
|
||||
wasm-bindgen = { path = '../..', version = '0.2.17' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '0.2.17' }
|
||||
wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.2.17' }
|
||||
|
||||
[lib]
|
||||
test = false
|
||||
|
@ -11,15 +11,15 @@ test = false
|
||||
[build-dependencies]
|
||||
env_logger = "0.5.10"
|
||||
failure = "0.1.2"
|
||||
wasm-bindgen-webidl = { path = "../webidl", version = "=0.2.16" }
|
||||
wasm-bindgen-webidl = { path = "../webidl", version = "=0.2.17" }
|
||||
sourcefile = "0.1"
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen = { path = "../..", version = "0.2.16" }
|
||||
wasm-bindgen = { path = "../..", version = "0.2.17" }
|
||||
js-sys = { path = '../js-sys', version = '0.2.1' }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
futures = "0.1"
|
||||
js-sys = { path = '../js-sys', version = '0.2.1' }
|
||||
wasm-bindgen-test = { path = '../test', version = '0.2.16' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '0.2.16' }
|
||||
wasm-bindgen-test = { path = '../test', version = '0.2.17' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '0.2.17' }
|
||||
|
@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker,System)]
|
||||
interface AbstractWorker {
|
||||
[Exposed=(Window,Worker,System)]
|
||||
interface mixin AbstractWorker {
|
||||
attribute EventHandler onerror;
|
||||
};
|
||||
|
@ -43,6 +43,3 @@ interface AnalyserNode : AudioNode {
|
||||
attribute double smoothingTimeConstant;
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
AnalyserNode implements AudioNodePassThrough;
|
||||
|
7
crates/web-sys/webidls/enabled/Attr.webidl
vendored
7
crates/web-sys/webidls/enabled/Attr.webidl
vendored
@ -24,10 +24,3 @@ interface Attr : Node {
|
||||
|
||||
readonly attribute boolean specified;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
|
||||
partial interface Attr {
|
||||
[GetterThrows]
|
||||
readonly attribute Element? ownerElement;
|
||||
};
|
||||
|
@ -36,6 +36,3 @@ interface AudioBufferSourceNode : AudioScheduledSourceNode {
|
||||
void start(optional double when = 0, optional double grainOffset = 0,
|
||||
optional double grainDuration);
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
AudioBufferSourceNode implements AudioNodePassThrough;
|
||||
|
12
crates/web-sys/webidls/enabled/AudioNode.webidl
vendored
12
crates/web-sys/webidls/enabled/AudioNode.webidl
vendored
@ -62,15 +62,3 @@ interface AudioNode : EventTarget {
|
||||
attribute ChannelInterpretation channelInterpretation;
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
partial interface AudioNode {
|
||||
[ChromeOnly]
|
||||
readonly attribute unsigned long id;
|
||||
};
|
||||
[NoInterfaceObject]
|
||||
interface AudioNodePassThrough {
|
||||
[ChromeOnly]
|
||||
attribute boolean passThrough;
|
||||
};
|
||||
|
||||
|
10
crates/web-sys/webidls/enabled/AudioParam.webidl
vendored
10
crates/web-sys/webidls/enabled/AudioParam.webidl
vendored
@ -40,13 +40,3 @@ interface AudioParam {
|
||||
AudioParam cancelScheduledValues(double startTime);
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
partial interface AudioParam {
|
||||
// The ID of the AudioNode this AudioParam belongs to.
|
||||
[ChromeOnly]
|
||||
readonly attribute unsigned long parentNodeId;
|
||||
// The name of the AudioParam
|
||||
[ChromeOnly]
|
||||
readonly attribute DOMString name;
|
||||
};
|
||||
|
@ -44,7 +44,3 @@ interface BiquadFilterNode : AudioNode {
|
||||
Float32Array phaseResponse);
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
BiquadFilterNode implements AudioNodePassThrough;
|
||||
|
||||
|
33
crates/web-sys/webidls/enabled/BoxObject.webidl
vendored
33
crates/web-sys/webidls/enabled/BoxObject.webidl
vendored
@ -1,33 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
[Func="IsChromeOrXBL"]
|
||||
interface BoxObject {
|
||||
readonly attribute Element? element;
|
||||
|
||||
readonly attribute long x;
|
||||
readonly attribute long y;
|
||||
[Throws]
|
||||
readonly attribute long screenX;
|
||||
[Throws]
|
||||
readonly attribute long screenY;
|
||||
readonly attribute long width;
|
||||
readonly attribute long height;
|
||||
|
||||
nsISupports? getPropertyAsSupports(DOMString propertyName);
|
||||
void setPropertyAsSupports(DOMString propertyName, nsISupports value);
|
||||
[Throws]
|
||||
DOMString? getProperty(DOMString propertyName);
|
||||
void setProperty(DOMString propertyName, DOMString propertyValue);
|
||||
void removeProperty(DOMString propertyName);
|
||||
|
||||
// for stepping through content in the expanded dom with box-ordinal-group order
|
||||
readonly attribute Element? parentBox;
|
||||
readonly attribute Element? firstChild;
|
||||
readonly attribute Element? lastChild;
|
||||
readonly attribute Element? nextSibling;
|
||||
readonly attribute Element? previousSibling;
|
||||
};
|
@ -19,15 +19,13 @@ dictionary BrowserElementExecuteScriptOptions {
|
||||
DOMString? origin;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface BrowserElement {
|
||||
interface mixin BrowserElement {
|
||||
};
|
||||
|
||||
BrowserElement implements BrowserElementCommon;
|
||||
BrowserElement implements BrowserElementPrivileged;
|
||||
BrowserElement includes BrowserElementCommon;
|
||||
BrowserElement includes BrowserElementPrivileged;
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface BrowserElementCommon {
|
||||
interface mixin BrowserElementCommon {
|
||||
[Throws,
|
||||
Pref="dom.mozBrowserFramesEnabled",
|
||||
ChromeOnly]
|
||||
@ -39,8 +37,7 @@ interface BrowserElementCommon {
|
||||
void removeNextPaintListener(BrowserElementNextPaintEventCallback listener);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface BrowserElementPrivileged {
|
||||
interface mixin BrowserElementPrivileged {
|
||||
[Throws,
|
||||
Pref="dom.mozBrowserFramesEnabled",
|
||||
ChromeOnly]
|
||||
|
@ -22,4 +22,4 @@ interface CSSPseudoElement {
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/web-animations/#extensions-to-the-pseudoelement-interface
|
||||
CSSPseudoElement implements Animatable;
|
||||
CSSPseudoElement includes Animatable;
|
||||
|
@ -40,21 +40,6 @@ interface CanvasRenderingContext2D {
|
||||
// associated with a canvas.
|
||||
readonly attribute HTMLCanvasElement? canvas;
|
||||
|
||||
// Mozilla-specific stuff
|
||||
// FIXME Bug 768048 mozCurrentTransform/mozCurrentTransformInverse should return a WebIDL array.
|
||||
[Throws]
|
||||
attribute object mozCurrentTransform; // [ m11, m12, m21, m22, dx, dy ], i.e. row major
|
||||
[Throws]
|
||||
attribute object mozCurrentTransformInverse;
|
||||
|
||||
[SetterThrows]
|
||||
attribute DOMString mozTextStyle;
|
||||
|
||||
// image smoothing mode -- if disabled, images won't be smoothed
|
||||
// if scaled.
|
||||
[Deprecated="PrefixedImageSmoothingEnabled"]
|
||||
attribute boolean mozImageSmoothingEnabled;
|
||||
|
||||
// Show the caret if appropriate when drawing
|
||||
[Func="CanvasUtils::HasDrawWindowPrivilege"]
|
||||
const unsigned long DRAWWINDOW_DRAW_CARET = 0x01;
|
||||
@ -122,34 +107,31 @@ interface CanvasRenderingContext2D {
|
||||
void demote();
|
||||
};
|
||||
|
||||
CanvasRenderingContext2D implements CanvasState;
|
||||
CanvasRenderingContext2D implements CanvasTransform;
|
||||
CanvasRenderingContext2D implements CanvasCompositing;
|
||||
CanvasRenderingContext2D implements CanvasImageSmoothing;
|
||||
CanvasRenderingContext2D implements CanvasFillStrokeStyles;
|
||||
CanvasRenderingContext2D implements CanvasShadowStyles;
|
||||
CanvasRenderingContext2D implements CanvasFilters;
|
||||
CanvasRenderingContext2D implements CanvasRect;
|
||||
CanvasRenderingContext2D implements CanvasDrawPath;
|
||||
CanvasRenderingContext2D implements CanvasUserInterface;
|
||||
CanvasRenderingContext2D implements CanvasText;
|
||||
CanvasRenderingContext2D implements CanvasDrawImage;
|
||||
CanvasRenderingContext2D implements CanvasImageData;
|
||||
CanvasRenderingContext2D implements CanvasPathDrawingStyles;
|
||||
CanvasRenderingContext2D implements CanvasTextDrawingStyles;
|
||||
CanvasRenderingContext2D implements CanvasPathMethods;
|
||||
CanvasRenderingContext2D implements CanvasHitRegions;
|
||||
CanvasRenderingContext2D includes CanvasState;
|
||||
CanvasRenderingContext2D includes CanvasTransform;
|
||||
CanvasRenderingContext2D includes CanvasCompositing;
|
||||
CanvasRenderingContext2D includes CanvasImageSmoothing;
|
||||
CanvasRenderingContext2D includes CanvasFillStrokeStyles;
|
||||
CanvasRenderingContext2D includes CanvasShadowStyles;
|
||||
CanvasRenderingContext2D includes CanvasFilters;
|
||||
CanvasRenderingContext2D includes CanvasRect;
|
||||
CanvasRenderingContext2D includes CanvasDrawPath;
|
||||
CanvasRenderingContext2D includes CanvasUserInterface;
|
||||
CanvasRenderingContext2D includes CanvasText;
|
||||
CanvasRenderingContext2D includes CanvasDrawImage;
|
||||
CanvasRenderingContext2D includes CanvasImageData;
|
||||
CanvasRenderingContext2D includes CanvasPathDrawingStyles;
|
||||
CanvasRenderingContext2D includes CanvasTextDrawingStyles;
|
||||
CanvasRenderingContext2D includes CanvasPathMethods;
|
||||
CanvasRenderingContext2D includes CanvasHitRegions;
|
||||
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasState {
|
||||
interface mixin CanvasState {
|
||||
// state
|
||||
void save(); // push state on state stack
|
||||
void restore(); // pop state stack and restore state
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasTransform {
|
||||
interface mixin CanvasTransform {
|
||||
// transformations (default transform is the identity matrix)
|
||||
// NOT IMPLEMENTED attribute SVGMatrix currentTransform;
|
||||
[Throws, LenientFloat]
|
||||
@ -167,20 +149,18 @@ interface CanvasTransform {
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasCompositing {
|
||||
interface mixin CanvasCompositing {
|
||||
attribute unrestricted double globalAlpha; // (default 1.0)
|
||||
[Throws]
|
||||
attribute DOMString globalCompositeOperation; // (default source-over)
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasImageSmoothing {
|
||||
interface mixin CanvasImageSmoothing {
|
||||
// drawing images
|
||||
attribute boolean imageSmoothingEnabled;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasFillStrokeStyles {
|
||||
interface mixin CanvasFillStrokeStyles {
|
||||
// colors and styles (see also the CanvasPathDrawingStyles interface)
|
||||
attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
|
||||
attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
|
||||
@ -192,8 +172,7 @@ interface CanvasFillStrokeStyles {
|
||||
CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasShadowStyles {
|
||||
interface mixin CanvasShadowStyles {
|
||||
[LenientFloat]
|
||||
attribute double shadowOffsetX; // (default 0)
|
||||
[LenientFloat]
|
||||
@ -203,14 +182,12 @@ interface CanvasShadowStyles {
|
||||
attribute DOMString shadowColor; // (default transparent black)
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasFilters {
|
||||
interface mixin CanvasFilters {
|
||||
[Pref="canvas.filters.enabled", SetterThrows]
|
||||
attribute DOMString filter; // (default empty string = no filter)
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasRect {
|
||||
interface mixin CanvasRect {
|
||||
[LenientFloat]
|
||||
void clearRect(double x, double y, double w, double h);
|
||||
[LenientFloat]
|
||||
@ -219,8 +196,7 @@ interface CanvasRect {
|
||||
void strokeRect(double x, double y, double w, double h);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasDrawPath {
|
||||
interface mixin CanvasDrawPath {
|
||||
// path API (see also CanvasPathMethods)
|
||||
void beginPath();
|
||||
void fill(optional CanvasWindingRule winding = "nonzero");
|
||||
@ -240,8 +216,7 @@ interface CanvasDrawPath {
|
||||
boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasUserInterface {
|
||||
interface mixin CanvasUserInterface {
|
||||
[Pref="canvas.focusring.enabled", Throws] void drawFocusIfNeeded(Element element);
|
||||
// NOT IMPLEMENTED void drawSystemFocusRing(Path path, HTMLElement element);
|
||||
[Pref="canvas.customfocusring.enabled"] boolean drawCustomFocusRing(Element element);
|
||||
@ -250,8 +225,7 @@ interface CanvasUserInterface {
|
||||
// NOT IMPLEMENTED void scrollPathIntoView(Path path);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasText {
|
||||
interface mixin CanvasText {
|
||||
// text (see also the CanvasPathDrawingStyles interface)
|
||||
[Throws, LenientFloat]
|
||||
void fillText(DOMString text, double x, double y, optional double maxWidth);
|
||||
@ -261,8 +235,7 @@ interface CanvasText {
|
||||
TextMetrics measureText(DOMString text);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasDrawImage {
|
||||
interface mixin CanvasDrawImage {
|
||||
[Throws, LenientFloat]
|
||||
void drawImage(CanvasImageSource image, double dx, double dy);
|
||||
[Throws, LenientFloat]
|
||||
@ -271,8 +244,7 @@ interface CanvasDrawImage {
|
||||
void drawImage(CanvasImageSource image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasImageData {
|
||||
interface mixin CanvasImageData {
|
||||
// pixel manipulation
|
||||
[NewObject, Throws]
|
||||
ImageData createImageData(double sw, double sh);
|
||||
@ -286,8 +258,7 @@ interface CanvasImageData {
|
||||
void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasPathDrawingStyles {
|
||||
interface mixin CanvasPathDrawingStyles {
|
||||
// line caps/joins
|
||||
[LenientFloat]
|
||||
attribute double lineWidth; // (default 1)
|
||||
@ -303,8 +274,7 @@ interface CanvasPathDrawingStyles {
|
||||
[LenientFloat] attribute double lineDashOffset;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasTextDrawingStyles {
|
||||
interface mixin CanvasTextDrawingStyles {
|
||||
// text
|
||||
[SetterThrows]
|
||||
attribute DOMString font; // (default 10px sans-serif)
|
||||
@ -312,8 +282,7 @@ interface CanvasTextDrawingStyles {
|
||||
attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasPathMethods {
|
||||
interface mixin CanvasPathMethods {
|
||||
// shared path API methods
|
||||
void closePath();
|
||||
[LenientFloat]
|
||||
@ -340,8 +309,7 @@ interface CanvasPathMethods {
|
||||
void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, optional boolean anticlockwise = false);
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface CanvasHitRegions {
|
||||
interface mixin CanvasHitRegions {
|
||||
// hit regions
|
||||
[Pref="canvas.hitregions.enabled", Throws] void addHitRegion(optional HitRegionOptions options);
|
||||
[Pref="canvas.hitregions.enabled"] void removeHitRegion(DOMString id);
|
||||
@ -397,4 +365,4 @@ interface Path2D
|
||||
{
|
||||
void addPath(Path2D path, optional SVGMatrix transformation);
|
||||
};
|
||||
Path2D implements CanvasPathMethods;
|
||||
Path2D includes CanvasPathMethods;
|
||||
|
@ -27,5 +27,5 @@ interface CharacterData : Node {
|
||||
void replaceData(unsigned long offset, unsigned long count, DOMString data);
|
||||
};
|
||||
|
||||
CharacterData implements ChildNode;
|
||||
CharacterData implements NonDocumentTypeChildNode;
|
||||
CharacterData includes ChildNode;
|
||||
CharacterData includes NonDocumentTypeChildNode;
|
||||
|
@ -7,8 +7,7 @@
|
||||
* http://dom.spec.whatwg.org/#interface-childnode
|
||||
*/
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface ChildNode {
|
||||
interface mixin ChildNode {
|
||||
[CEReactions, Throws, Unscopable]
|
||||
void before((Node or DOMString)... nodes);
|
||||
[CEReactions, Throws, Unscopable]
|
||||
@ -19,8 +18,7 @@ interface ChildNode {
|
||||
void remove();
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface NonDocumentTypeChildNode {
|
||||
interface mixin NonDocumentTypeChildNode {
|
||||
[Pure]
|
||||
readonly attribute Element? previousElementSibling;
|
||||
[Pure]
|
||||
|
@ -1,13 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
[Constructor, Func="IsChromeOrXBL"]
|
||||
interface ChromeNodeList : NodeList {
|
||||
[Throws]
|
||||
void append(Node aNode);
|
||||
[Throws]
|
||||
void remove(Node aNode);
|
||||
};
|
@ -1,10 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
[Func="IsChromeOrXBL"]
|
||||
interface CommandEvent : Event {
|
||||
readonly attribute DOMString? command;
|
||||
};
|
@ -24,7 +24,3 @@ interface ConvolverNode : AudioNode {
|
||||
attribute boolean normalize;
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
ConvolverNode implements AudioNodePassThrough;
|
||||
|
||||
|
4
crates/web-sys/webidls/enabled/Crypto.webidl
vendored
4
crates/web-sys/webidls/enabled/Crypto.webidl
vendored
@ -7,8 +7,8 @@
|
||||
* https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#crypto-interface
|
||||
*/
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface GlobalCrypto {
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin GlobalCrypto {
|
||||
[Throws] readonly attribute Crypto crypto;
|
||||
};
|
||||
|
||||
|
@ -16,9 +16,8 @@
|
||||
// invalid widl
|
||||
//interface StackFrame;
|
||||
|
||||
[NoInterfaceObject,
|
||||
Exposed=(Window,Worker,System)]
|
||||
interface ExceptionMembers
|
||||
[Exposed=(Window,Worker,System)]
|
||||
interface mixin ExceptionMembers
|
||||
{
|
||||
// The nsresult associated with this exception.
|
||||
readonly attribute unsigned long result;
|
||||
@ -62,7 +61,7 @@ interface Exception {
|
||||
stringifier;
|
||||
};
|
||||
|
||||
Exception implements ExceptionMembers;
|
||||
Exception includes ExceptionMembers;
|
||||
|
||||
// XXXkhuey this is an 'exception', not an interface, but we don't have any
|
||||
// parser or codegen mechanisms for dealing with exceptions.
|
||||
@ -105,4 +104,4 @@ interface DOMException {
|
||||
|
||||
// XXXkhuey copy all of Gecko's non-standard stuff onto DOMException, but leave
|
||||
// the prototype chain sane.
|
||||
DOMException implements ExceptionMembers;
|
||||
DOMException includes ExceptionMembers;
|
||||
|
10
crates/web-sys/webidls/enabled/DOMParser.webidl
vendored
10
crates/web-sys/webidls/enabled/DOMParser.webidl
vendored
@ -19,23 +19,13 @@ enum SupportedType {
|
||||
"image/svg+xml"
|
||||
};
|
||||
|
||||
// the latter is Mozilla-specific
|
||||
[Constructor]
|
||||
interface DOMParser {
|
||||
[NewObject, Throws]
|
||||
Document parseFromString(DOMString str, SupportedType type);
|
||||
|
||||
// Mozilla-specific stuff
|
||||
[NewObject, Throws, ChromeOnly]
|
||||
Document parseFromBuffer(sequence<octet> buf, SupportedType type);
|
||||
[NewObject, Throws, ChromeOnly]
|
||||
Document parseFromBuffer(Uint8Array buf, SupportedType type);
|
||||
[NewObject, Throws, ChromeOnly]
|
||||
Document parseFromStream(InputStream stream, DOMString? charset,
|
||||
long contentLength, SupportedType type);
|
||||
// Can be used to allow a DOMParser to parse XUL/XBL no matter what
|
||||
// principal it's using for the document.
|
||||
[ChromeOnly]
|
||||
void forceEnableXULXBL();
|
||||
};
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
enum DOMRequestReadyState { "pending", "done" };
|
||||
|
||||
[Exposed=(Window,Worker,System), NoInterfaceObject]
|
||||
interface DOMRequestShared {
|
||||
[Exposed=(Window,Worker,System)]
|
||||
interface mixin DOMRequestShared {
|
||||
readonly attribute DOMRequestReadyState readyState;
|
||||
|
||||
readonly attribute any result;
|
||||
@ -29,4 +29,4 @@ interface DOMRequest : EventTarget {
|
||||
void fireDetailedError(DOMException aError);
|
||||
};
|
||||
|
||||
DOMRequest implements DOMRequestShared;
|
||||
DOMRequest includes DOMRequestShared;
|
||||
|
139
crates/web-sys/webidls/enabled/DataTransfer.webidl
vendored
139
crates/web-sys/webidls/enabled/DataTransfer.webidl
vendored
@ -37,142 +37,3 @@ partial interface DataTransfer {
|
||||
[Throws, Pref="dom.input.dirpicker", NeedsSubjectPrincipal]
|
||||
Promise<sequence<File>> getFiles(optional boolean recursiveFlag = false);
|
||||
};
|
||||
|
||||
// Mozilla specific stuff
|
||||
partial interface DataTransfer {
|
||||
/*
|
||||
* Set the drag source. Usually you would not change this, but it will
|
||||
* affect which node the drag and dragend events are fired at. The
|
||||
* default target is the node that was dragged.
|
||||
*
|
||||
* @param element drag source to use
|
||||
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
|
||||
*/
|
||||
[Throws, UseCounter]
|
||||
void addElement(Element element);
|
||||
|
||||
/**
|
||||
* The number of items being dragged.
|
||||
*/
|
||||
[UseCounter]
|
||||
readonly attribute unsigned long mozItemCount;
|
||||
|
||||
/**
|
||||
* Sets the drag cursor state. Primarily used to control the cursor during
|
||||
* tab drags, but could be expanded to other uses. XXX Currently implemented
|
||||
* on Win32 only.
|
||||
*
|
||||
* Possible values:
|
||||
* auto - use default system behavior.
|
||||
* default - set the cursor to an arrow during the drag operation.
|
||||
*
|
||||
* Values other than 'default' are indentical to setting mozCursor to
|
||||
* 'auto'.
|
||||
*/
|
||||
[UseCounter]
|
||||
attribute DOMString mozCursor;
|
||||
|
||||
/**
|
||||
* Holds a list of the format types of the data that is stored for an item
|
||||
* at the specified index. If the index is not in the range from 0 to
|
||||
* itemCount - 1, an empty string list is returned.
|
||||
*/
|
||||
[Throws, NeedsCallerType, UseCounter]
|
||||
DOMStringList mozTypesAt(unsigned long index);
|
||||
|
||||
/**
|
||||
* Remove the data associated with the given format for an item at the
|
||||
* specified index. The index is in the range from zero to itemCount - 1.
|
||||
*
|
||||
* If the last format for the item is removed, the entire item is removed,
|
||||
* reducing the itemCount by one.
|
||||
*
|
||||
* If format is empty, then the data associated with all formats is removed.
|
||||
* If the format is not found, then this method has no effect.
|
||||
*
|
||||
* @param format the format to remove
|
||||
* @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater or equal than itemCount
|
||||
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
|
||||
*/
|
||||
[Throws, NeedsSubjectPrincipal, UseCounter]
|
||||
void mozClearDataAt(DOMString format, unsigned long index);
|
||||
|
||||
/*
|
||||
* A data transfer may store multiple items, each at a given zero-based
|
||||
* index. setDataAt may only be called with an index argument less than
|
||||
* itemCount in which case an existing item is modified, or equal to
|
||||
* itemCount in which case a new item is added, and the itemCount is
|
||||
* incremented by one.
|
||||
*
|
||||
* Data should be added in order of preference, with the most specific
|
||||
* format added first and the least specific format added last. If data of
|
||||
* the given format already exists, it is replaced in the same position as
|
||||
* the old data.
|
||||
*
|
||||
* The data should be either a string, a primitive boolean or number type
|
||||
* (which will be converted into a string) or an nsISupports.
|
||||
*
|
||||
* @param format the format to add
|
||||
* @param data the data to add
|
||||
* @throws NS_ERROR_NULL_POINTER if the data is null
|
||||
* @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater than itemCount
|
||||
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
|
||||
*/
|
||||
[Throws, NeedsSubjectPrincipal, UseCounter]
|
||||
void mozSetDataAt(DOMString format, any data, unsigned long index);
|
||||
|
||||
/**
|
||||
* Retrieve the data associated with the given format for an item at the
|
||||
* specified index, or null if it does not exist. The index should be in the
|
||||
* range from zero to itemCount - 1.
|
||||
*
|
||||
* @param format the format of the data to look up
|
||||
* @returns the data of the given format, or null if it doesn't exist.
|
||||
* @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater or equal than itemCount
|
||||
*/
|
||||
[Throws, NeedsSubjectPrincipal, UseCounter]
|
||||
any mozGetDataAt(DOMString format, unsigned long index);
|
||||
|
||||
/**
|
||||
* Update the drag image. Arguments are the same as setDragImage. This is only
|
||||
* valid within the parent chrome process.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
void updateDragImage(Element image, long x, long y);
|
||||
|
||||
/**
|
||||
* Will be true when the user has cancelled the drag (typically by pressing
|
||||
* Escape) and when the drag has been cancelled unexpectedly. This will be
|
||||
* false otherwise, including when the drop has been rejected by its target.
|
||||
* This property is only relevant for the dragend event.
|
||||
*/
|
||||
[UseCounter]
|
||||
readonly attribute boolean mozUserCancelled;
|
||||
|
||||
/**
|
||||
* The node that the mouse was pressed over to begin the drag. For external
|
||||
* drags, or if the caller cannot access this node, this will be null.
|
||||
*/
|
||||
[UseCounter]
|
||||
readonly attribute Node? mozSourceNode;
|
||||
|
||||
/**
|
||||
* The URI spec of the triggering principal. This may be different than
|
||||
* sourceNode's principal when sourceNode is xul:browser and the drag is
|
||||
* triggered in a browsing context inside it.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
readonly attribute DOMString mozTriggeringPrincipalURISpec;
|
||||
|
||||
/**
|
||||
* Copy the given DataTransfer for the given event. Used by testing code for
|
||||
* creating emulated Drag and Drop events in the UI.
|
||||
*
|
||||
* NOTE: Don't expose a DataTransfer produced with this method to the web or
|
||||
* use this for non-testing purposes. It can easily be used to get the
|
||||
* DataTransfer into an invalid state, and is an unstable implementation
|
||||
* detail of EventUtils.synthesizeDrag.
|
||||
*/
|
||||
[Throws, ChromeOnly]
|
||||
DataTransfer mozCloneForEvent(DOMString event);
|
||||
};
|
||||
|
@ -22,7 +22,3 @@ interface DelayNode : AudioNode {
|
||||
readonly attribute AudioParam delayTime;
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
DelayNode implements AudioNodePassThrough;
|
||||
|
||||
|
@ -44,14 +44,3 @@ dictionary DeviceMotionEventInit : EventInit {
|
||||
DeviceRotationRateInit rotationRate;
|
||||
double? interval = null;
|
||||
};
|
||||
|
||||
// Mozilla extensions.
|
||||
partial interface DeviceMotionEvent {
|
||||
void initDeviceMotionEvent(DOMString type,
|
||||
optional boolean canBubble = false,
|
||||
optional boolean cancelable = false,
|
||||
optional DeviceAccelerationInit acceleration,
|
||||
optional DeviceAccelerationInit accelerationIncludingGravity,
|
||||
optional DeviceRotationRateInit rotationRate,
|
||||
optional double? interval = null);
|
||||
};
|
||||
|
114
crates/web-sys/webidls/enabled/Document.webidl
vendored
114
crates/web-sys/webidls/enabled/Document.webidl
vendored
@ -185,13 +185,6 @@ partial interface Document {
|
||||
[Pref="dom.select_events.enabled"]
|
||||
attribute EventHandler onselectionchange;
|
||||
|
||||
/**
|
||||
* True if this document is synthetic : stand alone image, video, audio file,
|
||||
* etc.
|
||||
*/
|
||||
/*Non standard
|
||||
[Func="IsChromeOrXBL"] readonly attribute boolean mozSyntheticDocument;
|
||||
*/
|
||||
/**
|
||||
* Returns the script element whose script is currently being processed.
|
||||
*
|
||||
@ -361,85 +354,6 @@ partial interface Document {
|
||||
readonly attribute SVGSVGElement? rootElement;
|
||||
};
|
||||
|
||||
// Mozilla extensions of various sorts
|
||||
partial interface Document {
|
||||
// XBL support. Wish we could make these [ChromeOnly], but
|
||||
// that would likely break bindings running with the page principal.
|
||||
/*Non standard
|
||||
[Func="IsChromeOrXBL"]
|
||||
NodeList? getAnonymousNodes(Element elt);
|
||||
[Func="IsChromeOrXBL"]
|
||||
Element? getAnonymousElementByAttribute(Element elt, DOMString attrName,
|
||||
DOMString attrValue);
|
||||
[Func="IsChromeOrXBL"]
|
||||
Element? getBindingParent(Node node);
|
||||
[Throws, Func="IsChromeOrXBL", NeedsSubjectPrincipal]
|
||||
void loadBindingDocument(DOMString documentURL);
|
||||
*/
|
||||
|
||||
// Touch bits
|
||||
// XXXbz I can't find the sane spec for this stuff, so just cribbing
|
||||
// from our xpidl for now.
|
||||
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
|
||||
Touch createTouch(optional Window? view = null,
|
||||
optional EventTarget? target = null,
|
||||
optional long identifier = 0,
|
||||
optional long pageX = 0,
|
||||
optional long pageY = 0,
|
||||
optional long screenX = 0,
|
||||
optional long screenY = 0,
|
||||
optional long clientX = 0,
|
||||
optional long clientY = 0,
|
||||
optional long radiusX = 0,
|
||||
optional long radiusY = 0,
|
||||
optional float rotationAngle = 0,
|
||||
optional float force = 0);
|
||||
// XXXbz a hack to get around the fact that we don't support variadics as
|
||||
// distinguishing arguments yet. Once this hack is removed. we can also
|
||||
// remove the corresponding overload on nsIDocument, since Touch... and
|
||||
// sequence<Touch> look the same in the C++.
|
||||
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
|
||||
TouchList createTouchList(Touch touch, Touch... touches);
|
||||
// XXXbz and another hack for the fact that we can't usefully have optional
|
||||
// distinguishing arguments but need a working zero-arg form of
|
||||
// createTouchList().
|
||||
/*TODO
|
||||
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
|
||||
TouchList createTouchList();
|
||||
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
|
||||
TouchList createTouchList(sequence<Touch> touches);
|
||||
*/
|
||||
|
||||
[ChromeOnly]
|
||||
attribute boolean styleSheetChangeEventsEnabled;
|
||||
|
||||
[ChromeOnly, Throws]
|
||||
void obsoleteSheet(URI sheetURI);
|
||||
[ChromeOnly, Throws]
|
||||
void obsoleteSheet(DOMString sheetURI);
|
||||
|
||||
[ChromeOnly] readonly attribute nsIDocShell? docShell;
|
||||
|
||||
[ChromeOnly] readonly attribute DOMString contentLanguage;
|
||||
|
||||
[ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;
|
||||
|
||||
// Blocks the initial document parser until the given promise is settled.
|
||||
[ChromeOnly, Throws]
|
||||
Promise<any> blockParsing(Promise<any> promise,
|
||||
optional BlockParsingOptions options);
|
||||
|
||||
// like documentURI, except that for error pages, it returns the URI we were
|
||||
// trying to load when we hit an error, rather than the error page's own URI.
|
||||
[ChromeOnly] readonly attribute URI? mozDocumentURIIfNotForErrorPages;
|
||||
|
||||
// A promise that is resolved, with this document itself, when we have both
|
||||
// fired DOMContentLoaded and are ready to start layout. This is used for the
|
||||
// "document_idle" webextension script injection point.
|
||||
[ChromeOnly, Throws]
|
||||
readonly attribute Promise<Document> documentReadyForIdle;
|
||||
};
|
||||
|
||||
dictionary BlockParsingOptions {
|
||||
/**
|
||||
* If true, blocks script-created parsers (created via document.open()) in
|
||||
@ -507,16 +421,6 @@ partial interface Document {
|
||||
void notifyUserGestureActivation();
|
||||
};
|
||||
|
||||
// Extension to give chrome and XBL JS the ability to determine whether
|
||||
// the document is sandboxed without permission to run scripts
|
||||
// and whether inline scripts are blocked by the document's CSP.
|
||||
/*Non standard
|
||||
partial interface Document {
|
||||
[Func="IsChromeOrXBL"] readonly attribute boolean hasScriptsBlockedBySandbox;
|
||||
[Func="IsChromeOrXBL"] readonly attribute boolean inlineScriptAllowedByCSP;
|
||||
};
|
||||
*/
|
||||
|
||||
// For more information on Flash classification, see
|
||||
// toolkit/components/url-classifier/flash-block-lists.rst
|
||||
enum FlashClassification {
|
||||
@ -531,12 +435,12 @@ partial interface Document {
|
||||
readonly attribute FlashClassification documentFlashClassification;
|
||||
};
|
||||
|
||||
Document implements XPathEvaluator;
|
||||
Document implements GlobalEventHandlers;
|
||||
Document implements DocumentAndElementEventHandlers;
|
||||
Document implements TouchEventHandlers;
|
||||
Document implements ParentNode;
|
||||
Document implements OnErrorEventHandlerForNodes;
|
||||
Document implements GeometryUtils;
|
||||
Document implements FontFaceSource;
|
||||
Document implements DocumentOrShadowRoot;
|
||||
Document includes XPathEvaluator;
|
||||
Document includes GlobalEventHandlers;
|
||||
Document includes DocumentAndElementEventHandlers;
|
||||
Document includes TouchEventHandlers;
|
||||
Document includes ParentNode;
|
||||
Document includes OnErrorEventHandlerForNodes;
|
||||
Document includes GeometryUtils;
|
||||
Document includes FontFaceSource;
|
||||
Document includes DocumentOrShadowRoot;
|
||||
|
@ -24,4 +24,4 @@ partial interface DocumentFragment {
|
||||
NodeList querySelectorAll(DOMString selectors);
|
||||
};
|
||||
|
||||
DocumentFragment implements ParentNode;
|
||||
DocumentFragment includes ParentNode;
|
||||
|
@ -8,8 +8,7 @@
|
||||
* http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
|
||||
*/
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface DocumentOrShadowRoot {
|
||||
interface mixin DocumentOrShadowRoot {
|
||||
// Not implemented yet: bug 1430308.
|
||||
// Selection? getSelection();
|
||||
Element? elementFromPoint (float x, float y);
|
||||
|
@ -16,4 +16,4 @@ interface DocumentType : Node {
|
||||
readonly attribute DOMString systemId;
|
||||
};
|
||||
|
||||
DocumentType implements ChildNode;
|
||||
DocumentType includes ChildNode;
|
||||
|
@ -30,7 +30,3 @@ interface DynamicsCompressorNode : AudioNode {
|
||||
readonly attribute AudioParam release; // in Seconds
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
DynamicsCompressorNode implements AudioNodePassThrough;
|
||||
|
||||
|
21
crates/web-sys/webidls/enabled/Element.webidl
vendored
21
crates/web-sys/webidls/enabled/Element.webidl
vendored
@ -143,8 +143,6 @@ interface Element : Node {
|
||||
[ChromeOnly]
|
||||
void setCaptureAlways(optional boolean retargetToElement = false);
|
||||
|
||||
// Mozilla extensions
|
||||
|
||||
// Obsolete methods.
|
||||
Attr? getAttributeNode(DOMString name);
|
||||
[CEReactions, Throws]
|
||||
@ -225,15 +223,6 @@ partial interface Element {
|
||||
readonly attribute long clientLeft;
|
||||
readonly attribute long clientWidth;
|
||||
readonly attribute long clientHeight;
|
||||
|
||||
// Mozilla specific stuff
|
||||
/* The minimum/maximum offset that the element can be scrolled to
|
||||
(i.e., the value that scrollLeft/scrollTop would be clamped to if they were
|
||||
set to arbitrarily large values. */
|
||||
[ChromeOnly] readonly attribute long scrollTopMin;
|
||||
readonly attribute long scrollTopMax;
|
||||
[ChromeOnly] readonly attribute long scrollLeftMin;
|
||||
readonly attribute long scrollLeftMax;
|
||||
};
|
||||
|
||||
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
|
||||
@ -276,11 +265,11 @@ partial interface Element {
|
||||
attribute DOMString slot;
|
||||
};
|
||||
|
||||
Element implements ChildNode;
|
||||
Element implements NonDocumentTypeChildNode;
|
||||
Element implements ParentNode;
|
||||
Element implements Animatable;
|
||||
Element implements GeometryUtils;
|
||||
Element includes ChildNode;
|
||||
Element includes NonDocumentTypeChildNode;
|
||||
Element includes ParentNode;
|
||||
Element includes Animatable;
|
||||
Element includes GeometryUtils;
|
||||
|
||||
// https://fullscreen.spec.whatwg.org/#api
|
||||
partial interface Element {
|
||||
|
25
crates/web-sys/webidls/enabled/Event.webidl
vendored
25
crates/web-sys/webidls/enabled/Event.webidl
vendored
@ -58,31 +58,6 @@ interface Event {
|
||||
attribute boolean cancelBubble;
|
||||
};
|
||||
|
||||
// Mozilla specific legacy stuff.
|
||||
partial interface Event {
|
||||
const long ALT_MASK = 0x00000001;
|
||||
const long CONTROL_MASK = 0x00000002;
|
||||
const long SHIFT_MASK = 0x00000004;
|
||||
const long META_MASK = 0x00000008;
|
||||
|
||||
/** The original target of the event, before any retargetings. */
|
||||
readonly attribute EventTarget? originalTarget;
|
||||
/**
|
||||
* The explicit original target of the event. If the event was retargeted
|
||||
* for some reason other than an anonymous boundary crossing, this will be set
|
||||
* to the target before the retargeting occurs. For example, mouse events
|
||||
* are retargeted to their parent node when they happen over text nodes (bug
|
||||
* 185889), and in that case .target will show the parent and
|
||||
* .explicitOriginalTarget will show the text node.
|
||||
* .explicitOriginalTarget differs from .originalTarget in that it will never
|
||||
* contain anonymous content.
|
||||
*/
|
||||
readonly attribute EventTarget? explicitOriginalTarget;
|
||||
[ChromeOnly] readonly attribute EventTarget? composedTarget;
|
||||
[ChromeOnly] readonly attribute boolean multipleActionsPrevented;
|
||||
[ChromeOnly] readonly attribute boolean isSynthesized;
|
||||
};
|
||||
|
||||
dictionary EventInit {
|
||||
boolean bubbles = false;
|
||||
boolean cancelable = false;
|
||||
|
@ -22,8 +22,7 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
|
||||
callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error);
|
||||
typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface GlobalEventHandlers {
|
||||
interface mixin GlobalEventHandlers {
|
||||
attribute EventHandler onabort;
|
||||
attribute EventHandler onblur;
|
||||
// We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window
|
||||
@ -116,11 +115,6 @@ interface GlobalEventHandlers {
|
||||
[Pref="dom.w3c_pointer_events.enabled"]
|
||||
attribute EventHandler onlostpointercapture;
|
||||
|
||||
// Mozilla-specific handlers. Unprefixed handlers live in
|
||||
// Document rather than here.
|
||||
attribute EventHandler onmozfullscreenchange;
|
||||
attribute EventHandler onmozfullscreenerror;
|
||||
|
||||
// CSS-Animation and CSS-Transition handlers.
|
||||
attribute EventHandler onanimationcancel;
|
||||
attribute EventHandler onanimationend;
|
||||
@ -139,8 +133,7 @@ interface GlobalEventHandlers {
|
||||
attribute EventHandler onwebkittransitionend;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface WindowEventHandlers {
|
||||
interface mixin WindowEventHandlers {
|
||||
attribute EventHandler onafterprint;
|
||||
attribute EventHandler onbeforeprint;
|
||||
attribute OnBeforeUnloadEventHandler onbeforeunload;
|
||||
@ -157,8 +150,7 @@ interface WindowEventHandlers {
|
||||
attribute EventHandler onunload;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface DocumentAndElementEventHandlers {
|
||||
interface mixin DocumentAndElementEventHandlers {
|
||||
attribute EventHandler oncopy;
|
||||
attribute EventHandler oncut;
|
||||
attribute EventHandler onpaste;
|
||||
@ -169,12 +161,10 @@ interface DocumentAndElementEventHandlers {
|
||||
// whether an ErrorEvent was fired. We don't do that, and until we do we'll
|
||||
// need to distinguish between onerror on Window or on nodes.
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface OnErrorEventHandlerForNodes {
|
||||
interface mixin OnErrorEventHandlerForNodes {
|
||||
attribute EventHandler onerror;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface OnErrorEventHandlerForWindow {
|
||||
interface mixin OnErrorEventHandlerForWindow {
|
||||
attribute OnErrorEventHandler onerror;
|
||||
};
|
||||
|
@ -13,11 +13,6 @@
|
||||
|
||||
dictionary EventListenerOptions {
|
||||
boolean capture = false;
|
||||
/* Setting to true make the listener be added to the system group. */
|
||||
/*Non standard
|
||||
[Func="ThreadSafeIsChromeOrXBL"]
|
||||
boolean mozSystemGroup = false;
|
||||
*/
|
||||
};
|
||||
|
||||
dictionary AddEventListenerOptions : EventListenerOptions {
|
||||
@ -44,27 +39,3 @@ interface EventTarget {
|
||||
[Throws, NeedsCallerType]
|
||||
boolean dispatchEvent(Event event);
|
||||
};
|
||||
|
||||
// Mozilla extensions for use by JS-implemented event targets to
|
||||
// implement on* properties.
|
||||
partial interface EventTarget {
|
||||
// The use of [TreatNonCallableAsNull] here is a bit of a hack: it just makes
|
||||
// the codegen check whether the type involved is either
|
||||
// [TreatNonCallableAsNull] or [TreatNonObjectAsNull] and if it is handle it
|
||||
// accordingly. In particular, it will NOT actually treat a non-null
|
||||
// non-callable object as null here.
|
||||
[ChromeOnly, Throws]
|
||||
void setEventHandler(DOMString type,
|
||||
[TreatNonCallableAsNull] EventHandler handler);
|
||||
|
||||
[ChromeOnly]
|
||||
EventHandler getEventHandler(DOMString type);
|
||||
};
|
||||
|
||||
// Mozilla extension to make firing events on event targets from
|
||||
// chrome easier. This returns the window which can be used to create
|
||||
// events to fire at this EventTarget, or null if there isn't one.
|
||||
partial interface EventTarget {
|
||||
[ChromeOnly, Exposed=(Window,System), BinaryName="ownerGlobalForBindings"]
|
||||
readonly attribute WindowProxy? ownerGlobal;
|
||||
};
|
||||
|
4
crates/web-sys/webidls/enabled/Fetch.webidl
vendored
4
crates/web-sys/webidls/enabled/Fetch.webidl
vendored
@ -10,8 +10,8 @@
|
||||
typedef object JSON;
|
||||
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface Body {
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin Body {
|
||||
readonly attribute boolean bodyUsed;
|
||||
[Throws]
|
||||
Promise<ArrayBuffer> arrayBuffer();
|
||||
|
25
crates/web-sys/webidls/enabled/File.webidl
vendored
25
crates/web-sys/webidls/enabled/File.webidl
vendored
@ -29,28 +29,3 @@ dictionary ChromeFilePropertyBag : FilePropertyBag {
|
||||
DOMString name = "";
|
||||
boolean existenceCheck = true;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
partial interface File {
|
||||
[BinaryName="relativePath", Func="mozilla::dom::DOMPrefs::WebkitBlinkDirectoryPickerEnabled"]
|
||||
readonly attribute USVString webkitRelativePath;
|
||||
|
||||
[GetterThrows, ChromeOnly, NeedsCallerType]
|
||||
readonly attribute DOMString mozFullPath;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
// These 2 methods can be used only in these conditions:
|
||||
// - the main-thread
|
||||
// - parent process OR file process OR, only for testing, with pref
|
||||
// `dom.file.createInChild' set to true.
|
||||
[Exposed=(Window)]
|
||||
partial interface File {
|
||||
[ChromeOnly, Throws, NeedsCallerType]
|
||||
static Promise<File> createFromNsIFile(nsIFile file,
|
||||
optional ChromeFilePropertyBag options);
|
||||
|
||||
[ChromeOnly, Throws, NeedsCallerType]
|
||||
static Promise<File> createFromFileName(USVString fileName,
|
||||
optional ChromeFilePropertyBag options);
|
||||
};
|
||||
|
@ -10,9 +10,7 @@
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface FontFaceSource {
|
||||
|
||||
interface mixin FontFaceSource {
|
||||
[Pref="layout.css.font-loading-api.enabled"]
|
||||
readonly attribute FontFaceSet fonts;
|
||||
};
|
||||
|
@ -209,12 +209,11 @@ interface FrameLoader {
|
||||
* The nsIWebBrowserPersistDocumentReceiver is a callback that
|
||||
* will be fired once the document is ready for persisting.
|
||||
*/
|
||||
[NoInterfaceObject]
|
||||
interface WebBrowserPersistable
|
||||
interface mixin WebBrowserPersistable
|
||||
{
|
||||
[Throws]
|
||||
void startPersistence(unsigned long long aOuterWindowID,
|
||||
nsIWebBrowserPersistDocumentReceiver aRecv);
|
||||
};
|
||||
|
||||
FrameLoader implements WebBrowserPersistable;
|
||||
FrameLoader includes WebBrowserPersistable;
|
||||
|
@ -21,7 +21,3 @@ interface GainNode : AudioNode {
|
||||
readonly attribute AudioParam gain;
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
GainNode implements AudioNodePassThrough;
|
||||
|
||||
|
@ -21,8 +21,7 @@ dictionary ConvertCoordinateOptions {
|
||||
CSSBoxType toBox = "border";
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface GeometryUtils {
|
||||
interface mixin GeometryUtils {
|
||||
[Throws, Func="nsINode::HasBoxQuadsSupport", NeedsCallerType]
|
||||
sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options);
|
||||
[Throws, Pref="layout.css.convertFromNode.enabled", NeedsCallerType]
|
||||
@ -33,6 +32,6 @@ interface GeometryUtils {
|
||||
DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options);
|
||||
};
|
||||
|
||||
// PseudoElement implements GeometryUtils;
|
||||
// PseudoElement includes GeometryUtils;
|
||||
|
||||
typedef (Text or Element /* or PseudoElement */ or Document) GeometryNode;
|
||||
|
@ -35,7 +35,7 @@ interface HTMLAnchorElement : HTMLElement {
|
||||
attribute DOMString text;
|
||||
};
|
||||
|
||||
HTMLAnchorElement implements HTMLHyperlinkElementUtils;
|
||||
HTMLAnchorElement includes HTMLHyperlinkElementUtils;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLAnchorElement {
|
||||
|
@ -35,7 +35,7 @@ interface HTMLAreaElement : HTMLElement {
|
||||
readonly attribute DOMTokenList relList;
|
||||
};
|
||||
|
||||
HTMLAreaElement implements HTMLHyperlinkElementUtils;
|
||||
HTMLAreaElement includes HTMLHyperlinkElementUtils;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLAreaElement {
|
||||
|
@ -30,4 +30,4 @@ partial interface HTMLBodyElement {
|
||||
attribute DOMString background;
|
||||
};
|
||||
|
||||
HTMLBodyElement implements WindowEventHandlers;
|
||||
HTMLBodyElement includes WindowEventHandlers;
|
||||
|
@ -33,23 +33,6 @@ interface HTMLCanvasElement : HTMLElement {
|
||||
optional any encoderOptions);
|
||||
};
|
||||
|
||||
// Mozilla specific bits
|
||||
partial interface HTMLCanvasElement {
|
||||
[Pure, SetterThrows]
|
||||
attribute boolean mozOpaque;
|
||||
[Throws, NeedsSubjectPrincipal]
|
||||
File mozGetAsFile(DOMString name, optional DOMString? type = null);
|
||||
// A Mozilla-only extension to get a canvas context backed by double-buffered
|
||||
// shared memory. Only privileged callers can call this.
|
||||
[ChromeOnly, Throws]
|
||||
nsISupports? MozGetIPCContext(DOMString contextId);
|
||||
|
||||
attribute PrintCallback? mozPrintCallback;
|
||||
|
||||
[Throws, Pref="canvas.capturestream.enabled", NeedsSubjectPrincipal]
|
||||
CanvasCaptureMediaStream captureStream(optional double frameRate);
|
||||
};
|
||||
|
||||
// For OffscreenCanvas
|
||||
// Reference: https://wiki.whatwg.org/wiki/OffscreenCanvas
|
||||
partial interface HTMLCanvasElement {
|
||||
|
@ -80,8 +80,7 @@ partial interface HTMLElement {
|
||||
readonly attribute long offsetHeight;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface TouchEventHandlers {
|
||||
interface mixin TouchEventHandlers {
|
||||
[Func="nsGenericHTMLElement::TouchEventsEnabled"]
|
||||
attribute EventHandler ontouchstart;
|
||||
[Func="nsGenericHTMLElement::TouchEventsEnabled"]
|
||||
@ -92,9 +91,9 @@ interface TouchEventHandlers {
|
||||
attribute EventHandler ontouchcancel;
|
||||
};
|
||||
|
||||
HTMLElement implements GlobalEventHandlers;
|
||||
HTMLElement implements DocumentAndElementEventHandlers;
|
||||
HTMLElement implements TouchEventHandlers;
|
||||
HTMLElement implements OnErrorEventHandlerForNodes;
|
||||
HTMLElement includes GlobalEventHandlers;
|
||||
HTMLElement includes DocumentAndElementEventHandlers;
|
||||
HTMLElement includes TouchEventHandlers;
|
||||
HTMLElement includes OnErrorEventHandlerForNodes;
|
||||
|
||||
interface HTMLUnknownElement : HTMLElement {};
|
||||
|
@ -39,6 +39,6 @@ partial interface HTMLEmbedElement {
|
||||
Document? getSVGDocument();
|
||||
};
|
||||
|
||||
HTMLEmbedElement implements MozImageLoadingContent;
|
||||
HTMLEmbedElement implements MozFrameLoaderOwner;
|
||||
HTMLEmbedElement implements MozObjectLoadingContent;
|
||||
HTMLEmbedElement includes MozImageLoadingContent;
|
||||
HTMLEmbedElement includes MozFrameLoaderOwner;
|
||||
HTMLEmbedElement includes MozObjectLoadingContent;
|
||||
|
@ -35,4 +35,4 @@ interface HTMLFrameElement : HTMLElement {
|
||||
attribute DOMString marginWidth;
|
||||
};
|
||||
|
||||
HTMLFrameElement implements MozFrameLoaderOwner;
|
||||
HTMLFrameElement includes MozFrameLoaderOwner;
|
||||
|
@ -19,4 +19,4 @@ interface HTMLFrameSetElement : HTMLElement {
|
||||
attribute DOMString rows;
|
||||
};
|
||||
|
||||
HTMLFrameSetElement implements WindowEventHandlers;
|
||||
HTMLFrameSetElement includes WindowEventHandlers;
|
||||
|
@ -65,5 +65,5 @@ partial interface HTMLIFrameElement {
|
||||
attribute boolean mozbrowser;
|
||||
};
|
||||
|
||||
HTMLIFrameElement implements MozFrameLoaderOwner;
|
||||
HTMLIFrameElement implements BrowserElement;
|
||||
HTMLIFrameElement includes MozFrameLoaderOwner;
|
||||
HTMLIFrameElement includes BrowserElement;
|
||||
|
@ -67,65 +67,3 @@ partial interface HTMLImageElement {
|
||||
attribute DOMString sizes;
|
||||
readonly attribute DOMString currentSrc;
|
||||
};
|
||||
|
||||
// Mozilla extensions.
|
||||
partial interface HTMLImageElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString lowsrc;
|
||||
|
||||
// These attributes are offsets from the closest view (to mimic
|
||||
// NS4's "offset-from-layer" behavior).
|
||||
readonly attribute long x;
|
||||
readonly attribute long y;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface MozImageLoadingContent {
|
||||
// Mirrored chrome-only nsIImageLoadingContent methods. Please make sure
|
||||
// to update this list if nsIImageLoadingContent changes.
|
||||
[ChromeOnly]
|
||||
const long UNKNOWN_REQUEST = -1;
|
||||
[ChromeOnly]
|
||||
const long CURRENT_REQUEST = 0;
|
||||
[ChromeOnly]
|
||||
const long PENDING_REQUEST = 1;
|
||||
|
||||
[ChromeOnly]
|
||||
attribute boolean loadingEnabled;
|
||||
[ChromeOnly]
|
||||
readonly attribute short imageBlockingStatus;
|
||||
/**
|
||||
* Same as addNativeObserver but intended for scripted observers or observers
|
||||
* from another or without a document.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
void addObserver(imgINotificationObserver aObserver);
|
||||
/**
|
||||
* Same as removeNativeObserver but intended for scripted observers or
|
||||
* observers from another or without a document.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
void removeObserver(imgINotificationObserver aObserver);
|
||||
[ChromeOnly,Throws]
|
||||
imgIRequest? getRequest(long aRequestType);
|
||||
[ChromeOnly,Throws]
|
||||
long getRequestType(imgIRequest aRequest);
|
||||
[ChromeOnly,Throws]
|
||||
readonly attribute URI? currentURI;
|
||||
// Gets the final URI of the current request, if available.
|
||||
// Otherwise, returns null.
|
||||
[ChromeOnly]
|
||||
readonly attribute URI? currentRequestFinalURI;
|
||||
/**
|
||||
* forceReload forces reloading of the image pointed to by currentURI
|
||||
*
|
||||
* @param aNotify request should notify
|
||||
* @throws NS_ERROR_NOT_AVAILABLE if there is no current URI to reload
|
||||
*/
|
||||
[ChromeOnly,Throws]
|
||||
void forceReload(optional boolean aNotify = true);
|
||||
[ChromeOnly]
|
||||
void forceImageState(boolean aForce, unsigned long long aState);
|
||||
};
|
||||
|
||||
HTMLImageElement implements MozImageLoadingContent;
|
||||
|
@ -147,67 +147,7 @@ partial interface HTMLInputElement {
|
||||
attribute DOMString useMap;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
|
||||
partial interface HTMLInputElement {
|
||||
[GetterThrows, ChromeOnly]
|
||||
readonly attribute XULControllers controllers;
|
||||
// Binaryname because we have a FragmentOrElement function named "TextLength()".
|
||||
[NeedsCallerType, BinaryName="inputTextLength"]
|
||||
readonly attribute long textLength;
|
||||
|
||||
[Throws, ChromeOnly]
|
||||
sequence<DOMString> mozGetFileNameArray();
|
||||
|
||||
[ChromeOnly, Throws]
|
||||
void mozSetFileNameArray(sequence<DOMString> fileNames);
|
||||
|
||||
[ChromeOnly]
|
||||
void mozSetFileArray(sequence<File> files);
|
||||
|
||||
// This method is meant to use for testing only.
|
||||
[ChromeOnly, Throws]
|
||||
void mozSetDirectory(DOMString directoryPath);
|
||||
|
||||
// This method is meant to use for testing only.
|
||||
[ChromeOnly]
|
||||
void mozSetDndFilesAndDirectories(sequence<(File or Directory)> list);
|
||||
|
||||
// Number controls (<input type=number>) have an anonymous text control
|
||||
// (<input type=text>) in the anonymous shadow tree that they contain. On
|
||||
// such an anonymous text control this property provides access to the
|
||||
// number control that owns the text control. This is useful, for example,
|
||||
// in code that looks at the currently focused element to make decisions
|
||||
// about which IME to bring up. Such code needs to be able to check for any
|
||||
// owning number control since it probably wants to bring up a number pad
|
||||
// instead of the standard keyboard, even when the anonymous text control has
|
||||
// focus.
|
||||
[ChromeOnly]
|
||||
readonly attribute HTMLInputElement? ownerNumberControl;
|
||||
|
||||
boolean mozIsTextField(boolean aExcludePassword);
|
||||
|
||||
[ChromeOnly]
|
||||
// This function will return null if @autocomplete is not defined for the
|
||||
// current @type
|
||||
AutocompleteInfo? getAutocompleteInfo();
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface MozEditableElement {
|
||||
[Pure, ChromeOnly]
|
||||
readonly attribute nsIEditor? editor;
|
||||
|
||||
/*Non standard
|
||||
// This is similar to set .value on nsIDOMInput/TextAreaElements, but handling
|
||||
// of the value change is closer to the normal user input, so 'change' event
|
||||
// for example will be dispatched when focusing out the element.
|
||||
[Func="IsChromeOrXBL", NeedsSubjectPrincipal]
|
||||
void setUserInput(DOMString input);
|
||||
*/
|
||||
};
|
||||
|
||||
HTMLInputElement implements MozEditableElement;
|
||||
HTMLInputElement includes MozEditableElement;
|
||||
|
||||
/*Non standard
|
||||
partial interface HTMLInputElement {
|
||||
@ -228,7 +168,7 @@ partial interface HTMLInputElement {
|
||||
};
|
||||
*/
|
||||
|
||||
HTMLInputElement implements MozImageLoadingContent;
|
||||
HTMLInputElement includes MozImageLoadingContent;
|
||||
|
||||
// Webkit/Blink
|
||||
partial interface HTMLInputElement {
|
||||
@ -264,31 +204,6 @@ partial interface HTMLInputElement {
|
||||
[Pref="dom.forms.datetime", ChromeOnly,
|
||||
BinaryName="getMaximumAsDouble"]
|
||||
double getMaximum();
|
||||
|
||||
/*Non standard
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
|
||||
void openDateTimePicker(optional DateTimeValue initialValue);
|
||||
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
|
||||
void updateDateTimePicker(optional DateTimeValue value);
|
||||
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
|
||||
void closeDateTimePicker();
|
||||
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
|
||||
void setFocusState(boolean aIsFocused);
|
||||
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
|
||||
void updateValidityState();
|
||||
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL",
|
||||
BinaryName="getStepAsDouble"]
|
||||
double getStep();
|
||||
|
||||
[Pref="dom.forms.datetime", Func="IsChromeOrXBL",
|
||||
BinaryName="getStepBaseAsDouble"]
|
||||
double getStepBase();
|
||||
*/
|
||||
};
|
||||
|
||||
partial interface HTMLInputElement {
|
||||
|
@ -34,7 +34,7 @@ interface HTMLLinkElement : HTMLElement {
|
||||
attribute DOMString referrerPolicy;
|
||||
[PutForwards=value] readonly attribute DOMTokenList sizes;
|
||||
};
|
||||
HTMLLinkElement implements LinkStyle;
|
||||
HTMLLinkElement includes LinkStyle;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLLinkElement {
|
||||
|
@ -98,55 +98,6 @@ interface HTMLMediaElement : HTMLElement {
|
||||
optional DOMString language = "");
|
||||
};
|
||||
|
||||
// Mozilla extensions:
|
||||
partial interface HTMLMediaElement {
|
||||
[Func="HasDebuggerOrTabsPrivilege"]
|
||||
readonly attribute MediaSource? mozMediaSourceObject;
|
||||
[Func="HasDebuggerOrTabsPrivilege"]
|
||||
readonly attribute DOMString mozDebugReaderData;
|
||||
[Func="HasDebuggerOrTabsPrivilege", NewObject]
|
||||
Promise<DOMString> mozRequestDebugInfo();
|
||||
|
||||
[Func="HasDebuggerOrTabsPrivilege", NewObject]
|
||||
static void mozEnableDebugLog();
|
||||
[Func="HasDebuggerOrTabsPrivilege", NewObject]
|
||||
Promise<DOMString> mozRequestDebugLog();
|
||||
|
||||
[Pref="media.test.dumpDebugInfo"]
|
||||
Promise<void> mozDumpDebugInfo();
|
||||
|
||||
attribute MediaStream? srcObject;
|
||||
|
||||
attribute boolean mozPreservesPitch;
|
||||
|
||||
/*Non standard
|
||||
// NB: for internal use with the video controls:
|
||||
[Func="IsChromeOrXBL"] attribute boolean mozAllowCasting;
|
||||
[Func="IsChromeOrXBL"] attribute boolean mozIsCasting;
|
||||
*/
|
||||
|
||||
// Mozilla extension: stream capture
|
||||
[Throws]
|
||||
MediaStream mozCaptureStream();
|
||||
[Throws]
|
||||
MediaStream mozCaptureStreamUntilEnded();
|
||||
readonly attribute boolean mozAudioCaptured;
|
||||
|
||||
// Mozilla extension: return embedded metadata from the stream as a
|
||||
// JSObject with key:value pairs for each tag. This can be used by
|
||||
// player interfaces to display the song title, artist, etc.
|
||||
[Throws]
|
||||
object? mozGetMetadata();
|
||||
|
||||
// Mozilla extension: provides access to the fragment end time if
|
||||
// the media element has a fragment URI for the currentSrc, otherwise
|
||||
// it is equal to the media duration.
|
||||
readonly attribute double mozFragmentEnd;
|
||||
|
||||
[ChromeOnly]
|
||||
void reportCanPlayTelemetry();
|
||||
};
|
||||
|
||||
// Encrypted Media Extensions
|
||||
partial interface HTMLMediaElement {
|
||||
readonly attribute MediaKeys? mediaKeys;
|
||||
@ -160,16 +111,6 @@ partial interface HTMLMediaElement {
|
||||
attribute EventHandler onwaitingforkey;
|
||||
};
|
||||
|
||||
// This is just for testing
|
||||
partial interface HTMLMediaElement {
|
||||
[Pref="media.useAudioChannelService.testing"]
|
||||
readonly attribute double computedVolume;
|
||||
[Pref="media.useAudioChannelService.testing"]
|
||||
readonly attribute boolean computedMuted;
|
||||
[Pref="media.useAudioChannelService.testing"]
|
||||
readonly attribute unsigned long computedSuspended;
|
||||
};
|
||||
|
||||
/*
|
||||
* HTMLMediaElement::seekToNextFrame() is a Mozilla experimental feature.
|
||||
*
|
||||
|
@ -30,33 +30,3 @@ partial interface HTMLMenuElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute boolean compact;
|
||||
};
|
||||
|
||||
// Mozilla specific stuff
|
||||
partial interface HTMLMenuElement {
|
||||
/**
|
||||
* Creates and dispatches a trusted event named "show".
|
||||
* The event is not cancelable and does not bubble.
|
||||
* See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus
|
||||
*/
|
||||
[ChromeOnly]
|
||||
void sendShowEvent();
|
||||
|
||||
/**
|
||||
* Creates a native menu builder. The builder type is dependent on menu type.
|
||||
* Currently, it returns the @mozilla.org/content/html-menu-builder;1
|
||||
* component. Toolbar menus are not yet supported (the method returns null).
|
||||
*/
|
||||
[ChromeOnly]
|
||||
MenuBuilder? createBuilder();
|
||||
|
||||
/*
|
||||
* Builds a menu by iterating over menu children.
|
||||
* See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#building-menus-and-toolbars
|
||||
* The caller can use a native builder by calling createBuilder() or provide
|
||||
* a custom builder that implements the nsIMenuBuilder interface.
|
||||
* A custom builder can be used for example to build native context menus
|
||||
* that are not defined using <menupopup>.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
void build(MenuBuilder aBuilder);
|
||||
};
|
||||
|
@ -78,145 +78,6 @@ partial interface HTMLObjectElement {
|
||||
Document? getSVGDocument();
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface MozObjectLoadingContent {
|
||||
// Mirrored chrome-only scriptable nsIObjectLoadingContent methods. Please
|
||||
// make sure to update this list if nsIObjectLoadingContent changes. Also,
|
||||
// make sure everything on here is [ChromeOnly].
|
||||
[ChromeOnly]
|
||||
const unsigned long TYPE_LOADING = 0;
|
||||
[ChromeOnly]
|
||||
const unsigned long TYPE_IMAGE = 1;
|
||||
[ChromeOnly]
|
||||
const unsigned long TYPE_PLUGIN = 2;
|
||||
[ChromeOnly]
|
||||
const unsigned long TYPE_FAKE_PLUGIN = 3;
|
||||
[ChromeOnly]
|
||||
const unsigned long TYPE_DOCUMENT = 4;
|
||||
[ChromeOnly]
|
||||
const unsigned long TYPE_NULL = 5;
|
||||
|
||||
// The content type is not supported (e.g. plugin not installed)
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_UNSUPPORTED = 0;
|
||||
// Showing alternate content
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_ALTERNATE = 1;
|
||||
// The plugin exists, but is disabled
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_DISABLED = 2;
|
||||
// The plugin is blocklisted and disabled
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_BLOCKLISTED = 3;
|
||||
// The plugin is considered outdated, but not disabled
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_OUTDATED = 4;
|
||||
// The plugin has crashed
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_CRASHED = 5;
|
||||
// Suppressed by security policy
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_SUPPRESSED = 6;
|
||||
// Blocked by content policy
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_USER_DISABLED = 7;
|
||||
/// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
|
||||
/// would be replaced by a real plugin if activated (playPlugin())
|
||||
/// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
|
||||
/// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types.
|
||||
// The plugin is disabled until the user clicks on it
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
|
||||
// The plugin is vulnerable (update available)
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
|
||||
// The plugin is vulnerable (no update available)
|
||||
[ChromeOnly]
|
||||
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
|
||||
|
||||
/**
|
||||
* The actual mime type (the one we got back from the network
|
||||
* request) for the element.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
readonly attribute DOMString actualType;
|
||||
|
||||
/**
|
||||
* Gets the type of the content that's currently loaded. See
|
||||
* the constants above for the list of possible values.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
readonly attribute unsigned long displayedType;
|
||||
|
||||
/**
|
||||
* Gets the content type that corresponds to the give MIME type. See the
|
||||
* constants above for the list of possible values. If nothing else fits,
|
||||
* TYPE_NULL will be returned.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
unsigned long getContentTypeForMIMEType(DOMString aMimeType);
|
||||
|
||||
|
||||
[ChromeOnly]
|
||||
sequence<MozPluginParameter> getPluginAttributes();
|
||||
|
||||
[ChromeOnly]
|
||||
sequence<MozPluginParameter> getPluginParameters();
|
||||
|
||||
/**
|
||||
* This method will play a plugin that has been stopped by the click-to-play
|
||||
* feature.
|
||||
*/
|
||||
[ChromeOnly, Throws, NeedsCallerType]
|
||||
void playPlugin();
|
||||
|
||||
/**
|
||||
* Forces a re-evaluation and reload of the tag, optionally invalidating its
|
||||
* click-to-play state. This can be used when the MIME type that provides a
|
||||
* type has changed, for instance, to force the tag to re-evalulate the
|
||||
* handler to use.
|
||||
*/
|
||||
[ChromeOnly, Throws]
|
||||
void reload(boolean aClearActivation);
|
||||
|
||||
/**
|
||||
* This attribute will return true if the current content type has been
|
||||
* activated, either explicitly or by passing checks that would have it be
|
||||
* click-to-play.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
readonly attribute boolean activated;
|
||||
|
||||
/**
|
||||
* The URL of the data/src loaded in the object. This may be null (i.e.
|
||||
* an <embed> with no src).
|
||||
*/
|
||||
[ChromeOnly]
|
||||
readonly attribute URI? srcURI;
|
||||
|
||||
[ChromeOnly]
|
||||
readonly attribute unsigned long defaultFallbackType;
|
||||
|
||||
[ChromeOnly]
|
||||
readonly attribute unsigned long pluginFallbackType;
|
||||
|
||||
/**
|
||||
* If this object currently owns a running plugin, regardless of whether or
|
||||
* not one is pending spawn/despawn.
|
||||
*/
|
||||
[ChromeOnly]
|
||||
readonly attribute boolean hasRunningPlugin;
|
||||
|
||||
/**
|
||||
* Disable the use of fake plugins and reload the tag if necessary
|
||||
*/
|
||||
[ChromeOnly, Throws]
|
||||
void skipFakePlugins();
|
||||
|
||||
[ChromeOnly, Throws, NeedsCallerType]
|
||||
readonly attribute unsigned long runID;
|
||||
};
|
||||
|
||||
/**
|
||||
* Name:Value pair type used for passing parameters to NPAPI or javascript
|
||||
* plugins.
|
||||
@ -226,6 +87,6 @@ dictionary MozPluginParameter {
|
||||
DOMString value = "";
|
||||
};
|
||||
|
||||
HTMLObjectElement implements MozImageLoadingContent;
|
||||
HTMLObjectElement implements MozFrameLoaderOwner;
|
||||
HTMLObjectElement implements MozObjectLoadingContent;
|
||||
HTMLObjectElement includes MozImageLoadingContent;
|
||||
HTMLObjectElement includes MozFrameLoaderOwner;
|
||||
HTMLObjectElement includes MozObjectLoadingContent;
|
||||
|
@ -17,5 +17,4 @@ interface HTMLStyleElement : HTMLElement {
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString type;
|
||||
};
|
||||
HTMLStyleElement implements LinkStyle;
|
||||
|
||||
HTMLStyleElement includes LinkStyle;
|
||||
|
@ -21,12 +21,6 @@ interface HTMLTableCellElement : HTMLElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString headers;
|
||||
readonly attribute long cellIndex;
|
||||
|
||||
// Mozilla-specific extensions
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString abbr;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString scope;
|
||||
};
|
||||
|
||||
partial interface HTMLTableCellElement {
|
||||
|
@ -81,16 +81,4 @@ interface HTMLTextAreaElement : HTMLElement {
|
||||
void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
|
||||
};
|
||||
|
||||
partial interface HTMLTextAreaElement {
|
||||
// Chrome-only Mozilla extensions
|
||||
|
||||
[Throws, ChromeOnly]
|
||||
readonly attribute XULControllers controllers;
|
||||
};
|
||||
|
||||
HTMLTextAreaElement implements MozEditableElement;
|
||||
|
||||
partial interface HTMLTextAreaElement {
|
||||
[ChromeOnly]
|
||||
attribute DOMString previewValue;
|
||||
};
|
||||
HTMLTextAreaElement includes MozEditableElement;
|
||||
|
@ -23,40 +23,6 @@ interface HTMLVideoElement : HTMLMediaElement {
|
||||
attribute DOMString poster;
|
||||
};
|
||||
|
||||
partial interface HTMLVideoElement {
|
||||
// A count of the number of video frames that have demuxed from the media
|
||||
// resource. If we were playing perfectly, we'd be able to paint this many
|
||||
// frames.
|
||||
readonly attribute unsigned long mozParsedFrames;
|
||||
|
||||
// A count of the number of frames that have been decoded. We may drop
|
||||
// frames if the decode is taking too much time.
|
||||
readonly attribute unsigned long mozDecodedFrames;
|
||||
|
||||
// A count of the number of frames that have been presented to the rendering
|
||||
// pipeline. We may drop frames if they arrive late at the renderer.
|
||||
readonly attribute unsigned long mozPresentedFrames;
|
||||
|
||||
// Number of presented frames which were painted on screen.
|
||||
readonly attribute unsigned long mozPaintedFrames;
|
||||
|
||||
// Time which the last painted video frame was late by, in seconds.
|
||||
readonly attribute double mozFrameDelay;
|
||||
|
||||
// True if the video has an audio track available.
|
||||
readonly attribute boolean mozHasAudio;
|
||||
|
||||
/*Non standard
|
||||
// Attributes for builtin video controls to lock screen orientation.
|
||||
// True if video controls should lock orientation when fullscreen.
|
||||
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrXBL"]
|
||||
readonly attribute boolean mozOrientationLockEnabled;
|
||||
// True if screen orientation is locked by video controls.
|
||||
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrXBL"]
|
||||
attribute boolean mozIsOrientationLocked;
|
||||
*/
|
||||
};
|
||||
|
||||
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
|
||||
partial interface HTMLVideoElement {
|
||||
[Func="mozilla::dom::MediaSource::Enabled", NewObject]
|
||||
|
@ -19,6 +19,3 @@ Constructor(BaseAudioContext context, IIRFilterOptions options)]
|
||||
interface IIRFilterNode : AudioNode {
|
||||
void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
IIRFilterNode implements AudioNodePassThrough;
|
||||
|
@ -66,6 +66,3 @@ dictionary KeyboardEventInit : EventModifierInit
|
||||
unsigned long keyCode = 0;
|
||||
unsigned long which = 0;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
KeyboardEvent implements KeyEvent;
|
||||
|
@ -1,31 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
// invalid widl
|
||||
//interface nsISupports;
|
||||
//interface IID;
|
||||
|
||||
[NoInterfaceObject,
|
||||
// Need Exposed here, because this is a mixin onto things like Event
|
||||
// that are exposed in workers.
|
||||
Exposed=(Window,Worker,System)]
|
||||
interface LegacyQueryInterface {
|
||||
// Legacy QueryInterface, only exposed to chrome code on the main thread.
|
||||
[Exposed=(Window,System), ChromeOnly]
|
||||
nsISupports QueryInterface(IID iid);
|
||||
};
|
||||
|
||||
BoxObject implements LegacyQueryInterface;
|
||||
DOMParser implements LegacyQueryInterface;
|
||||
Document implements LegacyQueryInterface;
|
||||
DocumentFragment implements LegacyQueryInterface;
|
||||
Element implements LegacyQueryInterface;
|
||||
Event implements LegacyQueryInterface;
|
||||
Selection implements LegacyQueryInterface;
|
||||
TreeColumns implements LegacyQueryInterface;
|
||||
TreeContentView implements LegacyQueryInterface;
|
||||
Window implements LegacyQueryInterface;
|
||||
XMLHttpRequest implements LegacyQueryInterface;
|
@ -7,8 +7,6 @@
|
||||
* http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
|
||||
*/
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface LinkStyle {
|
||||
interface mixin LinkStyle {
|
||||
readonly attribute StyleSheet? sheet;
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,3 @@ dictionary MediaElementAudioSourceOptions {
|
||||
interface MediaElementAudioSourceNode : AudioNode {
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
MediaElementAudioSourceNode implements AudioNodePassThrough;
|
||||
|
||||
|
@ -19,7 +19,3 @@ dictionary MediaStreamAudioSourceOptions {
|
||||
interface MediaStreamAudioSourceNode : AudioNode {
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
MediaStreamAudioSourceNode implements AudioNodePassThrough;
|
||||
|
||||
|
@ -17,21 +17,4 @@ dictionary MediaTrackSettings {
|
||||
boolean noiseSuppression;
|
||||
boolean autoGainControl;
|
||||
long channelCount;
|
||||
|
||||
// Mozilla-specific extensions:
|
||||
|
||||
// http://fluffy.github.io/w3c-screen-share/#screen-based-video-constraints
|
||||
// OBE by http://w3c.github.io/mediacapture-screen-share
|
||||
|
||||
DOMString mediaSource;
|
||||
|
||||
// Experimental https://bugzilla.mozilla.org/show_bug.cgi?id=1131568#c3
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1193075
|
||||
|
||||
long long browserWindow;
|
||||
boolean scrollWithPage;
|
||||
long viewportOffsetX;
|
||||
long viewportOffsetY;
|
||||
long viewportWidth;
|
||||
long viewportHeight;
|
||||
};
|
||||
|
@ -23,21 +23,4 @@ dictionary MediaTrackSupportedConstraints {
|
||||
boolean channelCount = true;
|
||||
boolean deviceId = true;
|
||||
boolean groupId; // to be supported
|
||||
|
||||
// Mozilla-specific extensions:
|
||||
|
||||
// http://fluffy.github.io/w3c-screen-share/#screen-based-video-constraints
|
||||
// OBE by http://w3c.github.io/mediacapture-screen-share
|
||||
|
||||
boolean mediaSource = true;
|
||||
|
||||
// Experimental https://bugzilla.mozilla.org/show_bug.cgi?id=1131568#c3
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1193075
|
||||
|
||||
boolean browserWindow = true;
|
||||
boolean scrollWithPage = true;
|
||||
boolean viewportOffsetX = true;
|
||||
boolean viewportOffsetY = true;
|
||||
boolean viewportWidth = true;
|
||||
boolean viewportHeight = true;
|
||||
};
|
||||
|
@ -1,19 +0,0 @@
|
||||
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
[Func="IsChromeOrXBL"]
|
||||
interface MenuBoxObject : BoxObject {
|
||||
|
||||
void openMenu(boolean openFlag);
|
||||
|
||||
attribute Element? activeChild;
|
||||
|
||||
boolean handleKeyPress(KeyboardEvent keyEvent);
|
||||
|
||||
readonly attribute boolean openedWithKey;
|
||||
|
||||
};
|
@ -19,4 +19,4 @@ interface MessagePort : EventTarget {
|
||||
attribute EventHandler onmessage;
|
||||
attribute EventHandler onmessageerror;
|
||||
};
|
||||
// MessagePort implements Transferable;
|
||||
// MessagePort includes Transferable;
|
||||
|
40
crates/web-sys/webidls/enabled/MouseEvent.webidl
vendored
40
crates/web-sys/webidls/enabled/MouseEvent.webidl
vendored
@ -73,43 +73,3 @@ dictionary MouseEventInit : EventModifierInit {
|
||||
long movementX = 0;
|
||||
long movementY = 0;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
partial interface MouseEvent
|
||||
{
|
||||
// Finger or touch pressure event value
|
||||
// ranges between 0.0 and 1.0
|
||||
readonly attribute float mozPressure;
|
||||
|
||||
const unsigned short MOZ_SOURCE_UNKNOWN = 0;
|
||||
const unsigned short MOZ_SOURCE_MOUSE = 1;
|
||||
const unsigned short MOZ_SOURCE_PEN = 2;
|
||||
const unsigned short MOZ_SOURCE_ERASER = 3;
|
||||
const unsigned short MOZ_SOURCE_CURSOR = 4;
|
||||
const unsigned short MOZ_SOURCE_TOUCH = 5;
|
||||
const unsigned short MOZ_SOURCE_KEYBOARD = 6;
|
||||
|
||||
readonly attribute unsigned short mozInputSource;
|
||||
|
||||
void initNSMouseEvent(DOMString typeArg,
|
||||
optional boolean canBubbleArg = false,
|
||||
optional boolean cancelableArg = false,
|
||||
optional Window? viewArg = null,
|
||||
optional long detailArg = 0,
|
||||
optional long screenXArg = 0,
|
||||
optional long screenYArg = 0,
|
||||
optional long clientXArg = 0,
|
||||
optional long clientYArg = 0,
|
||||
optional boolean ctrlKeyArg = false,
|
||||
optional boolean altKeyArg = false,
|
||||
optional boolean shiftKeyArg = false,
|
||||
optional boolean metaKeyArg = false,
|
||||
optional short buttonArg = 0,
|
||||
optional EventTarget? relatedTargetArg = null,
|
||||
optional float pressure = 0,
|
||||
optional unsigned short inputSourceArg = 0);
|
||||
[ChromeOnly]
|
||||
readonly attribute boolean hitCluster; // True when touch occurs in a cluster of links
|
||||
|
||||
};
|
||||
|
||||
|
99
crates/web-sys/webidls/enabled/Navigator.webidl
vendored
99
crates/web-sys/webidls/enabled/Navigator.webidl
vendored
@ -28,17 +28,17 @@
|
||||
interface Navigator {
|
||||
// objects implementing this interface also implement the interfaces given below
|
||||
};
|
||||
Navigator implements NavigatorID;
|
||||
Navigator implements NavigatorLanguage;
|
||||
Navigator implements NavigatorOnLine;
|
||||
Navigator implements NavigatorContentUtils;
|
||||
Navigator implements NavigatorStorageUtils;
|
||||
Navigator implements NavigatorConcurrentHardware;
|
||||
Navigator implements NavigatorStorage;
|
||||
Navigator implements NavigatorAutomationInformation;
|
||||
Navigator includes NavigatorID;
|
||||
Navigator includes NavigatorLanguage;
|
||||
Navigator includes NavigatorOnLine;
|
||||
Navigator includes NavigatorContentUtils;
|
||||
Navigator includes NavigatorStorageUtils;
|
||||
Navigator includes NavigatorConcurrentHardware;
|
||||
Navigator includes NavigatorStorage;
|
||||
Navigator includes NavigatorAutomationInformation;
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorID {
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin NavigatorID {
|
||||
// WebKit/Blink/Trident/Presto support this (hardcoded "Mozilla").
|
||||
[Constant, Cached, Throws]
|
||||
readonly attribute DOMString appCodeName; // constant "Mozilla"
|
||||
@ -58,8 +58,8 @@ interface NavigatorID {
|
||||
boolean taintEnabled(); // constant false
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorLanguage {
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin NavigatorLanguage {
|
||||
|
||||
// These two attributes are cached because this interface is also implemented
|
||||
// by Workernavigator and this way we don't have to go back to the
|
||||
@ -72,13 +72,12 @@ interface NavigatorLanguage {
|
||||
readonly attribute sequence<DOMString> languages;
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorOnLine {
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin NavigatorOnLine {
|
||||
readonly attribute boolean onLine;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface NavigatorContentUtils {
|
||||
interface mixin NavigatorContentUtils {
|
||||
// content handler registration
|
||||
[Throws, Func="nsGlobalWindowInner::RegisterProtocolHandlerAllowedForContext"]
|
||||
void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
|
||||
@ -91,14 +90,13 @@ interface NavigatorContentUtils {
|
||||
//void unregisterContentHandler(DOMString mimeType, DOMString url);
|
||||
};
|
||||
|
||||
[SecureContext, NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorStorage {
|
||||
[SecureContext, Exposed=(Window,Worker)]
|
||||
interface mixin NavigatorStorage {
|
||||
[Func="mozilla::dom::DOMPrefs::StorageManagerEnabled"]
|
||||
readonly attribute StorageManager storage;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface NavigatorStorageUtils {
|
||||
interface mixin NavigatorStorageUtils {
|
||||
// NOT IMPLEMENTED
|
||||
//void yieldForStorageUpdates();
|
||||
};
|
||||
@ -123,12 +121,11 @@ partial interface Navigator {
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/geolocation-API/#geolocation_interface
|
||||
[NoInterfaceObject]
|
||||
interface NavigatorGeolocation {
|
||||
interface mixin NavigatorGeolocation {
|
||||
[Throws, Pref="geo.enabled"]
|
||||
readonly attribute Geolocation geolocation;
|
||||
};
|
||||
Navigator implements NavigatorGeolocation;
|
||||
Navigator includes NavigatorGeolocation;
|
||||
|
||||
// http://www.w3.org/TR/battery-status/#navigatorbattery-interface
|
||||
partial interface Navigator {
|
||||
@ -158,58 +155,6 @@ partial interface Navigator {
|
||||
readonly attribute MediaCapabilities mediaCapabilities;
|
||||
};
|
||||
|
||||
// Mozilla-specific extensions
|
||||
|
||||
// Chrome-only interface for Vibration API permission handling.
|
||||
partial interface Navigator {
|
||||
/* Set permission state to device vibration.
|
||||
* @param permitted permission state (true for allowing vibration)
|
||||
* @param persistent make the permission session-persistent
|
||||
*/
|
||||
[ChromeOnly]
|
||||
void setVibrationPermission(boolean permitted,
|
||||
optional boolean persistent = true);
|
||||
};
|
||||
|
||||
callback interface MozIdleObserver {
|
||||
// Time is in seconds and is read only when idle observers are added
|
||||
// and removed.
|
||||
readonly attribute unsigned long time;
|
||||
void onidle();
|
||||
void onactive();
|
||||
};
|
||||
|
||||
partial interface Navigator {
|
||||
[Throws, Constant, Cached, NeedsCallerType]
|
||||
readonly attribute DOMString oscpu;
|
||||
// WebKit/Blink support this; Trident/Presto do not.
|
||||
readonly attribute DOMString vendor;
|
||||
// WebKit/Blink supports this (hardcoded ""); Trident/Presto do not.
|
||||
readonly attribute DOMString vendorSub;
|
||||
// WebKit/Blink supports this (hardcoded "20030107"); Trident/Presto don't
|
||||
readonly attribute DOMString productSub;
|
||||
// WebKit/Blink/Trident/Presto support this.
|
||||
readonly attribute boolean cookieEnabled;
|
||||
[Throws, Constant, Cached, NeedsCallerType]
|
||||
readonly attribute DOMString buildID;
|
||||
|
||||
// WebKit/Blink/Trident/Presto support this.
|
||||
[Affects=Nothing, DependsOn=Nothing]
|
||||
boolean javaEnabled();
|
||||
|
||||
/**
|
||||
* Navigator requests to add an idle observer to the existing window.
|
||||
*/
|
||||
[Throws, ChromeOnly]
|
||||
void addIdleObserver(MozIdleObserver aIdleObserver);
|
||||
|
||||
/**
|
||||
* Navigator requests to remove an idle observer from the existing window.
|
||||
*/
|
||||
[Throws, ChromeOnly]
|
||||
void removeIdleObserver(MozIdleObserver aIdleObserver);
|
||||
};
|
||||
|
||||
// NetworkInformation
|
||||
partial interface Navigator {
|
||||
[Throws, Pref="dom.netinfo.enabled"]
|
||||
@ -314,8 +259,8 @@ partial interface Navigator {
|
||||
sequence<MediaKeySystemConfiguration> supportedConfigurations);
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorConcurrentHardware {
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin NavigatorConcurrentHardware {
|
||||
readonly attribute unsigned long long hardwareConcurrency;
|
||||
};
|
||||
|
||||
|
116
crates/web-sys/webidls/enabled/Node.webidl
vendored
116
crates/web-sys/webidls/enabled/Node.webidl
vendored
@ -101,122 +101,6 @@ interface Node : EventTarget {
|
||||
DOMString? lookupNamespaceURI(DOMString? prefix);
|
||||
[Pure]
|
||||
boolean isDefaultNamespace(DOMString? namespace);
|
||||
|
||||
// Mozilla-specific stuff
|
||||
[ChromeOnly]
|
||||
readonly attribute Principal nodePrincipal;
|
||||
[ChromeOnly]
|
||||
readonly attribute URI? baseURIObject;
|
||||
[ChromeOnly]
|
||||
DOMString generateXPath();
|
||||
|
||||
/**
|
||||
* This method provides a fast-path for the Fluent localization system to
|
||||
* bypass the slowdowns in performance during initial document translation.
|
||||
* The slowdowns are specific to XBL+Stylo.
|
||||
* To learn more, see bug 1441037.
|
||||
*
|
||||
* The API is designed to fit into the DOMLocalization flow with minimal
|
||||
* overhead, which dictates much of its signature.
|
||||
* It takes the following steps:
|
||||
*
|
||||
* 1) The API can be called at any point on any DOM element and it
|
||||
* synchronously scans the element subtree for all children with
|
||||
* `data-l10n-id` attribute set.
|
||||
*
|
||||
* 2) Next, the API collects all of the l10n attributes
|
||||
* (l10n-id, l10n-args and l10n-attrs), and passes them to the
|
||||
* callback function together with three `Element` properties:
|
||||
* `name` - name of the element as lowercase
|
||||
* `namespaceURI` - namespace URI
|
||||
* `type` - the type prop of the element (used for input sanitization)
|
||||
*
|
||||
* 3) The callback function is responsible for (asynchronously) collecting
|
||||
* the translations for all l10n id+args pairs, sanitizing them and then
|
||||
* return them back to this API.
|
||||
*
|
||||
* 4) The API takes the list of elements collected in step (1) and their
|
||||
* translations and applies all of the translation values onto
|
||||
* the elements.
|
||||
*
|
||||
* 5) The API returns a list with empty slots for all translated elements
|
||||
* and references to elements that could not be translated.
|
||||
*
|
||||
* 6) The JS handles the translations of remaining elements.
|
||||
*
|
||||
*
|
||||
* Through the whole cycle, the API uses the same list of elements and
|
||||
* corresponding translations. It means that after step (1), the element
|
||||
* at index 1 will match the l10nData at index 1, translations at index 1
|
||||
* and in the final return list, the element will be also stored at index 1
|
||||
* or the slot will be empty if the translations was applied on the C++ side.
|
||||
*
|
||||
* Note: There are several reasons why the JS callback may pass undefined for
|
||||
* a given element including missing translation, or the need to
|
||||
* translate the element using DOM Overlays.
|
||||
*
|
||||
*
|
||||
* Example of use from JS:
|
||||
*
|
||||
* async function translateFragment(frag) {
|
||||
* let untranslatedElements = await frag.localize(
|
||||
* async cb(l10nItems) => { // 1
|
||||
* let trans = await getTranslations(l10nItems); // 2
|
||||
* return trans;
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* annotateMissingTranslations(untranslatedElements); // 3
|
||||
* }
|
||||
*
|
||||
* [1] l10nItems == [
|
||||
* {
|
||||
* l10nId: "key1",
|
||||
* l10nArgs: null,
|
||||
* l10nAttrs: null,
|
||||
* name: "button"
|
||||
* namespaceURI: "..."
|
||||
* type: null
|
||||
* },
|
||||
* {
|
||||
* l10nId: "key2",
|
||||
* l10nArgs: {unreadCount: 5},
|
||||
* l10nAttrs: null,
|
||||
* name: "label"
|
||||
* namespaceURI: "..."
|
||||
* type: null
|
||||
* },
|
||||
* {
|
||||
* l10nId: "key3",
|
||||
* l10nArgs: null,
|
||||
* l10nAttrs: "title",
|
||||
* name: "window"
|
||||
* namespaceURI: "..."
|
||||
* type: null
|
||||
* },
|
||||
* ]
|
||||
* [2] trans == [
|
||||
* {value: "Key 1", attributes: {accesskey: "K"} },
|
||||
* undefined,
|
||||
* {value: null, attributes: {title: "Unread emails: 5"} },
|
||||
* ]
|
||||
* [3] untranslatedElements == [
|
||||
* ,
|
||||
* <label>
|
||||
* ,
|
||||
* ]
|
||||
*
|
||||
* For exact dictionary structures, see `L10nUtils.webidl`.
|
||||
*/
|
||||
[ChromeOnly, Throws]
|
||||
Promise<void> localize(L10nCallback l10nCallback);
|
||||
|
||||
/*Unsupported ifdef
|
||||
#ifdef ACCESSIBILITY
|
||||
[Func="mozilla::dom::AccessibleNode::IsAOMEnabled", SameObject]
|
||||
readonly attribute AccessibleNode? accessibleNode;
|
||||
#endif
|
||||
*/
|
||||
};
|
||||
|
||||
/*TODO
|
||||
|
@ -60,64 +60,3 @@ interface OfflineResourceList : EventTarget {
|
||||
[UseCounter]
|
||||
attribute EventHandler onobsolete;
|
||||
};
|
||||
|
||||
// Mozilla extensions.
|
||||
partial interface OfflineResourceList {
|
||||
/**
|
||||
* Get the list of dynamically-managed entries.
|
||||
*/
|
||||
[Throws]
|
||||
readonly attribute DOMStringList mozItems;
|
||||
|
||||
/**
|
||||
* Check that an entry exists in the list of dynamically-managed entries.
|
||||
*
|
||||
* @param uri
|
||||
* The resource to check.
|
||||
*/
|
||||
[Throws]
|
||||
boolean mozHasItem(DOMString uri);
|
||||
|
||||
/**
|
||||
* Get the number of dynamically-managed entries.
|
||||
* @status DEPRECATED
|
||||
* Clients should use the "items" attribute.
|
||||
*/
|
||||
[Throws]
|
||||
readonly attribute unsigned long mozLength;
|
||||
|
||||
/**
|
||||
* Get the URI of a dynamically-managed entry.
|
||||
* @status DEPRECATED
|
||||
* Clients should use the "items" attribute.
|
||||
*/
|
||||
[Throws]
|
||||
getter DOMString mozItem(unsigned long index);
|
||||
|
||||
/**
|
||||
* We need a "length" to actually be valid Web IDL, given that we have an
|
||||
* indexed getter.
|
||||
*/
|
||||
readonly attribute unsigned long length;
|
||||
|
||||
/**
|
||||
* Add an item to the list of dynamically-managed entries. The resource
|
||||
* will be fetched into the application cache.
|
||||
*
|
||||
* @param uri
|
||||
* The resource to add.
|
||||
*/
|
||||
[Throws]
|
||||
void mozAdd(DOMString uri);
|
||||
|
||||
/**
|
||||
* Remove an item from the list of dynamically-managed entries. If this
|
||||
* was the last reference to a URI in the application cache, the cache
|
||||
* entry will be removed.
|
||||
*
|
||||
* @param uri
|
||||
* The resource to remove.
|
||||
*/
|
||||
[Throws]
|
||||
void mozRemove(DOMString uri);
|
||||
};
|
||||
|
@ -27,4 +27,4 @@ interface OffscreenCanvas : EventTarget {
|
||||
optional any encoderOptions);
|
||||
};
|
||||
|
||||
// OffscreenCanvas implements Transferable;
|
||||
// OffscreenCanvas includes Transferable;
|
||||
|
@ -37,6 +37,3 @@ interface OscillatorNode : AudioScheduledSourceNode {
|
||||
|
||||
void setPeriodicWave(PeriodicWave periodicWave);
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
OscillatorNode implements AudioNodePassThrough;
|
||||
|
@ -73,7 +73,3 @@ interface PannerNode : AudioNode {
|
||||
attribute double coneOuterGain;
|
||||
|
||||
};
|
||||
|
||||
// Mozilla extension
|
||||
PannerNode implements AudioNodePassThrough;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user