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. | String | DOM 0 |
document.anchors | Returns a list of all of the anchors in the document. | HTMLCollection | HTML |
document.applets | Returns an ordered list of the applets within a document. | HTMLCollection | HTML |
document.async | async 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. | String | DOM 0 |
document.body | Returns the BODY node of the current document. | HTMLBodyElement | HTML |
document.characterSet | Returns the character set being used by the document. | String | DOM 0 |
document.compatMode | Indicates whether the document is rendered in Quirks or Strict mode. | String | HTML, XHTML |
document.contentType | Returns the Content-Type from the MIME Header of the current document. | String | |
document.cookie | Returns a semicolon-separated list of the cookies for that document or sets a single cookie. | String | HTML |
document.defaultView | Returns a reference to the window object. | Window | DOM 2 View |
document.designMode | Gets/sets WYSYWIG editing capability of Midas. It can only be used for HTML documents. | String | HTML |
document.doctype | Returns the Document Type Definition (DTD) of the current document. | DocumentType | DOM 2 Core |
Name | Description | Return Type | Availability |
document.documentElement | Returns the Element that is a direct child of document. For HTML documents, this is normally the HTML element. | Element | All |
document.documentURI | Returns the document location. | String | DOM 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.domain | Returns the domain of the current document. | String | HTML |
document.embeds | Returns a list of the embedded OBJECTS within the current document. | HTMLCollection | DOM 0 |
document.fgColor | Gets/sets the foreground color, or text color, of the current document. | String | DOM 0 |
document.firstChild | Returns the first node in the list of direct children of the document. (See also firstChild for the general element property.) | DocumentType | DOM 2 Core |
document.forms | Returns a list of the FORM elements within the current document. | HTMLCollection | HTML |
document.height | Gets/sets the height of the current document. | Number | DOM 0 |
document.images | Returns a list of the images in the current document. | HTMLCollection | HTML |
document.implementation | Returns the DOM implementation associated with the current document. | DOMImplementation | DOM 2 Core |
document.inputEncoding | Returns the encoding used when the document was parsed. | String | DOM 3 |
document.lastModified | Returns the date on which the document was last modified. | String | DOM 0 |
document.linkColor | Gets/sets the color of hyperlinks in the document. | String | DOM 0 |
Name | Description | Return Type | Availability |
document.links | Returns a list of all the hyperlinks in the document. | HTMLCollection | HTML |
document.location | Returns the URI of the current document. | Location | DOM 0 |
document.namespaceURI | Returns the XML namespace of the current document. | All | |
document.nodePrincipal | Returns the nsIPrincipal object representing current security context of the document. | nsIPrincipal | All |
document.plugins | Returns a list of the available plugins. | HTMLCollection | DOM 0 |
document.popupNode | Returns the node upon which a popup was invoked (XUL documents only). | Node | XUL |
document.readyState | Coming Soon? bug 347174#c79 Returns the status of the document while it is loading and after it finishes loading. | String | HTML5 |
document.referrer | Returns the URI of the page that linked to this page. | String | HTML |
document.strictErrorChecking | Returns <tt>true</tt> if error checking is enforced or <tt>false</tt> if it is not. | Boolean | DOM 3 |
document.styleSheets | Returns a list of the stylesheet objects on the current document. | StyleSheetList | DOM 2 Style |
document.title | Returns the title of the current document. | String | HTML |
document.tooltipNode | Returns the node which is the target of the current tooltip. | Node Object | XUL |
document.URL | Returns a string containing the URL of the current document. | String | HTML |
document.vlinkColor | Gets/sets the color of visited hyperlinks. | String | DOM 0 |
document.width | Returns the width of the current document. | Number | DOM 0 |
document.xmlEncoding | Returns the encoding as determined by the XML declaration. | String | DOM 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>. | Boolean | DOM 3 |
document.xmlVersion | Returns ther version number as specified in the XML declaration or <tt>"1.0"</tt> if the declaration is absent. | String | DOM 3 |