Bug 1309147 - Part 3: Implement the support for CEReactions in Codegen.

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-04 10:28:38 -05:00 • committed by Roy Tam
commit 303037d0fc
8 changed files with 96 additions and 0 deletions

View file

@ -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()