Bug 1415588 part 2. Move the .images, .embeds, .plugins, .forms, .scripts, .applets getters from HTMLDocument to Document. r=mystor

MozReview-Commit-ID: Db7iazZUz8g
This commit is contained in:
Boris Zbarsky 2018-03-12 21:44:56 -04:00
parent f3daf97dc7
commit d5f5a95c81
9 changed files with 123 additions and 298 deletions

View File

@ -148,6 +148,7 @@ nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> 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)
@ -157,7 +158,7 @@ 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

View File

@ -1974,6 +1974,11 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
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.
@ -2064,6 +2069,11 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
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);
@ -6807,6 +6817,53 @@ nsIDocument::SetDir(const nsAString& aDirection)
}
}
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,

View File

@ -3283,6 +3283,14 @@ public:
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,
@ -3297,6 +3305,7 @@ public:
}
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
@ -3874,6 +3883,13 @@ protected:
// 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;

View File

@ -196,13 +196,8 @@ nsHTMLDocument::~nsHTMLDocument()
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, nsDocument,
mAll,
mImages,
mApplets,
mEmbeds,
mLinks,
mAnchors,
mScripts,
mForms,
mWyciwygChannel,
mMidasCommandManager)
@ -1053,24 +1048,6 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
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)
@ -1145,15 +1122,6 @@ nsHTMLDocument::Anchors()
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)
{
@ -1996,16 +1964,6 @@ nsHTMLDocument::SetFgColor(const nsAString& aFgColor)
}
}
nsIHTMLCollection*
nsHTMLDocument::Embeds()
{
if (!mEmbeds) {
mEmbeds = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::embed, nsGkAtoms::embed);
}
return mEmbeds;
}
void
nsHTMLDocument::CaptureEvents()
{
@ -2018,13 +1976,6 @@ 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)
{
@ -2101,17 +2052,6 @@ nsHTMLDocument::GetSupportedNames(nsTArray<nsString>& aNames)
// 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)
@ -3431,13 +3371,8 @@ nsHTMLDocument::DocAddSizeOfExcludingThis(nsWindowSizes& aWindowSizes) const
// Measurement of the following members may be added later if DMD finds it is
// worthwhile:
// - mImages
// - mApplets
// - mEmbeds
// - mLinks
// - mAnchors
// - mScripts
// - mForms
// - mWyciwygChannel
// - mMidasCommandManager
}
@ -3498,8 +3433,11 @@ nsHTMLDocument::GetFormsAndFormControls(nsContentList** aFormList,
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,

View File

@ -73,8 +73,6 @@ public:
virtual nsIContent* GetUnfocusedKeyEventTarget() override;
nsContentList* GetForms();
nsContentList* GetExistingForms() const
{
return mForms;
@ -168,15 +166,7 @@ public:
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,
@ -225,7 +215,6 @@ public:
void GetBgColor(nsAString& aBgColor);
void SetBgColor(const nsAString& aBgColor);
nsIHTMLCollection* Anchors();
nsIHTMLCollection* Applets();
void Clear() const
{
// Deprecated
@ -318,13 +307,8 @@ protected:
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;

View File

@ -5,6 +5,13 @@
*
* 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;
@ -125,12 +132,12 @@ partial interface Document {
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;
@ -231,6 +238,24 @@ partial interface Document {
};
// 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"
@ -266,7 +291,6 @@ partial interface Document {
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;
@ -274,7 +298,7 @@ partial interface Document {
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;
@ -284,7 +308,7 @@ partial interface Document {
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);

View File

@ -14,17 +14,7 @@ interface HTMLDocument : Document {
[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]
@ -62,8 +52,6 @@ interface HTMLDocument : Document {
[Pure]
readonly attribute HTMLCollection anchors;
[Pure]
readonly attribute HTMLCollection applets;
void clear();

View File

@ -8,24 +8,9 @@
[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
@ -89,9 +74,6 @@
[Document interface: attribute anchors]
expected: FAIL
[Document interface: attribute applets]
expected: FAIL
[Document interface: operation clear()]
expected: FAIL
@ -170,24 +152,9 @@
[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
@ -284,9 +251,6 @@
[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
@ -1826,24 +1790,9 @@
[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
@ -1904,9 +1853,6 @@
[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
@ -2015,24 +1961,9 @@
[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
@ -2123,9 +2054,6 @@
[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
@ -2498,9 +2426,6 @@
[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
@ -2576,9 +2501,6 @@
[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
@ -2750,24 +2672,9 @@
[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
@ -2786,9 +2693,6 @@
[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
@ -2819,24 +2723,9 @@
[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
@ -2855,9 +2744,6 @@
[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
@ -2954,24 +2840,9 @@
[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
@ -3026,9 +2897,6 @@
[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
@ -3056,24 +2924,9 @@
[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
@ -3128,9 +2981,6 @@
[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
@ -3356,24 +3206,9 @@
[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
@ -3437,9 +3272,6 @@
[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
@ -3467,24 +3299,9 @@
[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
@ -3548,9 +3365,6 @@
[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

View File

@ -25,9 +25,7 @@
location:null,
defaultView:null,
body:null,
images: undefined,
doctype:null,
forms:undefined,
all:undefined,
links: undefined,
cookie:''
@ -94,13 +92,18 @@
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>