Document.idl   [plain text]

 * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved.
 * Copyright (C) 2006, 2007 Samuel Weinig <>
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * Library General Public License for more details.
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.

] interface Document : Node {

    // DOM Level 1 Core
    readonly attribute DocumentType doctype;
    readonly attribute DOMImplementation implementation;
    readonly attribute Element documentElement;

    [ReturnNewObject, RaisesException] Element createElement([TreatNullAs=NullString,Default=Undefined] optional DOMString tagName);
    DocumentFragment   createDocumentFragment();
    [ReturnNewObject] Text createTextNode([Default=Undefined] optional DOMString data);
    [ReturnNewObject] Comment createComment([Default=Undefined] optional DOMString data);
    [ReturnNewObject, RaisesException] CDATASection createCDATASection([Default=Undefined] optional DOMString data);
    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
                                                                                 [Default=Undefined] optional DOMString data);
    [ReturnNewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
    [ReturnNewObject, RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
    NodeList getElementsByTagName([Default=Undefined] optional DOMString tagname);

    // Introduced in DOM Level 2:

    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
                    optional boolean deep);
    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                                          [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
    [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                   [Default=Undefined] optional DOMString localName);
    Element getElementById([Default=Undefined] optional DOMString elementId);

    // DOM Level 3 Core

    [TreatReturnedNullStringAs=Null] readonly attribute DOMString inputEncoding;

    [TreatReturnedNullStringAs=Null] readonly attribute DOMString xmlEncoding;
    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException] attribute DOMString xmlVersion;
    [SetterRaisesException] attribute boolean xmlStandalone;

    [RaisesException] Node               adoptNode([Default=Undefined] optional Node source);