diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 4 | ||||
-rw-r--r-- | components/script/dom/testbinding.rs | 4 | ||||
-rw-r--r-- | components/script/dom/webidls/TestBinding.webidl | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 51a4653279f..0aa15a8d5a6 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -2000,6 +2000,7 @@ def UnionTypes(descriptors, dictionaries, callbacks, config): 'dom::bindings::conversions::StringificationBehavior', 'dom::bindings::error::throw_not_in_union', 'dom::bindings::js::Root', + 'dom::bindings::str::USVString', 'dom::types::*', 'js::jsapi::JSContext', 'js::jsapi::{HandleValue, MutableHandleValue}', @@ -3492,6 +3493,9 @@ def getUnionTypeTemplateVars(type, descriptorProvider): elif type.isDOMString(): name = type.name typeName = "DOMString" + elif type.isUSVString(): + name = type.name + typeName = "USVString" elif type.isPrimitive(): name = type.name typeName = builtinNames[type.tag()] diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 7c2038eab3b..057b3c2172b 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -12,6 +12,8 @@ use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum::_empty; use dom::bindings::codegen::UnionTypes::BlobOrString; use dom::bindings::codegen::UnionTypes::EventOrString; use dom::bindings::codegen::UnionTypes::EventOrString::eString; +use dom::bindings::codegen::UnionTypes::EventOrUSVString; +use dom::bindings::codegen::UnionTypes::EventOrUSVString::eUSVString; use dom::bindings::codegen::UnionTypes::HTMLElementOrLong; use dom::bindings::codegen::UnionTypes::HTMLElementOrLong::eLong; use dom::bindings::global::{GlobalField, GlobalRef}; @@ -77,6 +79,8 @@ impl TestBindingMethods for TestBinding { fn SetUnionAttribute(&self, _: HTMLElementOrLong) {} fn Union2Attribute(&self) -> EventOrString { eString("".to_owned()) } fn SetUnion2Attribute(&self, _: EventOrString) {} + fn Union3Attribute(&self) -> EventOrUSVString { eUSVString(USVString("".to_owned())) } + fn SetUnion3Attribute(&self, _: EventOrUSVString) {} fn ArrayAttribute(&self, _: *mut JSContext) -> *mut JSObject { NullValue().to_object_or_null() } fn AnyAttribute(&self, _: *mut JSContext) -> JSVal { NullValue() } fn SetAnyAttribute(&self, _: *mut JSContext, _: HandleValue) {} diff --git a/components/script/dom/webidls/TestBinding.webidl b/components/script/dom/webidls/TestBinding.webidl index 181909721aa..f845be7dc15 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -89,6 +89,7 @@ interface TestBinding { attribute Blob interfaceAttribute; attribute (HTMLElement or long) unionAttribute; attribute (Event or DOMString) union2Attribute; + attribute (Event or USVString) union3Attribute; readonly attribute Uint8ClampedArray arrayAttribute; attribute any anyAttribute; attribute object objectAttribute; |