2012-05-21 15:12:37 +04: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/. */
|
2006-11-04 08:45:02 +03:00
|
|
|
|
2013-08-14 10:57:41 +04:00
|
|
|
#ifndef nsScriptElement_h
|
|
|
|
#define nsScriptElement_h
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2006-11-04 08:45:02 +03: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-13 00:05:45 +04:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
2006-11-04 08:45:02 +03:00
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsScriptElement(mozilla::dom::FromParser aFromParser)
|
2010-09-01 15:41:12 +04:00
|
|
|
: nsIScriptElement(aFromParser)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult FireErrorEvent() override;
|
2012-09-19 07:24:27 +04:00
|
|
|
|
2006-11-04 08:45:02 +03:00
|
|
|
protected:
|
|
|
|
// Internal methods
|
|
|
|
|
2006-11-09 03:02:21 +03:00
|
|
|
/**
|
|
|
|
* Check if this element contains any script, linked or inline
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool HasScriptContent() = 0;
|
2006-11-09 03:02:21 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool MaybeProcessScript() override;
|
2006-11-04 08:45:02 +03:00
|
|
|
};
|
2013-08-14 10:57:41 +04:00
|
|
|
|
|
|
|
#endif // nsScriptElement_h
|