Bug 1415588 part 2. Move the .images, .embeds, .plugins, .forms, .scripts, .applets getters from HTMLDocument to Document. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 12 Mar 2018 21:44:56 -0400
changeset 766581 db4db89581e020dfdfa027d38763db76b0070793
parent 766580 f280eacb2abefbef7857fa55efeb7a436d72f46f
child 766582 6dfa6b890a139b2eb14c0367faa87cb9d799d1f3
push id102360
push usernnethercote@mozilla.com
push dateTue, 13 Mar 2018 01:59:25 +0000
reviewersmystor
bugs1415588
milestone61.0a1
Bug 1415588 part 2. Move the .images, .embeds, .plugins, .forms, .scripts, .applets getters from HTMLDocument to Document. r=mystor MozReview-Commit-ID: Db7iazZUz8g
dom/base/nsContentList.cpp
dom/base/nsDocument.cpp
dom/base/nsIDocument.h
dom/html/nsHTMLDocument.cpp
dom/html/nsHTMLDocument.h
dom/webidl/Document.webidl
dom/webidl/HTMLDocument.webidl
testing/web-platform/meta/html/dom/interfaces.html.ini
testing/web-platform/tests/xhr/responsexml-document-properties.htm
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -143,26 +143,27 @@ JSObject*
 nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
   return NodeListBinding::Wrap(cx, this, aGivenProto);
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(nsEmptyContentList, nsBaseContentList, mRoot)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsEmptyContentList)
+  NS_INTERFACE_MAP_ENTRY(nsIHTMLCollection)
 NS_INTERFACE_MAP_END_INHERITING(nsBaseContentList)
 
 
 NS_IMPL_ADDREF_INHERITED(nsEmptyContentList, nsBaseContentList)
 NS_IMPL_RELEASE_INHERITED(nsEmptyContentList, nsBaseContentList)
 
 JSObject*
 nsEmptyContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NodeListBinding::Wrap(cx, this, aGivenProto);
+  return HTMLCollectionBinding::Wrap(cx, this, aGivenProto);
 }
 
 NS_IMETHODIMP
 nsEmptyContentList::GetLength(uint32_t* aLength)
 {
   *aLength = 0;
 
   return NS_OK;
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1969,16 +1969,21 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOrientationPendingPromise)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOriginalDocument)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedEncoder)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStateObjectCached)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocumentTimeline)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPendingAnimationTracker)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTemplateContentsOwner)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChildrenCollection)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImages);
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEmbeds);
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mForms);
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mScripts);
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mApplets);
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnonymousContents)
 
   // Traverse all our nsCOMArrays.
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnDemandBuiltInUASheets)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPreloadingImages)
 
   for (uint32_t i = 0; i < tmp->mFrameRequestCallbacks.Length(); ++i) {
@@ -2059,16 +2064,21 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mMaybeEndOutermostXBLUpdateRunner)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDOMImplementation)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mImageMaps)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mCachedEncoder)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocumentTimeline)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPendingAnimationTracker)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mTemplateContentsOwner)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mChildrenCollection)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mImages);
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mEmbeds);
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mForms);
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mScripts);
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mApplets);
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mOrientationPendingPromise)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mFontFaceSet)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mReadyForIdle);
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mAboutCapabilities)
 
   tmp->mParentDocument = nullptr;
 
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPreloadingImages)
@@ -6802,16 +6812,63 @@ nsIDocument::SetDir(const nsAString& aDi
 {
   Element* rootElement = GetHtmlElement();
   if (rootElement) {
     rootElement->SetAttr(kNameSpaceID_None, nsGkAtoms::dir,
                          aDirection, true);
   }
 }
 
+nsIHTMLCollection*
+nsIDocument::Images()
+{
+  if (!mImages) {
+    mImages = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::img, nsGkAtoms::img);
+  }
+  return mImages;
+}
+
+nsIHTMLCollection*
+nsIDocument::Embeds()
+{
+  if (!mEmbeds) {
+    mEmbeds = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::embed, nsGkAtoms::embed);
+  }
+  return mEmbeds;
+}
+
+nsIHTMLCollection*
+nsIDocument::Forms()
+{
+  if (!mForms) {
+    // Please keep this in sync with nsHTMLDocument::GetFormsAndFormControls.
+    mForms = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::form, nsGkAtoms::form);
+  }
+
+  return mForms;
+}
+
+nsIHTMLCollection*
+nsIDocument::Scripts()
+{
+  if (!mScripts) {
+    mScripts = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::script, nsGkAtoms::script);
+  }
+  return mScripts;
+}
+
+nsIHTMLCollection*
+nsIDocument::Applets()
+{
+  if (!mApplets) {
+    mApplets = new nsEmptyContentList(this);
+  }
+  return mApplets;
+}
+
 /* static */
 bool
 nsIDocument::MatchNameAttribute(Element* aElement, int32_t aNamespaceID,
                                 nsAtom* aAtom, void* aData)
 {
   NS_PRECONDITION(aElement, "Must have element to work with!");
 
   if (!aElement->HasName()) {
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3278,30 +3278,39 @@ public:
 
   already_AddRefed<mozilla::dom::AboutCapabilities> GetAboutCapabilities(
     ErrorResult& aRv);
 
   void GetTitle(nsAString& aTitle);
   void SetTitle(const nsAString& aTitle, mozilla::ErrorResult& rv);
   void GetDir(nsAString& aDirection) const;
   void SetDir(const nsAString& aDirection);
+  nsIHTMLCollection* Images();
+  nsIHTMLCollection* Embeds();
+  nsIHTMLCollection* Plugins()
+  {
+    return Embeds();
+  }
+  nsIHTMLCollection* Forms();
+  nsIHTMLCollection* Scripts();
   already_AddRefed<nsContentList> GetElementsByName(const nsAString& aName)
   {
     return GetFuncStringContentList<nsCachableElementsByNameNodeList>(this,
                                                                       MatchNameAttribute,
                                                                       nullptr,
                                                                       UseExistingNameString,
                                                                       aName);
   }
   nsPIDOMWindowOuter* GetDefaultView() const
   {
     return GetWindow();
   }
   Element* GetActiveElement();
   bool HasFocus(mozilla::ErrorResult& rv) const;
+  nsIHTMLCollection* Applets();
   mozilla::TimeStamp LastFocusTime() const;
   void SetLastFocusTime(const mozilla::TimeStamp& aFocusTime);
   // Event handlers are all on nsINode already
   bool MozSyntheticDocument() const
   {
     return IsSyntheticDocument();
   }
   Element* GetCurrentScript();
@@ -3869,16 +3878,23 @@ protected:
 
   // Table of element properties for this document.
   nsPropertyTable mPropertyTable;
   nsTArray<nsAutoPtr<nsPropertyTable> > mExtraPropertyTables;
 
   // Our cached .children collection
   nsCOMPtr<nsIHTMLCollection> mChildrenCollection;
 
+  // Various DOM lists
+  RefPtr<nsContentList> mImages;
+  RefPtr<nsContentList> mEmbeds;
+  RefPtr<nsContentList> mForms;
+  RefPtr<nsContentList> mScripts;
+  nsCOMPtr<nsIHTMLCollection> mApplets;
+
   // container for per-context fonts (downloadable, SVG, etc.)
   RefPtr<mozilla::dom::FontFaceSet> mFontFaceSet;
 
   // Last time this document or a one of its sub-documents was focused.  If
   // focus has never occurred then mLastFocusTime.IsNull() will be true.
   mozilla::TimeStamp mLastFocusTime;
 
   mozilla::EventStates mDocumentState;
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -191,23 +191,18 @@ nsHTMLDocument::nsHTMLDocument()
 }
 
 nsHTMLDocument::~nsHTMLDocument()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, nsDocument,
                                    mAll,
-                                   mImages,
-                                   mApplets,
-                                   mEmbeds,
                                    mLinks,
                                    mAnchors,
-                                   mScripts,
-                                   mForms,
                                    mWyciwygChannel,
                                    mMidasCommandManager)
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(nsHTMLDocument,
                                              nsDocument,
                                              nsIHTMLDocument)
 
 JSObject*
@@ -1048,34 +1043,16 @@ nsHTMLDocument::SetDomain(const nsAStrin
     rv.Throw(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN);
     return;
   }
 
   NS_TryToSetImmutable(newURI);
   rv = NodePrincipal()->SetDomain(newURI);
 }
 
-nsIHTMLCollection*
-nsHTMLDocument::Images()
-{
-  if (!mImages) {
-    mImages = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::img, nsGkAtoms::img);
-  }
-  return mImages;
-}
-
-nsIHTMLCollection*
-nsHTMLDocument::Applets()
-{
-  if (!mApplets) {
-    mApplets = new nsEmptyContentList(this);
-  }
-  return mApplets;
-}
-
 bool
 nsHTMLDocument::MatchLinks(Element* aElement, int32_t aNamespaceID,
                            nsAtom* aAtom, void* aData)
 {
   nsIDocument* doc = aElement->GetUncomposedDoc();
 
   if (doc) {
     NS_ASSERTION(aElement->IsInUncomposedDoc(),
@@ -1140,25 +1117,16 @@ nsIHTMLCollection*
 nsHTMLDocument::Anchors()
 {
   if (!mAnchors) {
     mAnchors = new nsContentList(this, MatchAnchors, nullptr, nullptr);
   }
   return mAnchors;
 }
 
-nsIHTMLCollection*
-nsHTMLDocument::Scripts()
-{
-  if (!mScripts) {
-    mScripts = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::script, nsGkAtoms::script);
-  }
-  return mScripts;
-}
-
 already_AddRefed<nsIChannel>
 nsHTMLDocument::CreateDummyChannelForCookies(nsIURI* aCodebaseURI)
 {
   // The cookie service reads the privacy status of the channel we pass to it in
   // order to determine which cookie database to query.  In some cases we don't
   // have a proper channel to hand it to the cookie service though.  This
   // function creates a dummy channel that is not used to load anything, for the
   // sole purpose of handing it to the cookie service.  DO NOT USE THIS CHANNEL
@@ -1991,45 +1959,28 @@ void
 nsHTMLDocument::SetFgColor(const nsAString& aFgColor)
 {
   HTMLBodyElement* body = GetBodyElement();
   if (body) {
     body->SetText(aFgColor);
   }
 }
 
-
-nsIHTMLCollection*
-nsHTMLDocument::Embeds()
-{
-  if (!mEmbeds) {
-    mEmbeds = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::embed, nsGkAtoms::embed);
-  }
-  return mEmbeds;
-}
-
 void
 nsHTMLDocument::CaptureEvents()
 {
   WarnOnceAbout(nsIDocument::eUseOfCaptureEvents);
 }
 
 void
 nsHTMLDocument::ReleaseEvents()
 {
   WarnOnceAbout(nsIDocument::eUseOfReleaseEvents);
 }
 
-// Mapped to document.embeds for NS4 compatibility
-nsIHTMLCollection*
-nsHTMLDocument::Plugins()
-{
-  return Embeds();
-}
-
 nsISupports*
 nsHTMLDocument::ResolveName(const nsAString& aName, nsWrapperCache **aCache)
 {
   nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aName);
   if (!entry) {
     *aCache = nullptr;
     return nullptr;
   }
@@ -2096,27 +2047,16 @@ nsHTMLDocument::GetSupportedNames(nsTArr
     }
   }
 }
 
 //----------------------------
 
 // forms related stuff
 
-nsContentList*
-nsHTMLDocument::GetForms()
-{
-  if (!mForms) {
-    // Please keep this in sync with nsContentUtils::GenerateStateKey().
-    mForms = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::form, nsGkAtoms::form);
-  }
-
-  return mForms;
-}
-
 bool
 nsHTMLDocument::MatchFormControls(Element* aElement, int32_t aNamespaceID,
                                   nsAtom* aAtom, void* aData)
 {
   return aElement->IsNodeOfType(nsIContent::eHTML_FORM_CONTROL);
 }
 
 nsresult
@@ -3426,23 +3366,18 @@ nsHTMLDocument::RemovedFromDocShell()
 
 /* virtual */ void
 nsHTMLDocument::DocAddSizeOfExcludingThis(nsWindowSizes& aWindowSizes) const
 {
   nsDocument::DocAddSizeOfExcludingThis(aWindowSizes);
 
   // Measurement of the following members may be added later if DMD finds it is
   // worthwhile:
-  // - mImages
-  // - mApplets
-  // - mEmbeds
   // - mLinks
   // - mAnchors
-  // - mScripts
-  // - mForms
   // - mWyciwygChannel
   // - mMidasCommandManager
 }
 
 bool
 nsHTMLDocument::WillIgnoreCharsetOverride()
 {
   if (mEncodingMenuDisabled) {
@@ -3493,18 +3428,21 @@ nsHTMLDocument::GetFormsAndFormControls(
     // nsHtml5TreeBuilderCppSupplement.h. (Look for "See bug 497861." there.)
     //XXXsmaug nsHtml5TreeBuilderCppSupplement doesn't seem to have such flush
     //         anymore.
     FlushPendingNotifications(FlushType::Content);
 
     RefPtr<nsContentList> htmlForms = GetExistingForms();
     if (!htmlForms) {
       // If the document doesn't have an existing forms content list, create a
-      // new one which will be released soon by ContentListHolder.
-      // Please keep this in sync with nsHTMLDocument::GetForms().
+      // new one which will be released soon by ContentListHolder.  The idea is
+      // that we don't have that list hanging around for a long time and slowing
+      // down future DOM mutations.
+      //
+      // Please keep this in sync with nsIDocument::Forms().
       htmlForms = new nsContentList(this, kNameSpaceID_XHTML,
                                     nsGkAtoms::form, nsGkAtoms::form,
                                     /* aDeep = */ true,
                                     /* aLiveList = */ true);
     }
 
     RefPtr<nsContentList> htmlFormControls =
       new nsContentList(this,
--- a/dom/html/nsHTMLDocument.h
+++ b/dom/html/nsHTMLDocument.h
@@ -68,18 +68,16 @@ public:
 
   virtual bool IsWriting() override
   {
     return mWriteLevel != uint32_t(0);
   }
 
   virtual nsIContent* GetUnfocusedKeyEventTarget() override;
 
-  nsContentList* GetForms();
-
   nsContentList* GetExistingForms() const
   {
     return mForms;
   }
 
   // nsIDOMDocument interface
   using nsDocument::CreateElement;
   using nsDocument::CreateElementNS;
@@ -163,25 +161,17 @@ 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);
-  nsIHTMLCollection* Images();
-  nsIHTMLCollection* Embeds();
-  nsIHTMLCollection* Plugins();
   nsIHTMLCollection* Links();
-  nsIHTMLCollection* Forms()
-  {
-    return nsHTMLDocument::GetForms();
-  }
-  nsIHTMLCollection* Scripts();
   already_AddRefed<nsIDocument> Open(JSContext* cx,
                                      const nsAString& aType,
                                      const nsAString& aReplace,
                                      mozilla::ErrorResult& aError);
   already_AddRefed<nsPIDOMWindowOuter>
   Open(JSContext* cx,
        const nsAString& aURL,
        const nsAString& aName,
@@ -220,17 +210,16 @@ public:
   void SetLinkColor(const nsAString& aLinkColor);
   void GetVlinkColor(nsAString& aAvlinkColor);
   void SetVlinkColor(const nsAString& aVlinkColor);
   void GetAlinkColor(nsAString& aAlinkColor);
   void SetAlinkColor(const nsAString& aAlinkColor);
   void GetBgColor(nsAString& aBgColor);
   void SetBgColor(const nsAString& aBgColor);
   nsIHTMLCollection* Anchors();
-  nsIHTMLCollection* Applets();
   void Clear() const
   {
     // Deprecated
   }
   void CaptureEvents();
   void ReleaseEvents();
   // We're picking up GetLocation from Document
   already_AddRefed<mozilla::dom::Location> GetLocation() const
@@ -313,23 +302,18 @@ protected:
     RefPtr<nsHTMLDocument> mDocument;
     RefPtr<nsContentList> mFormList;
     RefPtr<nsContentList> mFormControlList;
   };
 
   friend class ContentListHolder;
   ContentListHolder* mContentListHolder;
 
-  RefPtr<nsContentList> mImages;
-  RefPtr<nsEmptyContentList> mApplets;
-  RefPtr<nsContentList> mEmbeds;
   RefPtr<nsContentList> mLinks;
   RefPtr<nsContentList> mAnchors;
-  RefPtr<nsContentList> mScripts;
-  RefPtr<nsContentList> mForms;
 
   RefPtr<mozilla::dom::HTMLAllCollection> mAll;
 
   /** # of forms in the document, synchronously set */
   int32_t mNumForms;
 
   static uint32_t gWyciwygSessionCnt;
 
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -1,15 +1,22 @@
 /* -*- 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/.
  *
  * https://dom.spec.whatwg.org/#interface-document
  * https://html.spec.whatwg.org/multipage/dom.html#the-document-object
+ * https://html.spec.whatwg.org/multipage/obsolete.html#other-elements%2C-attributes-and-apis
+ * https://fullscreen.spec.whatwg.org/#api
+ * https://w3c.github.io/pointerlock/#extensions-to-the-document-interface
+ * https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
+ * https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
+ * https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
+ * https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
  */
 
 interface WindowProxy;
 interface nsISupports;
 interface URI;
 interface nsIDocShell;
 interface nsILoadGroup;
 
@@ -120,22 +127,22 @@ partial interface Document {
   [CEReactions, SetterThrows, Pure]
            attribute DOMString title;
   [CEReactions, Pure]
            attribute DOMString dir;
   [CEReactions, Pure, SetterThrows]
            attribute HTMLElement? body;
   [Pure]
   readonly attribute HTMLHeadElement? head;
-  //(HTML only)readonly attribute HTMLCollection images;
-  //(HTML only)readonly attribute HTMLCollection embeds;
-  //(HTML only)readonly attribute HTMLCollection plugins;
+  [SameObject] readonly attribute HTMLCollection images;
+  [SameObject] readonly attribute HTMLCollection embeds;
+  [SameObject] readonly attribute HTMLCollection plugins;
   //(HTML only)readonly attribute HTMLCollection links;
-  //(HTML only)readonly attribute HTMLCollection forms;
-  //(HTML only)readonly attribute HTMLCollection scripts;
+  [SameObject] readonly attribute HTMLCollection forms;
+  [SameObject] readonly attribute HTMLCollection scripts;
   [Pure]
   NodeList getElementsByName(DOMString elementName);
   //(Not implemented)readonly attribute DOMElementMap cssElementMap;
 
   // dynamic markup insertion
   //(HTML only)Document open(optional DOMString type, optional DOMString replace);
   //(HTML only)WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace);
   //(HTML only)void close();
@@ -226,16 +233,34 @@ partial interface Document {
    * Current referrer policy - one of the REFERRER_POLICY_* constants
    * from nsIHttpChannel.
    */
   [ChromeOnly]
   readonly attribute unsigned long referrerPolicy;
 
 };
 
+// https://html.spec.whatwg.org/multipage/obsolete.html#other-elements%2C-attributes-and-apis
+partial interface Document {
+  //(HTML only)[CEReactions] attribute [TreatNullAs=EmptyString] DOMString fgColor;
+  //(HTML only)[CEReactions] attribute [TreatNullAs=EmptyString] DOMString linkColor;
+  //(HTML only)[CEReactions] attribute [TreatNullAs=EmptyString] DOMString vlinkColor;
+  //(HTML only)[CEReactions] attribute [TreatNullAs=EmptyString] DOMString alinkColor;
+  //(HTML only)[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
+
+  //(HTML only)[SameObject] readonly attribute HTMLCollection anchors;
+  [SameObject] readonly attribute HTMLCollection applets;
+
+  //(HTML only)void clear();
+  //(HTML only)void captureEvents();
+  //(HTML only)void releaseEvents();
+
+  //(HTML only)[SameObject] readonly attribute HTMLAllCollection all;
+};
+
 // https://fullscreen.spec.whatwg.org/#api
 partial interface Document {
   // Note: Per spec the 'S' in these two is lowercase, but the "Moz"
   // versions have it uppercase.
   [LenientSetter, Unscopable, Func="nsDocument::IsUnprefixedFullscreenEnabled"]
   readonly attribute boolean fullscreen;
   [BinaryName="fullscreen"]
   readonly attribute boolean mozFullScreen;
@@ -261,35 +286,34 @@ partial interface Document {
 partial interface Document {
   void exitPointerLock();
 
   // Event handlers
   attribute EventHandler onpointerlockchange;
   attribute EventHandler onpointerlockerror;
 };
 
-// http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#sec-document-interface
 // https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
 partial interface Document {
   readonly attribute boolean hidden;
   readonly attribute VisibilityState visibilityState;
            attribute EventHandler onvisibilitychange;
 };
 
-// http://dev.w3.org/csswg/cssom/#extensions-to-the-document-interface
+// https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
 partial interface Document {
     attribute DOMString? selectedStyleSheetSet;
     readonly attribute DOMString? lastStyleSheetSet;
     readonly attribute DOMString? preferredStyleSheetSet;
     [Constant]
     readonly attribute DOMStringList styleSheetSets;
     void enableStyleSheetsForSet (DOMString? name);
 };
 
-// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
+// https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
 partial interface Document {
     CaretPosition? caretPositionFromPoint (float x, float y);
 
     readonly attribute Element? scrollingElement;
 };
 
 // http://dev.w3.org/2006/webapi/selectors-api2/#interface-definitions
 partial interface Document {
--- a/dom/webidl/HTMLDocument.webidl
+++ b/dom/webidl/HTMLDocument.webidl
@@ -9,27 +9,17 @@ interface HTMLDocument : Document {
            [SetterThrows]
            attribute DOMString? domain;
            [Throws]
            attribute DOMString cookie;
   // DOM tree accessors
   [Throws]
   getter object (DOMString name);
   [Pure]
-  readonly attribute HTMLCollection images;
-  [Pure]
-  readonly attribute HTMLCollection embeds;
-  [Pure]
-  readonly attribute HTMLCollection plugins;
-  [Pure]
   readonly attribute HTMLCollection links;
-  [Pure]
-  readonly attribute HTMLCollection forms;
-  [Pure]
-  readonly attribute HTMLCollection scripts;
 
   // dynamic markup insertion
   [CEReactions, Throws]
   Document open(optional DOMString type = "text/html", optional DOMString replace = "");
   [CEReactions, Throws]
   WindowProxy? open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
   [CEReactions, Throws]
   void close();
@@ -57,18 +47,16 @@ interface HTMLDocument : Document {
   [CEReactions, TreatNullAs=EmptyString] attribute DOMString fgColor;
   [CEReactions, TreatNullAs=EmptyString] attribute DOMString linkColor;
   [CEReactions, TreatNullAs=EmptyString] attribute DOMString vlinkColor;
   [CEReactions, TreatNullAs=EmptyString] attribute DOMString alinkColor;
   [CEReactions, TreatNullAs=EmptyString] attribute DOMString bgColor;
 
   [Pure]
   readonly attribute HTMLCollection anchors;
-  [Pure]
-  readonly attribute HTMLCollection applets;
 
   void clear();
 
   readonly attribute HTMLAllCollection all;
 
   // @deprecated These are old Netscape 4 methods. Do not use,
   //             the implementation is no-op.
   // XXXbz do we actually need these anymore?
--- a/testing/web-platform/meta/html/dom/interfaces.html.ini
+++ b/testing/web-platform/meta/html/dom/interfaces.html.ini
@@ -3,34 +3,19 @@
   disabled:
     if not stylo: Shadow DOM is stylo-only.
   [Document interface: attribute domain]
     expected: FAIL
 
   [Document interface: attribute cookie]
     expected: FAIL
 
-  [Document interface: attribute images]
-    expected: FAIL
-
-  [Document interface: attribute embeds]
-    expected: FAIL
-
-  [Document interface: attribute plugins]
-    expected: FAIL
-
   [Document interface: attribute links]
     expected: FAIL
 
-  [Document interface: attribute forms]
-    expected: FAIL
-
-  [Document interface: attribute scripts]
-    expected: FAIL
-
   [Document interface: operation getItems(DOMString)]
     expected: FAIL
 
   [Document interface: attribute cssElementMap]
     expected: FAIL
 
   [Document interface: operation open(DOMString,DOMString)]
     expected: FAIL
@@ -84,19 +69,16 @@
     expected: FAIL
 
   [Document interface: attribute bgColor]
     expected: FAIL
 
   [Document interface: attribute anchors]
     expected: FAIL
 
-  [Document interface: attribute applets]
-    expected: FAIL
-
   [Document interface: operation clear()]
     expected: FAIL
 
   [Document interface: operation captureEvents()]
     expected: FAIL
 
   [Document interface: operation releaseEvents()]
     expected: FAIL
@@ -165,34 +147,19 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type (34)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type (36)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type (44)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "embeds" with the proper type (45)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "plugins" with the proper type (46)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "links" with the proper type (47)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "forms" with the proper type (48)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "scripts" with the proper type (49)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "getItems" with the proper type (51)]
     expected: FAIL
 
   [Document interface: calling getItems(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cssElementMap" with the proper type (52)]
     expected: FAIL
@@ -279,19 +246,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type (75)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type (76)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type (77)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear" with the proper type (78)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents" with the proper type (79)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents" with the proper type (80)]
     expected: FAIL
@@ -1821,34 +1785,19 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type (35)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type (37)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type (45)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "embeds" with the proper type (46)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "plugins" with the proper type (47)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "links" with the proper type (48)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "forms" with the proper type (49)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "scripts" with the proper type (50)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "getItems" with the proper type (52)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cssElementMap" with the proper type (53)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "open" with the proper type (56)]
     expected: FAIL
@@ -1899,19 +1848,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type (76)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type (77)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type (78)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear" with the proper type (79)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents" with the proper type (80)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents" with the proper type (81)]
     expected: FAIL
@@ -2010,34 +1956,19 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "domain" with the proper type (35)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "cookie" with the proper type (37)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "images" with the proper type (45)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "embeds" with the proper type (46)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "plugins" with the proper type (47)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "links" with the proper type (48)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "forms" with the proper type (49)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "scripts" with the proper type (50)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "cssElementMap" with the proper type (52)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "open" with the proper type (54)]
     expected: FAIL
 
   [Document interface: calling open(DOMString,DOMString) on new Document() with too few arguments must throw TypeError]
     expected: FAIL
@@ -2118,19 +2049,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "bgColor" with the proper type (75)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "anchors" with the proper type (76)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "applets" with the proper type (77)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "clear" with the proper type (78)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "captureEvents" with the proper type (79)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "releaseEvents" with the proper type (80)]
     expected: FAIL
@@ -2493,19 +2421,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "bgColor" with the proper type (73)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "anchors" with the proper type (74)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "applets" with the proper type (75)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "clear" with the proper type (76)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "captureEvents" with the proper type (77)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "releaseEvents" with the proper type (78)]
     expected: FAIL
@@ -2571,19 +2496,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type (73)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type (74)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type (75)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear" with the proper type (76)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents" with the proper type (77)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents" with the proper type (78)]
     expected: FAIL
@@ -2745,34 +2667,19 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "domain" with the proper type (36)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "cookie" with the proper type (38)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "images" with the proper type (46)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "embeds" with the proper type (47)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "plugins" with the proper type (48)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "links" with the proper type (49)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "forms" with the proper type (50)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "scripts" with the proper type (51)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "fgColor" with the proper type (70)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "linkColor" with the proper type (71)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "vlinkColor" with the proper type (72)]
     expected: FAIL
@@ -2781,19 +2688,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "bgColor" with the proper type (74)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "anchors" with the proper type (75)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "applets" with the proper type (76)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "clear" with the proper type (77)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "captureEvents" with the proper type (78)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "releaseEvents" with the proper type (79)]
     expected: FAIL
@@ -2814,34 +2718,19 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type (36)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type (38)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type (46)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "embeds" with the proper type (47)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "plugins" with the proper type (48)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "links" with the proper type (49)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "forms" with the proper type (50)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "scripts" with the proper type (51)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "fgColor" with the proper type (70)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "linkColor" with the proper type (71)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "vlinkColor" with the proper type (72)]
     expected: FAIL
@@ -2850,19 +2739,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type (74)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type (75)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type (76)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear" with the proper type (77)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents" with the proper type (78)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents" with the proper type (79)]
     expected: FAIL
@@ -2949,34 +2835,19 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "domain" with the proper type (31)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "cookie" with the proper type (33)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "images" with the proper type (41)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "embeds" with the proper type (42)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "plugins" with the proper type (43)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "links" with the proper type (44)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "forms" with the proper type (45)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "scripts" with the proper type (46)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "open" with the proper type (49)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "open" with the proper type (50)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "close" with the proper type (51)]
     expected: FAIL
@@ -3021,19 +2892,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "bgColor" with the proper type (69)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "anchors" with the proper type (70)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "applets" with the proper type (71)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "clear" with the proper type (72)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "captureEvents" with the proper type (73)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "releaseEvents" with the proper type (74)]
     expected: FAIL
@@ -3051,34 +2919,19 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type (31)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type (33)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type (41)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "embeds" with the proper type (42)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "plugins" with the proper type (43)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "links" with the proper type (44)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "forms" with the proper type (45)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "scripts" with the proper type (46)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "open" with the proper type (49)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "open" with the proper type (50)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "close" with the proper type (51)]
     expected: FAIL
@@ -3123,19 +2976,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type (69)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type (70)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type (71)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear" with the proper type (72)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents" with the proper type (73)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents" with the proper type (74)]
     expected: FAIL
@@ -3351,34 +3201,19 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "domain" with the proper type]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "cookie" with the proper type]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "images" with the proper type]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "embeds" with the proper type]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "plugins" with the proper type]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "links" with the proper type]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "forms" with the proper type]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "scripts" with the proper type]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "open(DOMString, DOMString)" with the proper type]
     expected: FAIL
 
   [Document interface: calling open(DOMString, DOMString) on new Document() with too few arguments must throw TypeError]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "open(USVString, DOMString, DOMString)" with the proper type]
     expected: FAIL
@@ -3432,19 +3267,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "bgColor" with the proper type]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "anchors" with the proper type]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "applets" with the proper type]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "clear()" with the proper type]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "captureEvents()" with the proper type]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "releaseEvents()" with the proper type]
     expected: FAIL
@@ -3462,34 +3294,19 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "embeds" with the proper type]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "plugins" with the proper type]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "links" with the proper type]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "forms" with the proper type]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "scripts" with the proper type]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "open(DOMString, DOMString)" with the proper type]
     expected: FAIL
 
   [Document interface: calling open(DOMString, DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "open(USVString, DOMString, DOMString)" with the proper type]
     expected: FAIL
@@ -3543,19 +3360,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear()" with the proper type]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents()" with the proper type]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents()" with the proper type]
     expected: FAIL
--- a/testing/web-platform/tests/xhr/responsexml-document-properties.htm
+++ b/testing/web-platform/tests/xhr/responsexml-document-properties.htm
@@ -20,19 +20,17 @@
         baseURI:responseURL,
         referrer:'',
         title:'',
         contentType:'application/xml',
         readyState:'complete',
         location:null,
         defaultView:null,
         body:null,
-        images: undefined,
         doctype:null,
-        forms:undefined,
         all:undefined,
         links: undefined,
         cookie:''
       }
 
       for (var name in expected) {
         runTest(name, expected[name])
       }
@@ -89,18 +87,23 @@
         assert_equals((new Date(client2.getResponseHeader('Last-Modified'))).getTime(), (new Date(client2.responseXML.lastModified)).getTime())
       }, 'lastModified set to related HTTP header if provided')
 
       test(function() {
         client.responseXML.cookie = "thisshouldbeignored"
         assert_equals(client.responseXML.cookie, "")
       }, 'cookie (after setting it)')
 
-      test(function() {
-        assert_equals(typeof(client.responseXML.styleSheets), "object")
-      }, 'styleSheets')
+      var objectProps = [
+        "styleSheets",
+        "implementation",
+        "images",
+        "forms"
+      ];
 
-      test(function() {
-        assert_equals(typeof(client.responseXML.implementation), "object")
-      }, 'implementation')
+      for (let prop of objectProps) {
+        test(function() {
+          assert_equals(typeof(client.responseXML[prop]), "object")
+        }, prop + " should be an object")
+      }
     </script>
   </body>
 </html>