diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-10-03 11:12:33 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-11-13 11:24:14 -0500 |
commit | bb7074698afbe02776ea02861d795d885ace923e (patch) | |
tree | 9952d33ab95e515843ea1057c2c815340f9690bd /components/script/dom/bindings | |
parent | 1c64dabb150da4152957b2c6e16f30d5201328e1 (diff) | |
download | servo-bb7074698afbe02776ea02861d795d885ace923e.tar.gz servo-bb7074698afbe02776ea02861d795d885ace923e.zip |
Add KeyboardEvent stub.
Diffstat (limited to 'components/script/dom/bindings')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 14 | ||||
-rw-r--r-- | components/script/dom/bindings/codegen/parser/WebIDL.py | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 9ca15459ba1..aaac17a9002 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -4280,7 +4280,7 @@ class CGDictionary(CGThing): d = self.dictionary if d.parent: inheritance = " pub parent: %s::%s<'a, 'b>,\n" % (self.makeModuleName(d.parent), - self.makeClassName(d.parent)) + self.makeClassName(d.parent)) else: inheritance = "" memberDecls = [" pub %s: %s," % @@ -4347,12 +4347,7 @@ class CGDictionary(CGThing): @staticmethod def makeModuleName(dictionary): - name = dictionary.identifier.name - if name.endswith('Init'): - return toBindingNamespace(name.replace('Init', '')) - #XXXjdm This breaks on the test webidl files, sigh. - #raise TypeError("No idea how to find this dictionary's definition: " + name) - return "/* uh oh */ %s" % name + return dictionary.module() def getMemberType(self, memberInfo): member, (_, _, declType, _) = memberInfo @@ -4535,7 +4530,7 @@ class CGBindingRoot(CGThing): 'dom::bindings::utils::{DOMJSClass, JSCLASS_DOM_GLOBAL}', 'dom::bindings::utils::{FindEnumStringIndex, GetArrayIndexFromId}', 'dom::bindings::utils::{GetPropertyOnPrototype, GetProtoOrIfaceArray}', - 'dom::bindings::utils::{HasPropertyOnPrototype, IntVal}', + 'dom::bindings::utils::{HasPropertyOnPrototype, IntVal, UintVal}', 'dom::bindings::utils::{Reflectable}', 'dom::bindings::utils::{squirrel_away_unique}', 'dom::bindings::utils::{ThrowingConstructor, unwrap, unwrap_jsmanaged}', @@ -5430,7 +5425,8 @@ class GlobalGenRoots(): def Bindings(config): descriptors = (set(d.name + "Binding" for d in config.getDescriptors(register=True)) | - set(d.unroll().module() for d in config.callbacks)) + set(d.unroll().module() for d in config.callbacks) | + set(d.module() for d in config.getDictionaries())) curr = CGList([CGGeneric("pub mod %s;\n" % name) for name in sorted(descriptors)]) curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT) return curr diff --git a/components/script/dom/bindings/codegen/parser/WebIDL.py b/components/script/dom/bindings/codegen/parser/WebIDL.py index 32f80e82c56..370ac7df7c0 100644 --- a/components/script/dom/bindings/codegen/parser/WebIDL.py +++ b/components/script/dom/bindings/codegen/parser/WebIDL.py @@ -1422,6 +1422,9 @@ class IDLDictionary(IDLObjectWithScope): self.identifier.name, [member.location] + locations) + def module(self): + return self.location.filename().split('/')[-1].split('.webidl')[0] + 'Binding' + def addExtendedAttributes(self, attrs): assert len(attrs) == 0 |