2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-08-13 23:57:41 -07:00
|
|
|
#ifndef nsScriptElement_h
|
|
|
|
#define nsScriptElement_h
|
|
|
|
|
2013-05-29 13:43:41 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIScriptLoaderObserver.h"
|
|
|
|
#include "nsIScriptElement.h"
|
|
|
|
#include "nsStubMutationObserver.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Baseclass useful for script elements (such as <xhtml:script> and
|
|
|
|
* <svg:script>). Currently the class assumes that only the 'src'
|
|
|
|
* attribute and the children of the class affect what script to execute.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nsScriptElement : public nsIScriptElement,
|
|
|
|
public nsStubMutationObserver
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// nsIScriptLoaderObserver
|
|
|
|
NS_DECL_NSISCRIPTLOADEROBSERVER
|
|
|
|
|
|
|
|
// nsIMutationObserver
|
2007-07-12 13:05:45 -07:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-09-01 17:49:25 -07:00
|
|
|
explicit nsScriptElement(mozilla::dom::FromParser aFromParser)
|
2010-09-01 04:41:12 -07:00
|
|
|
: nsIScriptElement(aFromParser)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-05-29 13:43:41 -07:00
|
|
|
virtual nsresult FireErrorEvent() MOZ_OVERRIDE;
|
2012-09-18 20:24:27 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
// Internal methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if this element contains any script, linked or inline
|
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool HasScriptContent() = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-05-29 13:43:41 -07:00
|
|
|
virtual bool MaybeProcessScript() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
2013-08-13 23:57:41 -07:00
|
|
|
|
|
|
|
#endif // nsScriptElement_h
|