Backed out changeset 4bacb947e991 (bug 1558571) for WPT failures on /xhr/responsexml-document-properties.html

This commit is contained in:
Dorel Luca 2019-07-09 20:45:41 +03:00
Родитель 4cb5b6e3c9
Коммит f2dfa057a6
9 изменённых файлов: 34 добавлений и 22 удалений

Просмотреть файл

@ -91,7 +91,6 @@
#include "mozilla/dom/FeaturePolicy.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/FramingChecker.h"
#include "mozilla/dom/HTMLAllCollection.h"
#include "mozilla/dom/HTMLSharedElement.h"
#include "mozilla/dom/Navigator.h"
#include "mozilla/dom/Performance.h"
@ -2005,7 +2004,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(Document)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSuppressedEventListener)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrototypeDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMidasCommandManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAll)
// Traverse all our nsCOMArrays.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPreloadingImages)
@ -5634,13 +5632,6 @@ void Document::CaptureEvents() { WarnOnceAbout(Document::eUseOfCaptureEvents); }
void Document::ReleaseEvents() { WarnOnceAbout(Document::eUseOfReleaseEvents); }
HTMLAllCollection* Document::All() {
if (!mAll) {
mAll = new HTMLAllCollection(this);
}
return mAll;
}
nsresult Document::GetSrcdocData(nsAString& aSrcdocData) {
if (mIsSrcdocDocument) {
nsCOMPtr<nsIInputStreamChannel> inStrmChan = do_QueryInterface(mChannel);

Просмотреть файл

@ -185,7 +185,6 @@ class FeaturePolicy;
class FontFaceSet;
class FrameRequestCallback;
class ImageTracker;
class HTMLAllCollection;
class HTMLBodyElement;
class HTMLSharedElement;
class HTMLImageElement;
@ -3583,8 +3582,6 @@ class Document : public nsINode,
void CaptureEvents();
void ReleaseEvents();
mozilla::dom::HTMLAllCollection* All();
static bool IsUnprefixedFullscreenEnabled(JSContext* aCx, JSObject* aObject);
static bool DocumentSupportsL10n(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
@ -5218,8 +5215,6 @@ class Document : public nsINode,
RefPtr<XULBroadcastManager> mXULBroadcastManager;
RefPtr<XULPersist> mXULPersist;
RefPtr<mozilla::dom::HTMLAllCollection> mAll;
// document lightweight theme for use with :-moz-lwtheme,
// :-moz-lwtheme-brighttext and :-moz-lwtheme-darktext
DocumentTheme mDocLWTheme;

Просмотреть файл

@ -8,15 +8,13 @@
#include "mozilla/dom/HTMLAllCollectionBinding.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/Element.h"
#include "nsContentList.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLDocument.h"
namespace mozilla {
namespace dom {
HTMLAllCollection::HTMLAllCollection(mozilla::dom::Document* aDocument)
HTMLAllCollection::HTMLAllCollection(nsHTMLDocument* aDocument)
: mDocument(aDocument) {
MOZ_ASSERT(mDocument);
}

Просмотреть файл

@ -15,12 +15,12 @@
#include <stdint.h>
class nsContentList;
class nsHTMLDocument;
class nsINode;
namespace mozilla {
namespace dom {
class Document;
class Element;
class OwningHTMLCollectionOrElement;
template <typename>
@ -32,7 +32,7 @@ class HTMLAllCollection final : public nsISupports, public nsWrapperCache {
~HTMLAllCollection();
public:
explicit HTMLAllCollection(mozilla::dom::Document* aDocument);
explicit HTMLAllCollection(nsHTMLDocument* aDocument);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HTMLAllCollection)
@ -80,7 +80,7 @@ class HTMLAllCollection final : public nsISupports, public nsWrapperCache {
*/
Element* Item(uint32_t aIndex);
RefPtr<mozilla::dom::Document> mDocument;
RefPtr<nsHTMLDocument> mDocument;
RefPtr<nsContentList> mCollection;
nsRefPtrHashtable<nsStringHashKey, nsContentList> mNamedMap;
};

Просмотреть файл

@ -9,6 +9,7 @@
#include "nsIContentPolicy.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/HTMLAllCollection.h"
#include "nsCommandManager.h"
#include "nsCOMPtr.h"
#include "nsGlobalWindow.h"
@ -157,6 +158,10 @@ nsHTMLDocument::nsHTMLDocument()
nsHTMLDocument::~nsHTMLDocument() {}
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, Document, mAll)
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(nsHTMLDocument, Document)
JSObject* nsHTMLDocument::WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return HTMLDocument_Binding::Wrap(aCx, this, aGivenProto);
@ -775,6 +780,13 @@ bool nsHTMLDocument::MatchFormControls(Element* aElement, int32_t aNamespaceID,
return aElement->IsNodeOfType(nsIContent::eHTML_FORM_CONTROL);
}
HTMLAllCollection* nsHTMLDocument::All() {
if (!mAll) {
mAll = new HTMLAllCollection(this);
}
return mAll;
}
nsresult nsHTMLDocument::Clone(dom::NodeInfo* aNodeInfo,
nsINode** aResult) const {
NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager,

Просмотреть файл

@ -27,6 +27,7 @@ class nsILoadGroup;
namespace mozilla {
namespace dom {
class HTMLAllCollection;
template <typename T>
struct Nullable;
class WindowProxyHolder;
@ -48,6 +49,9 @@ class nsHTMLDocument : public mozilla::dom::Document {
nsHTMLDocument();
virtual nsresult Init() override;
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLDocument, Document)
// Document
virtual void Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) override;
virtual void ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup,
@ -69,6 +73,8 @@ class nsHTMLDocument : public mozilla::dom::Document {
nsContentList* GetExistingForms() const { return mForms; }
mozilla::dom::HTMLAllCollection* All();
// Returns whether an object was found for aName.
bool ResolveName(JSContext* aCx, const nsAString& aName,
JS::MutableHandle<JS::Value> aRetval,
@ -166,6 +172,8 @@ class nsHTMLDocument : public mozilla::dom::Document {
friend class ContentListHolder;
ContentListHolder* mContentListHolder;
RefPtr<mozilla::dom::HTMLAllCollection> mAll;
/** # of forms in the document, synchronously set */
int32_t mNumForms;

Просмотреть файл

@ -276,7 +276,7 @@ partial interface Document {
void captureEvents();
void releaseEvents();
[SameObject] readonly attribute HTMLAllCollection all;
//(HTML only)[SameObject] readonly attribute HTMLAllCollection all;
};
// https://fullscreen.spec.whatwg.org/#api

Просмотреть файл

@ -9,6 +9,8 @@ interface HTMLDocument : Document {
// DOM tree accessors
[Throws]
getter object (DOMString name);
readonly attribute HTMLAllCollection all;
};
partial interface HTMLDocument {

Просмотреть файл

@ -1,5 +1,8 @@
prefs: [dom.security.featurePolicy.enabled:true]
[interfaces.https.html?include=(Document|Window)]
[Document interface: attribute all]
expected: FAIL
[Document interface: attribute oncancel]
expected: FAIL
@ -27,6 +30,9 @@ prefs: [dom.security.featurePolicy.enabled:true]
[Document interface: new Document() must inherit property "onsecuritypolicyviolation" with the proper type]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "all" with the proper type]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type]
expected: FAIL