Bug 1276438 part 7. Get rid of nsIDOMHTMLDocument::GetBody. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 26 Jan 2018 00:53:35 -0500
changeset 748751 8e795b1484ebc0a72997edabe4c35040aea5d3b4
parent 748750 c5f9de9ad886275c5a90e953ec19c60d65a33797
child 748752 c6e0fe339cb1e7c0c029e68be5332e52f53ab6b7
push id97228
push usersfraser@mozilla.com
push dateTue, 30 Jan 2018 10:21:04 +0000
reviewersmystor
bugs1276438
milestone60.0a1
Bug 1276438 part 7. Get rid of nsIDOMHTMLDocument::GetBody. r=mystor MozReview-Commit-ID: 5XyZc8hQndQ
dom/html/nsHTMLDocument.cpp
dom/html/nsHTMLDocument.h
dom/interfaces/html/nsIDOMHTMLDocument.idl
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -1072,37 +1072,16 @@ nsHTMLDocument::SetDomain(const nsAStrin
     return;
   }
 
   NS_TryToSetImmutable(newURI);
   rv = NodePrincipal()->SetDomain(newURI);
 }
 
 NS_IMETHODIMP
-nsHTMLDocument::GetBody(nsIDOMHTMLElement** aBody)
-{
-  *aBody = nullptr;
-
-  nsIContent *body = GetBody();
-
-  return body ? CallQueryInterface(body, aBody) : NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
-{
-  nsCOMPtr<nsIContent> newBody = do_QueryInterface(aBody);
-  MOZ_ASSERT(!newBody || newBody->IsHTMLElement(),
-             "How could we be an nsIContent but not actually HTML here?");
-  ErrorResult rv;
-  SetBody(static_cast<nsGenericHTMLElement*>(newBody.get()), rv);
-  return rv.StealNSResult();
-}
-
-NS_IMETHODIMP
 nsHTMLDocument::GetHead(nsISupports** aHead)
 {
   *aHead = nullptr;
 
   Element* head = GetHeadElement();
 
   return head ? CallQueryInterface(head, aHead) : NS_OK;
 }
--- a/dom/html/nsHTMLDocument.h
+++ b/dom/html/nsHTMLDocument.h
@@ -167,18 +167,16 @@ public:
   bool IsRegistrableDomainSuffixOfOrEqualTo(const nsAString& aHostSuffixString,
                                             const nsACString& aOrigHost);
   void GetCookie(nsAString& aCookie, mozilla::ErrorResult& rv);
   void SetCookie(const nsAString& aCookie, mozilla::ErrorResult& rv);
   void NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
                    JS::MutableHandle<JSObject*> aRetval,
                    mozilla::ErrorResult& rv);
   void GetSupportedNames(nsTArray<nsString>& aNames);
-  using nsIDocument::GetBody;
-  using nsIDocument::SetBody;
   mozilla::dom::HTMLSharedElement *GetHead() {
     return static_cast<mozilla::dom::HTMLSharedElement*>(GetHeadElement());
   }
   nsIHTMLCollection* Images();
   nsIHTMLCollection* Embeds();
   nsIHTMLCollection* Plugins();
   nsIHTMLCollection* Links();
   nsIHTMLCollection* Forms()
--- a/dom/interfaces/html/nsIDOMHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDocument.idl
@@ -15,17 +15,16 @@ interface nsISelection;
 
 [uuid(cd31e61f-cfc2-4b91-9385-17b6a2d0633d)]
 interface nsIDOMHTMLDocument : nsIDOMDocument
 {
            attribute DOMString            domain;
            attribute DOMString            cookie;
 
   readonly attribute nsISupports          head;
-           attribute nsIDOMHTMLElement    body;
 
   // If aContentType is not something supported by nsHTMLDocument and
   // the HTML content sink, trying to write to the document will
   // probably throw.
   // Pass aReplace = true to trigger a replacement of the previous
   // document in session history; pass false for normal history handling.
   [implicit_jscontext, optional_argc]
   nsISupports               open([optional] in DOMString aContentTypeOrUrl,