2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00: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 05:45:02 +00:00
|
|
|
|
2013-08-14 06:57:41 +00:00
|
|
|
#ifndef nsScriptElement_h
|
|
|
|
#define nsScriptElement_h
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2006-11-04 05:45:02 +00: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 20:05:45 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
2006-11-04 05:45:02 +00:00
|
|
|
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit nsScriptElement(mozilla::dom::FromParser aFromParser)
|
2010-09-01 11:41:12 +00:00
|
|
|
: nsIScriptElement(aFromParser)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult FireErrorEvent() override;
|
2012-09-19 03:24:27 +00:00
|
|
|
|
2006-11-04 05:45:02 +00:00
|
|
|
protected:
|
|
|
|
// Internal methods
|
|
|
|
|
2006-11-09 00:02:21 +00:00
|
|
|
/**
|
|
|
|
* Check if this element contains any script, linked or inline
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool HasScriptContent() = 0;
|
2006-11-09 00:02:21 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool MaybeProcessScript() override;
|
2006-11-04 05:45:02 +00:00
|
|
|
};
|
2013-08-14 06:57:41 +00:00
|
|
|
|
|
|
|
#endif // nsScriptElement_h
|