michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsScriptElement_h michael@0: #define nsScriptElement_h michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsIScriptLoaderObserver.h" michael@0: #include "nsIScriptElement.h" michael@0: #include "nsStubMutationObserver.h" michael@0: michael@0: /** michael@0: * Baseclass useful for script elements (such as and michael@0: * ). Currently the class assumes that only the 'src' michael@0: * attribute and the children of the class affect what script to execute. michael@0: */ michael@0: michael@0: class nsScriptElement : public nsIScriptElement, michael@0: public nsStubMutationObserver michael@0: { michael@0: public: michael@0: // nsIScriptLoaderObserver michael@0: NS_DECL_NSISCRIPTLOADEROBSERVER michael@0: michael@0: // nsIMutationObserver michael@0: NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED michael@0: NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED michael@0: NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED michael@0: NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED michael@0: michael@0: nsScriptElement(mozilla::dom::FromParser aFromParser) michael@0: : nsIScriptElement(aFromParser) michael@0: { michael@0: } michael@0: michael@0: virtual nsresult FireErrorEvent() MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: // Internal methods michael@0: michael@0: /** michael@0: * Check if this element contains any script, linked or inline michael@0: */ michael@0: virtual bool HasScriptContent() = 0; michael@0: michael@0: virtual bool MaybeProcessScript() MOZ_OVERRIDE; michael@0: }; michael@0: michael@0: #endif // nsScriptElement_h