content/base/src/nsScriptElement.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsScriptElement_h
     6 #define nsScriptElement_h
     8 #include "mozilla/Attributes.h"
     9 #include "nsIScriptLoaderObserver.h"
    10 #include "nsIScriptElement.h"
    11 #include "nsStubMutationObserver.h"
    13 /**
    14  * Baseclass useful for script elements (such as <xhtml:script> and
    15  * <svg:script>). Currently the class assumes that only the 'src'
    16  * attribute and the children of the class affect what script to execute.
    17  */
    19 class nsScriptElement : public nsIScriptElement,
    20                         public nsStubMutationObserver
    21 {
    22 public:
    23   // nsIScriptLoaderObserver
    24   NS_DECL_NSISCRIPTLOADEROBSERVER
    26   // nsIMutationObserver
    27   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
    28   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
    29   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
    30   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
    32   nsScriptElement(mozilla::dom::FromParser aFromParser)
    33     : nsIScriptElement(aFromParser)
    34   {
    35   }
    37   virtual nsresult FireErrorEvent() MOZ_OVERRIDE;
    39 protected:
    40   // Internal methods
    42   /**
    43    * Check if this element contains any script, linked or inline
    44    */
    45   virtual bool HasScriptContent() = 0;
    47   virtual bool MaybeProcessScript() MOZ_OVERRIDE;
    48 };
    50 #endif // nsScriptElement_h

mercurial