content/base/src/nsScriptElement.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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