diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-04 10:28:38 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:14 -0500 |
commit | df23f78ad16b40c244f518dba28a8555d61bdd0c (patch) | |
tree | 0d0806f435a548df4dd2d2af0df531e93bd3bc77 /dom/bindings/Codegen.py | |
parent | 20799ce18c18ff1ad3125ad4e8a7a679b57a858f (diff) | |
download | uxp-df23f78ad16b40c244f518dba28a8555d61bdd0c.tar.gz |
Bug 1309147 - Part 3: Implement the support for CEReactions in Codegen.
Tag UXP Issue #1344
Diffstat (limited to 'dom/bindings/Codegen.py')
-rw-r--r-- | dom/bindings/Codegen.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 6fd15ac90c..5bbf77bb60 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -7672,6 +7672,17 @@ class CGPerSignatureCall(CGThing): CGIfWrapper(CGList(xraySteps), "objIsXray")) + if (idlNode.getExtendedAttribute('CEReactions') is not None and + not getter): + cgThings.append(CGGeneric(fill( + """ + CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(${obj}); + Maybe<AutoCEReaction> ceReaction; + if (reactionsStack) { + ceReaction.emplace(reactionsStack); + } + """, obj=objectName))) + # If this is a method that was generated by a maplike/setlike # interface, use the maplike/setlike generator to fill in the body. # Otherwise, use CGCallGenerator to call the native method. @@ -13840,12 +13851,18 @@ class CGBindingRoot(CGThing): iface = desc.interface return any(m.getExtendedAttribute("Deprecated") for m in iface.members + [iface]) + def descriptorHasCEReactions(desc): + iface = desc.interface + return any(m.getExtendedAttribute("CEReactions") for m in iface.members + [iface]) + bindingHeaders["nsIDocument.h"] = any( descriptorDeprecated(d) for d in descriptors) bindingHeaders["mozilla/Preferences.h"] = any( descriptorRequiresPreferences(d) for d in descriptors) bindingHeaders["mozilla/dom/DOMJSProxyHandler.h"] = any( d.concrete and d.proxy for d in descriptors) + bindingHeaders["mozilla/dom/CustomElementRegistry.h"] = any( + descriptorHasCEReactions(d) for d in descriptors) def descriptorHasChromeOnly(desc): ctor = desc.interface.ctor() |