Bug 1415747 - Remove nsIDOMHTMLScriptElement draft
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 08 Nov 2017 19:02:14 -0800
changeset 695868 a817458ef58c10b3f32872cfd75601859630913e
parent 695797 ffe9d44334b9d253334a093e1c04e676db4cc83b
child 695988 1e5e36653b586af29a11c1ec7668d9a9a2a09875
push id88575
push userbmo:kyle@nonpolynomial.com
push dateThu, 09 Nov 2017 23:28:09 +0000
bugs1415747
milestone58.0a1
Bug 1415747 - Remove nsIDOMHTMLScriptElement MozReview-Commit-ID: 3I7qVTsKFJC
dom/html/HTMLScriptElement.cpp
dom/html/HTMLScriptElement.h
dom/interfaces/html/moz.build
dom/interfaces/html/nsIDOMHTMLScriptElement.idl
dom/script/ScriptLoader.cpp
dom/script/nsIScriptElement.h
dom/svg/SVGScriptElement.h
dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
dom/webidl/HTMLScriptElement.webidl
editor/libeditor/HTMLEditorDataTransfer.cpp
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/dom/html/HTMLScriptElement.cpp
+++ b/dom/html/HTMLScriptElement.cpp
@@ -43,17 +43,16 @@ HTMLScriptElement::HTMLScriptElement(alr
   AddMutationObserver(this);
 }
 
 HTMLScriptElement::~HTMLScriptElement()
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(HTMLScriptElement, nsGenericHTMLElement,
-                            nsIDOMHTMLScriptElement,
                             nsIScriptLoaderObserver,
                             nsIScriptElement,
                             nsIMutationObserver)
 
 nsresult
 HTMLScriptElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers)
@@ -110,133 +109,16 @@ HTMLScriptElement::Clone(mozilla::dom::N
   it->mLineNumber = mLineNumber;
   it->mMalformed = mMalformed;
 
   kungFuDeathGrip.swap(*aResult);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-HTMLScriptElement::GetText(nsAString& aValue)
-{
-  if (!nsContentUtils::GetNodeTextContent(this, false, aValue, fallible)) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLScriptElement::SetText(const nsAString& aValue)
-{
-  ErrorResult rv;
-  SetText(aValue, rv);
-  return rv.StealNSResult();
-}
-
-void
-HTMLScriptElement::SetText(const nsAString& aValue, ErrorResult& rv)
-{
-  rv = nsContentUtils::SetNodeTextContent(this, aValue, true);
-}
-
-
-NS_IMPL_STRING_ATTR(HTMLScriptElement, Charset, charset)
-NS_IMPL_BOOL_ATTR(HTMLScriptElement, Defer, defer)
-// If this ever gets changed to return "" if the attr value is "" (see
-// https://github.com/whatwg/html/issues/1739 for why it might not get changed),
-// it may be worth it to use GetSrc instead of GetAttr and manual
-// NewURIWithDocumentCharset in FreezeUriAsyncDefer.
-NS_IMPL_URI_ATTR(HTMLScriptElement, Src, src)
-NS_IMPL_STRING_ATTR(HTMLScriptElement, Type, type)
-NS_IMPL_STRING_ATTR(HTMLScriptElement, HtmlFor, _for)
-NS_IMPL_STRING_ATTR(HTMLScriptElement, Event, event)
-
-void
-HTMLScriptElement::SetCharset(const nsAString& aCharset, ErrorResult& rv)
-{
-  SetHTMLAttr(nsGkAtoms::charset, aCharset, rv);
-}
-
-void
-HTMLScriptElement::SetDefer(bool aDefer, ErrorResult& rv)
-{
-  SetHTMLBoolAttr(nsGkAtoms::defer, aDefer, rv);
-}
-
-bool
-HTMLScriptElement::Defer()
-{
-  return GetBoolAttr(nsGkAtoms::defer);
-}
-
-void
-HTMLScriptElement::SetSrc(const nsAString& aSrc, nsIPrincipal& aTriggeringPrincipal, ErrorResult& rv)
-{
-  SetHTMLAttr(nsGkAtoms::src, aSrc, aTriggeringPrincipal, rv);
-}
-
-void
-HTMLScriptElement::SetType(const nsAString& aType, ErrorResult& rv)
-{
-  SetHTMLAttr(nsGkAtoms::type, aType, rv);
-}
-
-void
-HTMLScriptElement::SetHtmlFor(const nsAString& aHtmlFor, ErrorResult& rv)
-{
-  SetHTMLAttr(nsGkAtoms::_for, aHtmlFor, rv);
-}
-
-void
-HTMLScriptElement::SetEvent(const nsAString& aEvent, ErrorResult& rv)
-{
-  SetHTMLAttr(nsGkAtoms::event, aEvent, rv);
-}
-
-nsresult
-HTMLScriptElement::GetAsync(bool* aValue)
-{
-  *aValue = Async();
-  return NS_OK;
-}
-
-bool
-HTMLScriptElement::Async()
-{
-  return mForceAsync || GetBoolAttr(nsGkAtoms::async);
-}
-
-nsresult
-HTMLScriptElement::SetAsync(bool aValue)
-{
-  ErrorResult rv;
-  SetAsync(aValue, rv);
-  return rv.StealNSResult();
-}
-
-void
-HTMLScriptElement::SetAsync(bool aValue, ErrorResult& rv)
-{
-  mForceAsync = false;
-  SetHTMLBoolAttr(nsGkAtoms::async, aValue, rv);
-}
-
-bool
-HTMLScriptElement::NoModule()
-{
-  return GetBoolAttr(nsGkAtoms::nomodule);
-}
-
-void
-HTMLScriptElement::SetNoModule(bool aValue, ErrorResult& aRv)
-{
-  SetHTMLBoolAttr(nsGkAtoms::nomodule, aValue, aRv);
-}
-
 nsresult
 HTMLScriptElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
                                 const nsAttrValue* aValue,
                                 const nsAttrValue* aOldValue,
                                 nsIPrincipal* aMaybeScriptedPrincipal,
                                 bool aNotify)
 {
   if (nsGkAtoms::async == aName && kNameSpaceID_None == aNamespaceID) {
@@ -276,17 +158,18 @@ bool
 HTMLScriptElement::GetScriptType(nsAString& type)
 {
   return GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
 }
 
 void
 HTMLScriptElement::GetScriptText(nsAString& text)
 {
-  GetText(text);
+  IgnoredErrorResult rv;
+  GetText(text, rv);
 }
 
 void
 HTMLScriptElement::GetScriptCharset(nsAString& charset)
 {
   GetCharset(charset);
 }
 
@@ -325,19 +208,18 @@ HTMLScriptElement::FreezeUriAsyncDefer()
         nsContentUtils::eDOM_PROPERTIES, "ScriptSourceEmpty",
         params, ArrayLength(params), nullptr,
         EmptyString(), GetScriptLineNumber());
     }
 
     // At this point mUri will be null for invalid URLs.
     mExternal = true;
 
-    bool defer, async;
-    GetAsync(&async);
-    GetDefer(&defer);
+    bool async = Async();
+    bool defer = Defer();
 
     mDefer = !async && defer;
     mAsync = async;
   }
 
   mFrozen = true;
 }
 
--- a/dom/html/HTMLScriptElement.h
+++ b/dom/html/HTMLScriptElement.h
@@ -2,45 +2,40 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef mozilla_dom_HTMLScriptElement_h
 #define mozilla_dom_HTMLScriptElement_h
 
-#include "nsIDOMHTMLScriptElement.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/ScriptElement.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLScriptElement final : public nsGenericHTMLElement,
-                                public nsIDOMHTMLScriptElement,
                                 public ScriptElement
 {
 public:
   using Element::GetText;
   using Element::SetText;
 
   HTMLScriptElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                     FromParser aFromParser);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML) override;
   virtual void SetInnerHTML(const nsAString& aInnerHTML,
                             mozilla::ErrorResult& aError) override;
 
-  // nsIDOMHTMLScriptElement
-  NS_DECL_NSIDOMHTMLSCRIPTELEMENT
-
   // nsIScriptElement
   virtual bool GetScriptType(nsAString& type) override;
   virtual void GetScriptText(nsAString& text) override;
   virtual void GetScriptCharset(nsAString& charset) override;
   virtual void FreezeUriAsyncDefer() override;
   virtual CORSMode GetCORSMode() const override;
 
   // nsIContent
@@ -58,55 +53,135 @@ public:
   // Element
   virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
                                 const nsAttrValue* aValue,
                                 const nsAttrValue* aOldValue,
                                 nsIPrincipal* aMaybeScriptedPrincipal,
                                 bool aNotify) override;
 
   // WebIDL
-  void SetText(const nsAString& aValue, ErrorResult& rv);
-  void SetCharset(const nsAString& aCharset, ErrorResult& rv);
-  void SetDefer(bool aDefer, ErrorResult& rv);
-  bool Defer();
-  void SetSrc(const nsAString& aSrc, nsIPrincipal& aTriggeringPrincipal, ErrorResult& rv);
-  void GetSrc(nsString& aSrc, nsIPrincipal&)
+  void GetText(nsAString& aValue, ErrorResult& aRv)
+  {
+    if (!nsContentUtils::GetNodeTextContent(this, false, aValue, fallible)) {
+      aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+    }
+  }
+
+  void SetText(const nsAString& aValue, ErrorResult& aRv)
+  {
+    aRv = nsContentUtils::SetNodeTextContent(this, aValue, true);
+  }
+
+  void GetCharset(nsAString& aCharset)
+  {
+    GetHTMLAttr(nsGkAtoms::charset, aCharset);
+  }
+  void SetCharset(const nsAString& aCharset, ErrorResult& aRv)
+  {
+    SetHTMLAttr(nsGkAtoms::charset, aCharset, aRv);
+  }
+
+  bool Defer()
+  {
+    return GetBoolAttr(nsGkAtoms::defer);
+  }
+  void SetDefer(bool aDefer, ErrorResult& aRv)
+  {
+    SetHTMLBoolAttr(nsGkAtoms::defer, aDefer, aRv);
+  }
+
+  void GetSrc(nsAString& aSrc, nsIPrincipal&)
   {
     GetSrc(aSrc);
-  };
-  void SetType(const nsAString& aType, ErrorResult& rv);
-  void SetHtmlFor(const nsAString& aHtmlFor, ErrorResult& rv);
-  void SetEvent(const nsAString& aEvent, ErrorResult& rv);
+  }
+  void GetSrc(nsAString& aSrc)
+  {
+    GetURIAttr(nsGkAtoms::src, nullptr, aSrc);
+  }
+  void SetSrc(const nsAString& aSrc, nsIPrincipal& aTriggeringPrincipal, ErrorResult& aRv)
+  {
+    SetHTMLAttr(nsGkAtoms::src, aSrc, aTriggeringPrincipal, aRv);
+  }
+
+  void GetType(nsAString& aType)
+  {
+    GetHTMLAttr(nsGkAtoms::type, aType);
+  }
+  void SetType(const nsAString& aType, ErrorResult& aRv)
+  {
+    SetHTMLAttr(nsGkAtoms::type, aType, aRv);
+  }
+
+  void GetHtmlFor(nsAString& aHtmlFor)
+  {
+    GetHTMLAttr(nsGkAtoms::_for, aHtmlFor);
+  }
+  void SetHtmlFor(const nsAString& aHtmlFor, ErrorResult& aRv)
+  {
+    SetHTMLAttr(nsGkAtoms::_for, aHtmlFor, aRv);
+  }
+
+  void GetEvent(nsAString& aEvent)
+  {
+    GetHTMLAttr(nsGkAtoms::event, aEvent);
+  }
+  void SetEvent(const nsAString& aEvent, ErrorResult& aRv)
+  {
+    SetHTMLAttr(nsGkAtoms::event, aEvent, aRv);
+  }
+
+  bool Async()
+  {
+    return mForceAsync || GetBoolAttr(nsGkAtoms::async);
+  }
+
+  void SetAsync(bool aValue, ErrorResult& aRv)
+  {
+    mForceAsync = false;
+    SetHTMLBoolAttr(nsGkAtoms::async, aValue, aRv);
+  }
+
+  bool NoModule()
+  {
+    return GetBoolAttr(nsGkAtoms::nomodule);
+  }
+
+  void SetNoModule(bool aValue, ErrorResult& aRv)
+  {
+    SetHTMLBoolAttr(nsGkAtoms::nomodule, aValue, aRv);
+  }
+
   void GetCrossOrigin(nsAString& aResult)
   {
     // Null for both missing and invalid defaults is ok, since we
     // always parse to an enum value, so we don't need an invalid
     // default, and we _want_ the missing default to be null.
     GetEnumAttr(nsGkAtoms::crossorigin, nullptr, aResult);
   }
   void SetCrossOrigin(const nsAString& aCrossOrigin, ErrorResult& aError)
   {
     SetOrRemoveNullableStringAttr(nsGkAtoms::crossorigin, aCrossOrigin, aError);
   }
   void GetIntegrity(nsAString& aIntegrity)
   {
     GetHTMLAttr(nsGkAtoms::integrity, aIntegrity);
   }
-  void SetIntegrity(const nsAString& aIntegrity, ErrorResult& rv)
+  void SetIntegrity(const nsAString& aIntegrity, ErrorResult& aRv)
   {
-    SetHTMLAttr(nsGkAtoms::integrity, aIntegrity, rv);
+    SetHTMLAttr(nsGkAtoms::integrity, aIntegrity, aRv);
   }
-  bool Async();
-  void SetAsync(bool aValue, ErrorResult& rv);
-  bool NoModule();
-  void SetNoModule(bool aValue, ErrorResult& rv);
 
 protected:
   virtual ~HTMLScriptElement();
 
+  virtual bool GetAsyncState() override
+  {
+    return Async();
+  }
+
   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   // ScriptElement
   virtual bool HasScriptContent() override;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -11,17 +11,16 @@ XPIDL_SOURCES += [
     'nsIDOMHTMLBaseElement.idl',
     'nsIDOMHTMLCollection.idl',
     'nsIDOMHTMLDocument.idl',
     'nsIDOMHTMLElement.idl',
     'nsIDOMHTMLFormElement.idl',
     'nsIDOMHTMLHtmlElement.idl',
     'nsIDOMHTMLInputElement.idl',
     'nsIDOMHTMLMediaElement.idl',
-    'nsIDOMHTMLScriptElement.idl',
     'nsIDOMMozBrowserFrame.idl',
     'nsIDOMTimeRanges.idl',
     'nsIDOMValidityState.idl',
     'nsIMozBrowserFrame.idl',
 ]
 
 XPIDL_MODULE = 'dom_html'
 
deleted file mode 100644
--- a/dom/interfaces/html/nsIDOMHTMLScriptElement.idl
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "nsIDOMHTMLElement.idl"
-
-/**
- * The nsIDOMHTMLScriptElement interface is the interface to a [X]HTML
- * script element.
- *
- * This interface is trying to follow the DOM Level 2 HTML specification:
- * http://www.w3.org/TR/DOM-Level-2-HTML/
- *
- * with changes from the work-in-progress WHATWG HTML specification:
- * http://www.whatwg.org/specs/web-apps/current-work/
- */
-
-[uuid(fe96dc1c-40e4-4974-9354-e3fce663c3d5)]
-interface nsIDOMHTMLScriptElement : nsISupports
-{
-           attribute DOMString        src;
-           attribute boolean          async;
-           attribute boolean          defer;
-           attribute DOMString        type;
-           attribute DOMString        charset;
-           attribute DOMString        text;
-
-           attribute DOMString        htmlFor;
-           attribute DOMString        event;
-};
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -32,17 +32,16 @@
 #include "nsJSPrincipals.h"
 #include "nsContentPolicyUtils.h"
 #include "nsIHttpChannel.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIClassOfService.h"
 #include "nsICacheInfoChannel.h"
 #include "nsITimedChannel.h"
 #include "nsIScriptElement.h"
-#include "nsIDOMHTMLScriptElement.h"
 #include "nsIDocShell.h"
 #include "nsContentUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsAutoPtr.h"
 #include "nsIXPConnect.h"
 #include "nsError.h"
 #include "nsThreadUtils.h"
 #include "nsDocShellCID.h"
--- a/dom/script/nsIScriptElement.h
+++ b/dom/script/nsIScriptElement.h
@@ -8,18 +8,18 @@
 #define nsIScriptElement_h___
 
 #include "nsISupports.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsIScriptLoaderObserver.h"
 #include "nsWeakPtr.h"
 #include "nsIParser.h"
+#include "nsIContent.h"
 #include "nsContentCreatorFunctions.h"
-#include "nsIDOMHTMLScriptElement.h"
 #include "mozilla/CORSMode.h"
 
 #define NS_ISCRIPTELEMENT_IID \
 { 0xe60fca9b, 0x1b96, 0x4e4e, \
  { 0xa9, 0xb4, 0xdc, 0x98, 0x4f, 0x88, 0x3f, 0x9c } }
 
 /**
  * Internal interface implemented by script elements
@@ -148,19 +148,19 @@ public:
 
   void LoseParserInsertedness()
   {
     mFrozen = false;
     mUri = nullptr;
     mCreatorParser = nullptr;
     mParserCreated = mozilla::dom::NOT_FROM_PARSER;
     bool async = false;
-    nsCOMPtr<nsIDOMHTMLScriptElement> htmlScript = do_QueryInterface(this);
-    if (htmlScript) {
-      htmlScript->GetAsync(&async);
+    nsCOMPtr<nsIContent> content = do_QueryInterface(this);
+    if (content->IsHTMLElement(nsGkAtoms::script)) {
+      async = GetAsyncState();
     }
     mForceAsync = !async;
   }
 
   void SetCreatorParser(nsIParser* aParser)
   {
     mCreatorParser = do_GetWeakReference(aParser);
   }
@@ -266,16 +266,22 @@ protected:
    * document-tree.
    *
    * @return whether the parser will be blocked while this script is being
    *         loaded
    */
   virtual bool MaybeProcessScript() = 0;
 
   /**
+   * Since we've removed the XPCOM interface to HTML elements, we need a way to
+   * retreive async state from script elements without bringing the type in.
+   */
+  virtual bool GetAsyncState() = 0;
+
+  /**
    * The start line number of the script.
    */
   uint32_t mLineNumber;
 
   /**
    * The "already started" flag per HTML5.
    */
   bool mAlreadyStarted;
--- a/dom/svg/SVGScriptElement.h
+++ b/dom/svg/SVGScriptElement.h
@@ -74,16 +74,23 @@ public:
   void SetCrossOrigin(const nsAString & aCrossOrigin, ErrorResult& aError);
   already_AddRefed<SVGAnimatedString> Href();
 
 protected:
   ~SVGScriptElement();
 
   virtual StringAttributesInfo GetStringInfo() override;
 
+  // SVG Script elements don't have the ability to set async properties on
+  // themselves, so this will always return false.
+  virtual bool GetAsyncState() override
+  {
+    return mAsync;
+  }
+
   enum { HREF, XLINK_HREF };
   nsSVGString mStringAttributes[2];
   static StringInfo sStringInfo[2];
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
@@ -25,17 +25,16 @@
 #include "nsIDOMAttr.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLBaseElement.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
-#include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMTreeWalker.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
@@ -509,18 +508,17 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode
     if (content->IsHTMLElement(nsGkAtoms::tr)) {
         return OnWalkAttribute(aNode, "background");
     }
 
     if (content->IsAnyOfHTMLElements(nsGkAtoms::td, nsGkAtoms::th)) {
         return OnWalkAttribute(aNode, "background");
     }
 
-    nsCOMPtr<nsIDOMHTMLScriptElement> nodeAsScript = do_QueryInterface(aNode);
-    if (nodeAsScript) {
+    if (content->IsHTMLElement(nsGkAtoms::script)) {
         return OnWalkAttribute(aNode, "src");
     }
 
     if (content->IsSVGElement(nsGkAtoms::script)) {
         return OnWalkAttribute(aNode, "href", "http://www.w3.org/1999/xlink");
     }
 
     if (content->IsHTMLElement(nsGkAtoms::embed)) {
@@ -1026,18 +1024,17 @@ PersistNodeFixup::FixupNode(nsIDOMNode *
                 imgCon->SetLoadingEnabled(false);
 
             // FixupAnchor(*aNodeOut);  // XXXjwatt: is this line needed?
             FixupAttribute(*aNodeOut, "href", "http://www.w3.org/1999/xlink");
         }
         return rv;
     }
 
-    nsCOMPtr<nsIDOMHTMLScriptElement> nodeAsScript = do_QueryInterface(aNodeIn);
-    if (nodeAsScript) {
+    if (content->IsHTMLElement(nsGkAtoms::script)) {
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut) {
             FixupAttribute(*aNodeOut, "src");
         }
         return rv;
     }
 
     if (content->IsSVGElement(nsGkAtoms::script)) {
--- a/dom/webidl/HTMLScriptElement.webidl
+++ b/dom/webidl/HTMLScriptElement.webidl
@@ -19,17 +19,17 @@ interface HTMLScriptElement : HTMLElemen
   [CEReactions, SetterThrows]
   attribute DOMString charset;
   [CEReactions, SetterThrows]
   attribute boolean async;
   [CEReactions, SetterThrows]
   attribute boolean defer;
   [CEReactions, SetterThrows]
   attribute DOMString? crossOrigin;
-  [CEReactions, SetterThrows]
+  [CEReactions, Throws]
   attribute DOMString text;
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLScriptElement {
   [CEReactions, SetterThrows]
   attribute DOMString event;
   [CEReactions, SetterThrows]
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -36,17 +36,16 @@
 #include "nsIClipboard.h"
 #include "nsIContent.h"
 #include "nsIContentFilter.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentFragment.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMHTMLInputElement.h"
-#include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMNode.h"
 #include "nsIDocument.h"
 #include "nsIEditRules.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIMIMEService.h"
 #include "nsNameSpaceManager.h"
 #include "nsINode.h"
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -48,17 +48,16 @@
 #include "nsIDOMHTMLBaseElement.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIDOMHTMLHtmlElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
-#include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMediaList.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeIterator.h"
@@ -147,17 +146,16 @@
 #include "mozilla/dom/HTMLCollectionBinding.h"
 #include "mozilla/dom/HTMLDocumentBinding.h"
 #include "mozilla/dom/HTMLElementBinding.h"
 #include "mozilla/dom/HTMLFormElementBinding.h"
 #include "mozilla/dom/HTMLFrameSetElementBinding.h"
 #include "mozilla/dom/HTMLHtmlElementBinding.h"
 #include "mozilla/dom/HTMLInputElementBinding.h"
 #include "mozilla/dom/HTMLMediaElementBinding.h"
-#include "mozilla/dom/HTMLScriptElementBinding.h"
 #include "mozilla/dom/KeyEventBinding.h"
 #include "mozilla/dom/ListBoxObjectBinding.h"
 #include "mozilla/dom/MediaListBinding.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/MenuBoxObjectBinding.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 #include "mozilla/dom/MutationEventBinding.h"
@@ -298,17 +296,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(HTMLBaseElement),
   DEFINE_SHIM(HTMLCollection),
   DEFINE_SHIM(HTMLDocument),
   DEFINE_SHIM(HTMLElement),
   DEFINE_SHIM(HTMLFormElement),
   DEFINE_SHIM(HTMLHtmlElement),
   DEFINE_SHIM(HTMLInputElement),
   DEFINE_SHIM(HTMLMediaElement),
-  DEFINE_SHIM(HTMLScriptElement),
   DEFINE_SHIM(KeyEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject),
   DEFINE_SHIM(MediaList),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIMenuBoxObject, MenuBoxObject),
   DEFINE_SHIM(MouseEvent),
   DEFINE_SHIM(MouseScrollEvent),
   DEFINE_SHIM(MutationEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMMozNamedAttrMap, NamedNodeMap),