diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 824c7e18a4cf..2c097761cc43 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -1008,6 +1008,8 @@ class CGHeaders(CGWrapper): d.interface.hasInterfaceObject() and NeedsGeneratedHasInstance(d) and d.interface.hasInterfacePrototypeObject()) + if len(hasInstanceIncludes) > 0: + hasInstanceIncludes.add("nsContentUtils.h") # Now find all the things we'll need as arguments because we # need to wrap or unwrap them. @@ -13120,7 +13122,11 @@ class CGBindingRoot(CGThing): # interface object might have a ChromeOnly constructor. (desc.interface.hasInterfaceObject() and (desc.interface.isJSImplemented() or - (ctor and isChromeOnly(ctor))))) + (ctor and isChromeOnly(ctor)))) or + # JS-implemented interfaces with clearable cached + # attrs have chromeonly _clearFoo methods. + (desc.interface.isJSImplemented() and + any(clearableCachedAttrs(desc)))) bindingHeaders["nsContentUtils.h"] = any( descriptorHasChromeOnly(d) for d in descriptors)