User:George3/DOMdocument

Draft proposal for "Properties" section of DOM:document

Based on a table layout similar to DOM:element

Not sure what the "Availability" column should represent. One of the following?:

  • HTML vs XUL (as in the DOM:element page)
  • Match to standards - with the note that DOM 0 properties aren't covered by any W3C recommendation and in most cases, should be avoided in order to reduce cross-browser inconsistencies?
  • A replacement for the purpose of the asterisks in the previous version of this page?

Gecko seems to support six of the seven new properties in DOM3. They've been added below, except for the currently unsupported document.domConfig (bug 226193#c4).

A non-W3C property, document.readyState, is not currently supported by Gecko but if bug 347174 gets fixed, it will have to be added to this list of properties.

<s>(Regarding the XUL Planet links on the object types, I'm assuming that content can be migrated to devmo/MDC?)</s> Since the "objref" content of XULPlanet is autogenerated from IDL files, it was not going to be migrated. Too bad a devmo page can't be separated into an autogen portion and a regular wikiportion (MFinkle possibly looked into this/had ideas on this?) --George3 09:03, 11 September 2007 (PDT)

Properties

Name Description Return Type Availability
document.alinkColor Returns or sets the color of active links in the document body.StringDOM 0
document.anchorsReturns a list of all of the anchors in the document.HTMLCollection HTML
document.appletsReturns an ordered list of the applets within a document.HTMLCollectionHTML
document.asyncasync is used with document.load to indicate an asynchronous request.n/a
document.baseURIObject baseURIObject returns an nsIURI object representing the base URI for the document. nsIURI All
document.bgColor Gets/sets the background color of the current document.StringDOM 0
document.bodyReturns the BODY node of the current document.HTMLBodyElement HTML
document.characterSetReturns the character set being used by the document.StringDOM 0
document.compatModeIndicates whether the document is rendered in Quirks or Strict mode.StringHTML, XHTML
document.contentTypeReturns the Content-Type from the MIME Header of the current document.String
document.cookieReturns a semicolon-separated list of the cookies for that document or sets a single cookie.StringHTML
document.defaultViewReturns a reference to the window object.Window DOM 2 View
document.designModeGets/sets WYSYWIG editing capability of Midas. It can only be used for HTML documents.StringHTML
document.doctypeReturns the Document Type Definition (DTD) of the current document.DocumentType DOM 2 Core
Name Description Return Type Availability
document.documentElementReturns the Element that is a direct child of document. For HTML documents, this is normally the HTML element.Element All
document.documentURIReturns the document location.StringDOM 3
document.documentURIObject Returns the nsIURI object representing the URI of the document. This property only has special meaning in privileged JavaScript code (with UniversalXPConnect privileges).nsIURI
document.domainReturns the domain of the current document.StringHTML
document.embedsReturns a list of the embedded OBJECTS within the current document.HTMLCollectionDOM 0
document.fgColor Gets/sets the foreground color, or text color, of the current document.StringDOM 0
document.firstChildReturns the first node in the list of direct children of the document. (See also firstChild for the general element property.)DocumentTypeDOM 2 Core
document.formsReturns a list of the FORM elements within the current document.HTMLCollectionHTML
document.heightGets/sets the height of the current document.NumberDOM 0
document.imagesReturns a list of the images in the current document.HTMLCollectionHTML
document.implementationReturns the DOM implementation associated with the current document.DOMImplementation DOM 2 Core
document.inputEncodingReturns the encoding used when the document was parsed.StringDOM 3
document.lastModifiedReturns the date on which the document was last modified.StringDOM 0
document.linkColor Gets/sets the color of hyperlinks in the document.StringDOM 0
Name Description Return Type Availability
document.linksReturns a list of all the hyperlinks in the document.HTMLCollectionHTML
document.locationReturns the URI of the current document.Location DOM 0
document.namespaceURIReturns the XML namespace of the current document. All
document.nodePrincipal Returns the nsIPrincipal object representing current security context of the document. nsIPrincipal All
document.pluginsReturns a list of the available plugins.HTMLCollectionDOM 0
document.popupNodeReturns the node upon which a popup was invoked (XUL documents only).Node XUL
document.readyStateComing Soon? bug 347174#c79 Returns the status of the document while it is loading and after it finishes loading.StringHTML5
document.referrerReturns the URI of the page that linked to this page.StringHTML
document.strictErrorCheckingReturns <tt>true</tt> if error checking is enforced or <tt>false</tt> if it is not.BooleanDOM 3
document.styleSheetsReturns a list of the stylesheet objects on the current document.StyleSheetList DOM 2 Style
document.titleReturns the title of the current document.StringHTML
document.tooltipNodeReturns the node which is the target of the current tooltip.Node ObjectXUL
document.URLReturns a string containing the URL of the current document.StringHTML
document.vlinkColor Gets/sets the color of visited hyperlinks.StringDOM 0
document.widthReturns the width of the current document.NumberDOM 0
document.xmlEncodingReturns the encoding as determined by the XML declaration.StringDOM 3
document.xmlStandalone Returns <tt>true</tt> if the XML declaration specifies the document is standalone (e.g., An external part of the DTD effects the document's content), else <tt>false</tt>. BooleanDOM 3
document.xmlVersionReturns ther version number as specified in the XML declaration or <tt>"1.0"</tt> if the declaration is absent.StringDOM 3