[7] This is a work-in-progress documentation for manakai's DOM extensions. * Conventions [30] @@ Keywords [Q@en[[['''MUST''']]]], [Q@en[[['''MUST NOT''']]]], [Q@en[[['''REQUIRED''']]]], [Q@en[[['''SHOULD''']]]], [Q@en[[['''SHOULD NOT''']]]], [Q@en[[['''MAY''']]]], and [Q@en[[['''OPTIONAL''']]]] are interpreted as described in [[RFC 2119]] [RFC 2119]. [32] An [Q@en[[VAR@en[InterfaceName]] object]] refers to an object that implements [VAR@en[InterfaceName]] interface. Note that the object might also implement other interfaces than [VAR@en[InterfaceName]]. However, unless explicitly specified, the term [Q@en[[CODE(DOMi)@en[[[Text]]]] object]] does not refer to a [CODE(DOMi)@en[[[CDATASection]]]] object though the [CODE(DOMi)@en[[[CDATASection]]]] interface extends the [CODE(DOMi)@en[[[Text]]]] interface. [33] When a [VAR@en[CONSTANT_NAME]] [VAR@en[ExceptionInterfaceName]] is said to be thrown, an implementation [['''MUST''']] throw an exception object that implements the [VAR@en[ExceptionInterfaceName]] interface and whose [CODE(DOMa)@en[[[code]]]] attribute is set to the value of [VAR@en[CONSTANT_NAME]]. [34] Algorithms shown in this document does not intend to constraint the way to implement that feature. Implementations are always free to implement that feature in any way as long as that has the same effect as the normative algorithm. [35] As specified in DOM Level 3 Core specification [DOM3Core], implementation may choose not to throw an exception when the [CODE(DOMa)@en[[[strictErrorChecking]]]] attribute of the [CODE(DOMi)@en[[[Document]]]] object is set to [CODE(IDL)@en[[[false]]]]. * New interfaces - [[DOM XML Document Type Definition]] module -- [CODE(DOMi)@en[[[DocumentXDoctype]]]] -- [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] -- [CODE(DOMi)@en[[[ElementTypeDefinition]]]] -- [CODE(DOMi)@en[[[AttributeDefinition]]]] - [CODE(DOMi)@en[[[SerialWalker]]]] - [[Atom DOM]] * Extensions to existing interfaces - [[manakai DOM [CODE(DOMi)@en[Node]] Extensions]] - [[manakai DOM [CODE(DOMi)@en[Document]] Extensions]] * Backward compatibility [64] It [['''MUST''']] implement the definitions in the DOM Standard but commented out with markers "AttrExodus" or "NodeExodus". [SRC[[[DOM]]]] ;; [65] This is a [[willful violation]] to the [[DOM]] Standard that is intended to obsolete them. Since [[manakai]] is a Perl implementation of DOM, it has different compatibility requirements from those in Web browsers. [FIG[ [68] [PRE(IDL code)[ partial interface Node { attribute DOMString prefix; }; ]PRE] ]FIG] [66] On setting, the [CODE(DOMa)@en[[[prefix]]]] attribute of the [CODE(DOMi)@en[[[Node]]]] interface [['''MUST''']] run these steps: [FIG[ = Let [VAR[prefix]] be the value being assigned. = If the [[context object]]'s [[namespace]] is null or the empty string, throw an "[CODE[[[NamespaceError]]]]" exception and terminate these steps. = If [VAR[prefix]] is the empty string, let [VAR[prefix]] be null. = If [VAR[prefix]] is not null, run these substeps: == If [VAR[prefix]] does not match the [CODE[[[Name]]]] production in XML, throw an "[CODE[[[InvalidCharacterError]]]]" exception and terminate these steps. == If [VAR[prefix]] does not match the [CODE[[[NCName]]]] production in Namespaces in XML, throw a "[CODE[[[NamespaceError]]]]" exception and terminate these steps. = Let the [[prefix]] of the [[context object]] be [VAR[prefix]]. ]FIG] ;; [67] This is the [[Chrome]] behavior. [TIME[2012-12-15T12:21:12.000Z]] [78] For the [CODE(DOMm)@en[[[isEqualNode]]]] method of the [CODE(DOMi)@en[[[Node]]]] interface, the following condition [['''MUST''']] be applied as well as the other conditions: If the nodes are [CODE(DOMi)@en[[[Attr]]]] objects, their [[local name]], [[namespace]], and [[value]] are equal respectively. [80] If the [[context object]] is an [CODE(DOMi)@en[[[Attr]]]], the [CODE(DOMm)@en[[[textContent]]]] attribute of the [CODE(DOMi)@en[[[Node]]]] interface [['''MUST''']] return the [[value]] of the attribute on getting, or assign new value to the [[value]] of the attribute on setting. [81] In the "[[clone]]" steps, when [VAR@en[node]] is an [CODE(DOMi)@en[[[Attr]]]] node, or [VAR@en[node]] is an [CODE(DOMi)@en[[[Element]]]] node and its [[attribute list]] is copied, [[namespace prefix]], [[namespace]], [[local name]], and [[value]] of attributes [['''MUST''']] be copied. ;; [82] Other values, including [[specified]], are not copied. [89] The [CODE(DOMm)@en[[[isSupported]]]] method of the [CODE(DOMi)@en[[[Node]]]] interface [['''MUST''']] return [[true]]. [90] If a non-[[null]] value is set to the [VAR@en[handler]] argument to the [CODE(DOMm)@en[[[setUserData]]]] method of the [CODE(DOMi)@en[[[Node]]]] interface, a "[CODE(DOMe)@en[[[NotSupportedError]]]]" [['''MAY''']] be thrown. * Extension to the [CODE(DOMi)@en[Element]] interface [54] Manakai's [CODE(DOMi)@en[[[Element]]]] objects implement the [CODE(DOMa)@en[[[innerHTML]]]] attribute of the [CODE(DOMi)@en[[[HTMLElement]]]] interface. ** Element type accessor [FIG[ [83] [PRE(IDL code)[ [[partial]] [[interface]] [[Element]] { [[readonly]] [[attribute]] [[DOMString]] [[manakaiTagName]]; }; ]PRE] ]FIG] [84] The [DFN[[CODE(DOMa)@en[[[manakaiTagName]]]]]] [[attribute]] of the [CODE(DOMi)@en[[[Element]]]] interface [['''MUST''']] return the same value as the [CODE(DOMa)@en[[[tagName]]]] attribute, except that the return value are not converted to uppercase even when the [[context object]] is an [[HTML element]]. [12] The [DFN@en[[CODE(DOMm)@en[[[manakaiElementTypeMatch]]]] method]] returns whether the [CODE(DOMi)@en[[[Element]]]] belongs to the specified element type or not. This method takes two parameters: [CODE(DOMp)@en[[[namespaceURI]]]] and [CODE(DOMp)@en[[[localName]]]]. The [CODE(DOMp)@en[[[namespaceURI]]]] parameter is a [CODE(DOMi)@en[[[DOMString]]]]. It represents the namespace URI of the element type to test. Both [CODE(IDL)@en[[[null]]]] and an empty string represents the null namespace as in the [CODE(DOMp)@en[[[namespaceURI]]]] parameters of other similar methods. The [CODE(DOMp)@en[[[localName]]]] parameter is a [CODE(DOMi)@en[[[DOMString]]]]. It represents the local name of the element type to test. This method returns a [CODE(IDL)@en[[[boolean]]]] value. This method [['''MUST''']] return [CODE(IDL)@en[[[null]]]] if and only if: - The [CODE(DOMi)@en[[[namespaceURI]]]] of the [CODE(DOMi)@en[[[Element]]]] is [CODE(IDL)@en[[[null]]]], the [CODE(DOMp)@en[[[namespaceURI]]]] parameter is set to either [CODE(IDL)@en[[[null]]]] or an empty string, and the [CODE(DOMp)@en[[[localName]]]] parameter is set to the same value as the [CODE(DOMa)@en[[[manakaiLocalName]]]] attribute of the [CODE(DOMi)@en[[[Element]]]], or - The [CODE(DOPMp)@en[[[namespaceURI]]]] parameter is set to a non-empty [CODE(DOMi)@en[[[DOMString]]]] and it is equal to the [CODE(DOMi)@en[[[namespaceURI]]]] of the [CODE(DOMi)@en[[[Element]]]] and the [CODE(DOMp)@en[[[localName]]]] parameter is set to the same value as the [CODE(DOMa)@en[[[manakaiLocalName]]]] attribute of the [CODE(DOMi)@en[[[Element]]]]. Otherwise, the method [['''MUST''']] return [CODE(IDL)@en[[[false]]]]. ** Metadata accessor [18] The [DFN@en[[CODE(DOMa)@en[[[manakaiBaseURI]]]] attribute]] of the [CODE(DOMi)@en[[[Element]]]] and [CODE(DOMi)@en[[[ProcessingInstruction]]]] interfaces corresponding to the [CODE(InfoProp)@en[[[base URI]]]] property in the XML Information Set. It contains the base DOM URI of the [CODE(DOMi)@en[[[Element]]]] or [CODE(DOMi)@en[[[ProcessingInstruction]]]] object, if it is explicitly set to the object. ;; To obtain the computed base URI of the [CODE(DOMi)@en[[[Element]]]] or [CODE(DOMi)@en[[[ProcessingInstruction]]]] object, use the [CODE(DOMa)@en[[[baseURI]]]] attribute of the [CODE(DOMi)@en[[[Node]]]] interface instead. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-write. On getting, the base DOM URI [['''MUST''']] be returned if it is specified to the [CODE(DOMi)@en[[[Element]]]] or [CODE(DOMi)@en[[[ProcessingInstruction]]]] object. Otherwise, [CODE(IDL)@en[[[null]]]] [['''MUST''']] be returned. On setting, if the [CODE(DOMi)@en[[[Element]]]] or [CODE(DOMi)@en[[[ProcessingInstruction]]]] object is read-only, then a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] [['''MUST''']] be thrown. Otherwise, if the new value is [CODE(IDL)@en[[[null]]]], then the explicit specification of the base URI of the [CODE(DOMi)@en[[[Element]]]] or [CODE(DOMi)@en[[[ProcessingInstruction]]]] object is unset. Otherwise, the new value is set to the [CODE(DOMi)@en[[[Element]]]] or [CODE(DOMi)@en[[[ProcessingInstruction]]]] object as the base URI. Note that no lexical checking is performed on the new value. ;; The [CODE(DOMa)@en[[[manakaiBaseURI]]]], which is analogue to the [CODE(InfoProp)@en[[[base URI]]]] property, is independent from the [CODE(XMLa)@en[[[xml]]:[[base]]]] attribute. Setting the [CODE(DOMa)@en[[[manakaiBaseURI]]]] does not affect to the [CODE(XMLa)@en[[[xml]]:[[base]]]] or any other base URI sources and vice versa. ** Identifiers [FIG[ [104] [PRE(IDL code)[ [[partial]] [[interface]] [[Element]] { [[readonly]] [[attribute]] [[DOMString]][] [[manakaiIds]]; }; ]PRE] ]FIG] [55] The [DFN@en[[CODE(DOMa)@en[manakaiIds]] attribute]] of an element [VAR@en[element]], on getting, [['''MUST''']] follow the steps below: [FIG[ = Let [VAR@en[list]] a new empty [DEL[[CODE(DOMi)@en[[[DOMStringList]]]]]] [CODE(DOMi)@en[[[DOMString]]'''['''''']''']] object. = For each [CODE(DOMi)@en[[[Attr]]]] [VAR@en[attribute]] in the [CODE(DOMa)@en[[[attributes]]]] list of the [VAR@en[element]]: == Skip the following substeps if the [CODE(DOMa)@en[[[isId]]]] of the [VAR@en[attribute]] is false. == Let [VAR@en[value]] the [CODE(DOMa)@en[[[value]]]] of the [VAR@en[attribute]]. == Append [VAR@en[value]] to [VAR@en[list]] if there is no string that is equal to [VAR@en[value]] in [VAR@en[list]] yet. = Return [VAR@en[list]]. ]FIG] ;; The [DEL[[CODE(DOMi)@en[[[DOMStringList]]]]]] [CODE(DOMi)@en[[[DOMString]]'''['''''']''']] object returned by this attribute is ''not'' [[live]]. ;; Values contained in the [DEL[[CODE(DOMi)@en[[[DOMStringList]]]]]] [CODE(DOMi)@en[[[DOMString]]'''['''''']''']] object returned by this attribute might not be a valid ID; for example, it might be the empty string, or there are another element with same ID in the earlier part of the document in tree order. ;; The order in which strings are listed in the [DEL[[CODE(DOMi)@en[[[DOMStringList]]]]]] [CODE(DOMi)@en[[[DOMString]]'''['''''']''']] object depends on the order of the [CODE(DOMi)@en[[[Attr]]]] nodes in the [CODE(DOMa)@en[[[attributes]]]] attribute. In other word, the order is implementation dependent but is stable in a specific implementation. [DEL[ The type of this attribute is [CODE(DOMi)@en[[[DOMStringList]]]]. This attribute is read-only. ]DEL] * Extension to the [CODE(DOMi)@en[NodeList]] and the [CODE(DOMi)@en[NamedNodeMap]] interfaces [8] The [DFN@en[[CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute]] contains whether the [CODE(DOMi)@en[[[NodeList]]]] or [CODE(DOMi)@en[[[NamedNodeMap]]]] is read-only or not. The type of this attribute is [CODE(IDL)@en[[[boolean]]]]. This attribute is read-only. @@ ISSUE: Is setter necessary? = If the [CODE(DOMi)@en[[[NodeList]]]] or [CODE(DOMi)@en[[[NamedNodeMap]]]] is the read-only attribute value of a [CODE(DOMi)@en[[[Node]]]], then the getter [['''MUST''']] return the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute value of the [CODE(DOMi)@en[[[Node]]]]. = Otherwise, if the [CODE(DOMi)@en[[[NodeList]]]] is the [CODE(DOMa)@en[[[childNodes]]]] attribute value of a [CODE(DOMi)@en[[[Node]]]] whose [CODE(DOMa)@en[[[nodeType]]]] does never have any child by definition, then the getter [['''MUST''']] return [CODE(IDL)@en[[[true]]]]. = Otherwise, the getter [['''MUST''']] return [CODE(IDL)@en[[[true]]]] unless otherwise specified. ;; For example, the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute of the [CODE(DOMa)@en[[[childNodes]]]] [CODE(DOMi)@en[[[NodeList]]]] of an [CODE(DOMi)@en[[[Element]]]] has same value as the [CODE(DOMa)@en[[[manakaiReadOnly]]]] of the [CODE(DOMi)@en[[[Element]]]], while the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute of a [CODE(DOMi)@en[[[NodeList]]]] obtained by the [CODE(DOMm)@en[[[getElementsByTagNameNS]]]] method of that [CODE(DOMi)@en[[[Element]]]] or the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute of a [CODE(DOMi)@en[[[NodeList]]]] of a [CODE(DOMi)@en[[[ProcessingInstruction]]]] always exhibit [CODE(IDL)@en[[[true]]]]. * Extension to the [CODE(DOMi)@en[Attr]] interface [FIG[ [85] [PRE(IDL code)[ [[partial]] [[interface]] [[Attr]] { [[readonly]] [[attribute]] [[DOMString]] [[manakaiName]]; }; ]PRE] ]FIG] [86] The [DFN[[CODE(DOMa)@en[[[manakaiName]]]]]] [[attribute]] of the [CODE(DOMi)@en[[[Attr]]]] [[interface]] [['''MUST''']] return the [[name]] of the [[context object]]. ;; [87] Use of this attribute is discouraged in favor of the [CODE(DOMa)@en[[[name]]]] attribute. ** Setter extension [DEL[ [19] The [DFN@en[[CODE(DOMa)@en[[[specified]]]] attribute]] is now read-write. [FIG[ [PRE(IDL code)[ [[partial]] [[interface]] [[Attr]] { [[attribute]] [[boolean]] [[specified]]; } ]PRE] ]FIG] [DEL[ On setting, if the [CODE(DOMi)@en[[[Attr]]]] is read-only, then an [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, the new value [['''MUST''']] set as the [CODE(DOMa)@en[[[specified]]]] flag of the [CODE(DOMi)@en[[[Attr]]]], except when the [CODE(DOMa)@en[[[ownerElement]]]] of the [CODE(DOMi)@en[[[Attr]]]] is [CODE(IDL)@en[[[null]]]], in which case the [CODE(DOMa)@en[[[specified]]]] flag [['''MUST''']] be set to [CODE(IDL)@en[[[true]]]] (if not yet) nevertheless the new value. ]DEL] [77] On setting, the [DFN[[CODE(DOMa)@en[[[specified]]]] attribute]] of the [CODE(DOMi)@en[[[Attr]]]] interface [['''MUST''']] set the [[specified]] flag of the [[context object]] to the newly-specified value. ;; [76] Note that setting [CODE(DOMa)@en[[[specified]]]] flag to [CODE(IDL)@en[[[false]]]] might make the serialized representation of the [CODE(DOMi)@en[[[Document]]]] inconsistent with the [CODE(DOMi)@en[[[Document]]]] itself. ]DEL] [102] The [DFN[[CODE(DOMa)@en[[[specified]]]]]] attribute [['''MUST''']] return true. [DEL[ [20] The [DFN@en[[CODE(DOMa)@en[[[isId]]]] attribute]] is now read-write. On setting, if the [CODE(DOMi)@en[[[Attr]]]] is read-only, then an [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, the flag that represents whether the [CODE(DOMi)@en[[[Attr]]]] is a user-determined ID attribute or not [['''MUST''']] be set to the new value. ;; Setting [CODE(IDL)@en[[[false]]]] to this attribute does not make the [CODE(DOMi)@en[[[Attr]]]] non-[CODE(XML)@en[[[ID]]]] if the [CODE(DOMi)@en[[[Attr]]]] is marked as an [CODE(XML)@en[[[ID]]]] by other mean than the user-determined [CODE(XML)@en[[[ID]]]] flag, e.g. by DTD attribute definition. ]DEL] [103] The [DFN[[CODE(DOMa)@en[[[isId]]]]]] attribute [['''MUST''']] return true if the [[namespace]] of the [[context object]] is [[null]] and the [[local name]] of the [[context object]] is [CODE[[[id]]]], or false otherwise. ** Attribute type accessor [21] The [DFN@en[[CODE(DOMa)@en[[[manakaiAttributeType]]]] attribute]] contains the declared type of the [CODE(DOMi)@en[[[Attr]]]]. The type of this attribute is [CODE(IDL)@en[[[unsigned short]]]]. This attribute is read-write. ;; This attribute corresponding to the [CODE(InfoProp)@en[[[attribute type]]]] property of an attribute information item in the XML Information Set. The getter [['''MUST''']] return the declared type of the [CODE(DOMi)@en[[[Attr]]]]. It is expected that a constant in the [CODE(DOM)@en[[[DeclaredValueType]]]] constant group is returned. If no declared type is explicitly set, then [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] [['''MUST''']] be returned. On setting, if the [CODE(DOMi)@en[[[Attr]]]] is read-only, then an [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, the new value [['''MUST''']] be set as the attribute value. It is expected that a constant in the [CODE(DOM)@en[[[DeclaredValueType]]]] constant group is set to the attribute, though it is not checked by the attribute. * Extensions to the [CODE(DOMi)@en[DocumentType]] interface ** Children [48] [CODE(DOMi)@en[[[DocumentType]]]] nodes [['''MAY''']] contain zero or more [CODE(DOMi)@en[[[ProcessingInstruction]]]] nodes in its child node list. If a [CODE(DOMi)@en[[[DocumentType]]]] node is created from the document type declaration information item in an XML information set, the [CODE(InfoProp)@en[[[children]]]] list [['''MUST''']] be reflected to the [CODE(DOMa)@en[[[childNodes]]]] list of the [CODE(DOMi)@en[[[DocumentType]]]] node; the list [['''MUST''']] contain zero or more [CODE(DOMi)@en[[[ProcessingInstruction]]]] nodes created from the processing instruction information items in the [CODE(InfoProp)@en[[[children]]]] list in the same order. If a [CODE(DOMi)@en[[[DocumentType]]]] node is mapped to a document type declaration information item, the [CODE(InfoProp)@en[[[children]]]] list [['''MUST''']] reflect the [CODE(DOMa)@en[[[childNodes]]]] list of the [CODE(DOMi)@en[[[DocumentType]]]] node; the list [['''MUST''']] contain zero or more processing instruction information items mapped from the [CODE(DOMi)@en[[[ProcessingInstruction]]]] nodes in the [CODE(DOMa)@en[[[childNodes]]]] list in the same order. If a parser create a [CODE(DOMi)@en[[[DocumentType]]]] node and mark it as read-only, then all child nodes [['''MUST''']] also be marked as read-only. ** [37] The [DFN@en[[CODE(DOMa)@en[[[publicId]]]] attribute]] and the [DFN@en[[CODE(DOMa)@en[[[systemId]]]] attribute]] of [CODE(DOMi)@en[[[DocumentType]]]], [CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]] objects are now read-write. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the [CODE(DOMi)@en[[[Node]]]] object is read-only. Otherwise, it [['''MUST''']] set the specified value to the attribute. No normalization, lexical validation, or relative reference resolving is performed. [CODE(IDL)@en[[[null]]]], which represents no public or system identifier is provided, might be specified. Setting public or system identifier does never result in any lexical or logical structure of the document being changed. In particular, no external entity referenced by new identifier will be loaded. ;; Setting an invalid or non-normalized identifier might make the object non-serializable. Setting a non-[CODE(IDL)@en[[[null]]]] public identifier to a [CODE(DOMi)@en[[[DocumentType]]]] or [CODE(DOMi)@en[[[Entity]]]] object that does not have non-[CODE(IDL)@en[[[null]]]] system identifier or setting [CODE(IDL)@en[[[null]]]] as the system identifier of a [CODE(DOMi)@en[[[DocumentType]]]] or [CODE(DOMi)@en[[[Entity]]]] object that does have non-[CODE(IDL)@en[[[null]]]] public identifier will make that object non-serializable. @@ ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings. [41] The [DFN@en[[CODE(DOMa)@en[[[declarationBaseURI]]]] attribute]] and the [DFN@en[[CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]] attribute]] of a [CODE(DOMi)@en[[[DocumentType]]]] object represent the base DOM URI of the [CODE(DOMi)@en[[[DocumentType]]]] object. Use of [CODE(DOMa)@en[[[declarationBaseURI]]]] attribute is ''deprecated''. ;; It is the base URI of the document type declaration if the [CODE(DOMi)@en[[[DocumentType]]]] object comes from an XML document entity and can be used to resolve relative DOM URI specified to the [CODE(DOMa)@en[[[systemId]]]] attribute of the [CODE(DOMi)@en[[[DocumentType]]]] object. This attribute is read-write. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. The getter [['''MUST''']] return the value of the [CODE(DOMa)@en[[[baseURI]]]] attribute of the [CODE(DOMa)@en[[[ownerDocument]]]] of the [CODE(DOMi)@en[[[DocumentType]]]] object if the [CODE(DOMa)@en[[[ownerDocument]]]] attribute is not [CODE(IDL)@en[[[null]]]]. If it is [CODE(IDL)@en[[[null]]]], the getter [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. The setter [['''MUST''']] do nothing, including when the [CODE(DOMi)@en[[[DocumentType]]]] object is read-only. ** Implementation Information [49] The [DFN@en[[CODE(DOMa)@en[[[implementation]]]] attribute]] represents the DOM implementation which the [CODE(DOMi)@en[[[DocumentType]]]] node belongs to. This attribute is read-only. The type of this attribute is [CODE(DOMi)@en[[[DOMImplementation]]]]. The getter of this attribute [['''MUST''']] return the [CODE(DOMi)@en[[[DOMImplementation]]]] object which the [CODE(DOMi)@en[[[DocumentType]]]] node belongs to. * Extensions to the [CODE(DOMi)@en[[[Entity]]]] interface ** Entity Identifiers [FIG{ [117] [PRE(IDL code)[ [[partial]] [[interface]] [[Entity]] { [[attribute]] [[DOMString]] [[publicId]]; [[attribute]] [[DOMString]] [[systemId]]; [[attribute]] [[DOMString]]? [[declarationBaseURI]]; [[attribute]] [[DOMString]]? [[manakaiDeclarationBaseURI]]; [[attribute]] [[DOMString]]? [[manakaiEntityBaseURI]]; [[attribute]] [[DOMString]]? [[manakaiEntityURI]]; }; [[partial]] [[interface]] [[Notation]] { [[attribute]] [[DOMString]]? [[manakaiDeclarationBaseURI]]; }; ]PRE] ]FIG] [38] The [DFN@en[[CODE(DOMa)@en[[[publicId]]]] attribute]] and the [DFN@en[[CODE(DOMa)@en[[[systemId]]]] attribute]] of the [CODE(DOMi)@en[[[Entity]]]] interface is so extended that they are read-write. See >>37 for the complete definition. [40] The [DFN@en[[CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]] attribute]] of an [CODE(DOMi)@en[[[Entity]]]] or [CODE(DOMi)@en[[[Notation]]]] object and the [DFN[[CODE(DOMa)@en[[[declarationBaseURI]]]]]] attribute of the [CODE(DOMi)@en[[[Entity]]]] object represents the base DOM URI of the entity or notation declaration by which the entity or notation represented by the [CODE(DOMi)@en[[[Node]]]] object is declared. The getter [['''MUST''']] return the declaration base DOM URI. If there is no explicit declaration base URI information attached to the [CODE(DOMi)@en[[[Node]]]] object, then the base URI of the [CODE(DOMi)@en[[[Node]]]] object, i.e. the [CODE(DOMa)@en[[[baseURI]]]] attribute value of the [CODE(DOMi)@en[[[Node]]]] object, [['''MUST''']] be returned. ;; Note that if there is no explicit base URI information attached to the [CODE(DOMi)@en[[[Node]]]] object and the [CODE(DOMa)@en[[[baseURI]]]] attribute of that object is [CODE(IDL)@en[[[null]]]], then the value of this attribute is also [CODE(IDL)@en[[[null]]]]. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the [CODE(DOMi)@en[[[Node]]]] object is read-only. Otherwise, it [['''MUST''']] set the specified value as the declaration base DOM URI of the [CODE(DOMi)@en[[[Node]]]] object. The specified value must be an absolute DOM URI. However, no lexical validation or relative reference resolution is performed on setting. In addition, it does not affect on the value of [CODE(DOMa)@en[[[systemId]]]] attribute, the replacement subtree of the [CODE(DOMi)@en[[[Entity]]]] object, nor any of entity reference or notation attribute in the document. If [CODE(IDL)@en[[[null]]]] is specified, the declaration base DOM URI of the [CODE(DOMi)@en[[[Node]]]] is unset. It does not affect to the [CODE(DOMa)@en[[[baseURI]]]] attribute. If an [CODE(DOMi)@en[[[Entity]]]] or [CODE(DOMi)@en[[[Notation]]]] object is created from an XML Information Set information item, the [CODE(InfoProp)@en[[[declaration base URI]]]] property value, if specified, or [CODE(IDL)@en[[[null]]]] otherwise, [['''MUST''']] be set to this attribute. If an [CODE(DOMi)@en[[[Entity]]]] or [CODE(DOMi)@en[[[Notation]]]] object is mapped to an unexpanded entity information item or a notation information item, the [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]] attribute value, if it is non-[CODE(IDL)@en[[[null]]]], or [[no value]] otherwise, [['''MUST''']] be set to the [CODE(InfoProp)@en[[[declaration base URI]]]] property of the information item. [44] The [DFN@en[[CODE(DOMa)@en[[[manakaiEntityBaseURI]]]] attribute]] of an [CODE(DOMi)@en[[[Entity]]]] object represents the base DOM URI of the entity represented by the [CODE(DOMi)@en[[[Entity]]]] object. This attribute is read-write. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. The getter [['''MUST''']] return the base DOM URI of the entity by the following algorithm: = If the base DOM URI of the referenced entity is explicitly specified to the object, then return it. = Otherwise, if the [CODE(DOMa)@en[[[manakaiEntityURI]]]] attribute of the object has non-[CODE(IDL)@en[[[null]]]] value, then return it. = Otherwise, return the [CODE(DOMa)@en[[[baseURI]]]] attribute value of the [CODE(DOMi)@en[[[EntityReference]]]] object. ;; Therefore, the entity base URI for internal general entities are same as the base URI for document unless explicitly overridden by the application. ;; Note that the algorithm might return [CODE(IDL)@en[[[null]]]]. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the object is read-only. Otherwise, if the specified value is [CODE(IDL)@en[[[null]]]], it [['''MUST''']] unset the explicit entity base URI specification for the object. Otherwise, it [['''MUST''']] set the specified value as the entity base URI of the object. The specified value must be an absolute DOM URI. However, no lexical validation or relative reference resolution is performed on the setting. Likewise, setting the value does not affect on the entity base URI of any [CODE(DOMi)@en[[[EntityReference]]]] object whose [CODE(DOMa)@en[[[nodeName]]]], [CODE(DOMa)@en[[[publicId]]]], or [CODE(DOMa)@en[[[systemId]]]] is same as the [CODE(DOMi)@en[[[Entity]]]] object's. The exception is the nodes in the subtree rooted by the [CODE(DOMi)@en[[[Entity]]]] object, where the new base URI might affect the base URIs of those objects. [45] The [DFN@en[[CODE(DOMa)@en[[[manakaiEntityURI]]]] attribute]] of an [CODE(DOMi)@en[[[Entity]]]] object represents the DOM URI of the entity represented by the object. ;; It might or might not be equal to the DOM URI contained in the [CODE(DOMa)@en[[[systemId]]]] attribute of the object or the absolute URI obtained by resolving [CODE(DOMa)@en[[[systemId]]]] attribute against [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]] attribute of the object. In particular, in case a catalog mechanism is used or a redirection is encountered during the entity resolution phase of the parsing, the entity URI is typically different from the one specified as the system identifier. @@ ISSUE: Security concern - in scripted implementation, it might be inappropriate to leak a URI of catalog-resolved entity. The getter [['''MUST''']] return the DOM URI of the entity obtained by the following algorithm: = If the DOM URI of the entity represented by the object is explicitly set by application or during the tree construction, then return it. = Otherwise, if the [CODE(DOMa)@en[[[systemId]]]] attribute of the object contains a non-[CODE(IDL)@en[[[null]]]] value, then return the value, resolved against the [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]] attribute value if the value is not an absolute DOM URI and that attribute value is not [CODE(IDL)@en[[[null]]]]. = Return [CODE(IDL)@en[[[null]]]]. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the object is read-only. Otherwise, if the specified value is [CODE(IDL)@en[[[null]]]], it [['''MUST''']] unset the explicit entity URI specification for the object. Otherwise, it [['''MUST''']] set the specified value as the entity URI of the object. The specified value must be an absolute DOM URI. However, no lexical validation or relative reference resolution is performed on the setting. Likewise, setting the value does not affect on the entity base URI of any [CODE(DOMi)@en[[[EntityReference]]]] object whose [CODE(DOMa)@en[[[nodeName]]]], [CODE(DOMa)@en[[[publicId]]]], or [CODE(DOMa)@en[[[systemId]]]] is same as the [CODE(DOMi)@en[[[Entity]]]] object's. The exception is the nodes in the subtree rooted by the [CODE(DOMi)@en[[[Entity]]]] object, where the new base URI might affect the base URIs of those objects. @@ TODO: We need to define the exact way to get absolute DOM URI from a relative DOM URI. (And "http://www.example.com/a/../b/" is normalized or not.) @@ ISSUE: Should we provide an attribute that contains the absolute URI representation of the system id? ** Character Encoding [52] The [DFN@en[[CODE(DOMa)@en[[[inputEncoding]]]] attribute]] of the [CODE(DOMi)@en[[[Entity]]]] interface is now read-write. See >>17 for the definition. ** Entity Content [27] The [DFN@en[[CODE(DOMa)@en[[[hasReplacementTree]]]] attribute]] of an [CODE(DOMi)@en[[[Entity]]]] object contains whether the structure of the replacement text is available via the child list of the [CODE(DOMi)@en[[[Entity]]]] or not. The type of this attribute is [CODE(IDL)@en[[[boolean]]]]. This attribute is read-write. The getter [['''MUST''']] return the value of the flag associated to this attribute. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the [CODE(DOMi)@en[[[Entity]]]] object is read-only. Otherwise, it [['''MUST''']] set the specified value to the flag associated to this attribute. If a parser create a [CODE(DOMi)@en[[[Entity]]]] object that represents a general entity, it set the value of this attribute. If it set this attribute as [CODE(IDL)@en[[[false]]]], then it [['''MUST''']] make the child list of the [CODE(DOMi)@en[[[Entity]]]] object empty. ;; An application might set this attribute as [CODE(IDL)@en[[[false]]]] even if the [CODE(DOMi)@en[[[Entity]]]] object has child nodes. If the value of this attribute is [CODE(IDL)@en[[[false]]]], any child of the [CODE(DOMi)@en[[[Entity]]]] object should be ignored for the purpose of e.g. serialization. When an [CODE(DOMi)@en[[[EntityReference]]]] object is created and then the subtree of the [CODE(DOMi)@en[[[Entity]]]] object is cloned to that object, any child node [['''MUST''']] be ignored if the attribute is set to [CODE(IDL)@en[[[false]]]]. ;; Newly created [CODE(DOMi)@en[[[Entity]]]] object by [CODE(DOMm)@en[[[createGeneralEntity]]]] has [CODE(DOMa)@en[[[hasReplacementTree]]]] attribute set to [CODE(IDL)@en[[[false]]]]. [46] The [DFN@en[[CODE(DOMa)@en[[[notationName]]]] attribute]] is now read-write. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the object is read-only. Otherwise, it [['''MUST''']] set the specified value as the notation name of the object. Note that the new value might be [CODE(IDL)@en[[[null]]]]. The setter perform no lexical validation of the new value. The new notation name might not be an XML Name and therefore the object might become non-serializable. In a well-formed XML document, unparsed entities have notation names and parsed entities do not. However, setting new value to the attribute might break this rule and the result document might be inconsistent. [47] The [DFN@en[[CODE(DOMa)@en[[[xmlEncoding]]]] attribute]] of the [CODE(DOMi)@en[[[Entity]]]] interface is now read-write. See >>26 for the definition. ** Parent [50] The [DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] of an [CODE(DOMi)@en[[[Entity]]]], [CODE(DOMi)@en[[[Notation]]]], or [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node is read-only and its type is [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]. Its value is the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node to which the [CODE(DOMi)@en[[[Node]]]] is attached. The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node in whose [CODE(DOMa)@en[[[generalEntities]]]], [CODE(DOMa)@en[[[notations]]]], or [CODE(DOMa)@en[[[elementTypes]]]] list the [CODE(DOMi)@en[[[Node]]]] is contained. There should be at most one such [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node. If there is no such node, then the attribute [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. * Extensions to the [CODE(DOMi)@en[EntityReference]] interface [36] The [DFN@en[[CODE(DOMa)@en[[[manakaiExpanded]]]] attribute]] of an [CODE(DOMi)@en[[[EntityReference]]]] object represents whether the entity reference is expanded so that its children list represents a part of the document. This attribute is read-write. The type of the this attribute is [CODE(IDL)@en[[[boolean]]]]. The getter [['''MUST''']] return the value of the flag associated to this attribute. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the [CODE(DOMi)@en[[[Entity]]]] object is read-only. Otherwise, it [['''MUST''']] set the specified value to the flag associated to this attribute. If a parser create a [CODE(DOMi)@en[[[EntityReference]]]] object that represents a general entity reference, it set the value of this attribute. If it set this attribute as [CODE(IDL)@en[[[false]]]], then it [['''MUST''']] make the child list of the [CODE(DOMi)@en[[[EntityReference]]]] object empty. ;; An application might set this attribute as [CODE(IDL)@en[[[false]]]] even if the [CODE(DOMi)@en[[[EntityReference]]]] object has child nodes. If the value of this attribute is [CODE(IDL)@en[[[false]]]], any child of the [CODE(DOMi)@en[[[EntityReference]]]] object should be ignored for the purpose of e.g. serialization. When an [CODE(DOMi)@en[[[EntityReference]]]] object is created and then the subtree of the [CODE(DOMi)@en[[[Entity]]]] object is cloned to that object, the [CODE(DOMa)@en[[[manakaiExpanded]]]] [['''MUST''']] be set to the same value as [CODE(DOMa)@en[[[hasReplacementTree]]]] attribute of that object. ;; Newly created [CODE(DOMi)@en[[[EntityReference]]]] object by [CODE(DOMm)@en[[[createEntityReference]]]] has [CODE(DOMa)@en[[[manakaiExpanded]]]] attribute set to [CODE(IDL)@en[[[false]]]] unless the replacement tree is cloned to the [CODE(DOMi)@en[[[EntityReference]]]] object. [42] The [DFN@en[[CODE(DOMa)@en[[[manakaiEntityBaseURI]]]] attribute]] of an [CODE(DOMi)@en[[[EntityReference]]]] object represents the base DOM URI of the entity referenced by the [CODE(DOMi)@en[[[EntityReference]]]] object. This attribute is read-write. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. The getter [['''MUST''']] return the base DOM URI of the entity by the following algorithm: = If the base DOM URI of the referenced entity is explicitly specified to the [CODE(DOMi)@en[[[EntityReference]]]] object, then return it. = Otherwise, return the [CODE(DOMa)@en[[[baseURI]]]] attribute value of the [CODE(DOMi)@en[[[EntityReference]]]] object. ;; Therefore, the entity base URI for internal general entities are same as the base URI for the external or document entity in which the entity is referenced, unless explicitly overridden later by application. ;; Note that the algorithm might return [CODE(IDL)@en[[[null]]]]. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the [CODE(DOMi)@en[[[EntityReference]]]] object is read-only. Otherwise, if the specified value is [CODE(IDL)@en[[[null]]]], it [['''MUST''']] unset the explicit entity base URI specification for the [CODE(DOMi)@en[[[EntityReference]]]] object. Otherwise, it [['''MUST''']] set the specified value as the entity base URI of the [CODE(DOMi)@en[[[EntityReference]]]] object. The specified value must be an absolute DOM URI. However, no lexical validation or relative reference resolution is performed on the setting. Likewise, setting the value does not affect on the entity base URI of any [CODE(DOMi)@en[[[Entity]]]] object and any other [CODE(DOMi)@en[[[EntityReference]]]] object whose [CODE(DOMa)@en[[[nodeName]]]], [CODE(DOMa)@en[[[publicId]]]], or [CODE(DOMa)@en[[[systemId]]]] is same as [CODE(DOMi)@en[[[EntityReference]]]] object's. ;; Setting [CODE(IDL)@en[[[null]]]] to this attribute removes the explicit entity base URI information attached to the [CODE(DOMi)@en[[[EntityReference]]]] object entirely and never restores the original entity base URI set during the tree construction, if any. To synchronize entity base URI with that of the [CODE(DOMi)@en[[[Entity]]]] objecet with same [CODE(DOMa)@en[[[name]]]] attribute, use [CODE(DOMm)@en[[[normalizeDocument]]]] method on the [CODE(DOMi)@en[[[Document]]]]. [43] The [DFN@en[[CODE(DOMa)@en[[[manakaiExternal]]]] attribute]] of an [CODE(DOMi)@en[[[EntityReference]]]] object represents whether the entity referenced by the object is an external entity or not. This attribute is read-write. The type of this attribute is [CODE(IDL)@en[[[boolean]]]]. The getter [['''MUST''']] return the value of the flag associated to this attribute. The setter [['''MUST''']] throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [CODE(DOMi)@en[[[DOMException]]]] if the object is read-only. Otherwise, it [['''MUST''']] set the specified value to the flag associated to this attribute. ;; Setting this attribute might make an object inconsistent with the [CODE(DOMi)@en[[[Entity]]]] object referenced by it, Such inconsistence might be fixed by the method [CODE(DOMm)@en[[[normalizeDocument]]]] on the [CODE(DOMi)@en[[[Document]]]] object. @@ TODO: DOM accessor to [CODE(InfoProp)@en[[[system identifier]]]], [CODE(InfoProp)@en[[[public identifier]]]], and [CODE(InfoProp)@en[[[declaration base URI]]]] of an unexpanded entity reference information item. * Extensions to the [CODE(DOMi)@en[Notation]] Interface ** Notation Identifiers [39] The [DFN@en[[CODE(DOMa)@en[[[publicId]]]] attribute]] and the [DFN@en[[CODE(DOMa)@en[[[systemId]]]] attribute]] of the [CODE(DOMi)@en[[[Notation]]]] interface is so extended that they are read-write. See >>37 for the complete definition. ** Parent [51] The [DFN@en[[CODE(DOMi)@en[[[ownerDocumentTypeDefinition]]]] attribute]] of the [CODE(DOMi)@en[[[Notation]]]] interface is defined at >>50. * Extension to the [CODE(DOMi)@en[ProcessingInstruction]] Interface ** Base URI [28] The [DFN@en[[CODE(DOMa)@en[[[manakaiBaseURI]]]] attribute]] is added to the [CODE(DOMi)@en[[[ProcessingInstruction]]]] interface as well as the [CODE(DOMi)@en[[[Element]]]] interface. See >>18 for details. * The [CODE(DOMi)@en[DOMConfiguration]] interface [FIG[ [92] [PRE(IDL code)[ [[partial]] [[interface]] [[DOMConfiguration]] { [[readonly]] [[attribute]] [[DOMString]][] [[parameterNames]]; }; ]PRE] ]FIG] [93] The [CODE(DOMa)@en[[[parameterNames]]]] attribute [['''MUST''']] return the [[read only array]] of the parameter names ([CODE(DOM)@en[[[DOMString]]'''['''''']''']], not [CODE(DOMi)@en[[[DOMStringList]]]] as specified in [[DOM3 Core]]), associated with the [[document]]. The attribute [['''MUST''']] returns the same object every time it is invoked with same [[context object]]. The items [['''MUST''']] be sorted by code point order. [94] The [CODE(DOMa)@en[[[domConfig]]]] attribute of the [CODE(DOMi)@en[[[Document]]]] interface [['''MUST''']] return the same object every time it is invoked with same [[context object]]. [101] If a parameter is an [DFN[alias]] of another parameter, methods [CODE(DOMm)@en[[[getParameter]]]], [CODE(DOMm)@en[[[setParameter]]]], and [CODE(DOMm)@en[[[canSetParameter]]]] [['''MUST''']] treat those names as equivalent. [97] The parameter [DFN[[CODE[[[manakai-create-child-element]]]]]] specifies whether several [[Atom DOM]] attributes should create a child element if it is not exists. The expected value type of the parameter is [[boolean]]. The default value is [[false]]. The parameter [DFN[[CODE[[[http://suika.fam.cx/www/2006/dom-config/create-child-element]]]]]] is an alias of the parameter [CODE[[[manakai-create-child-element]]]]. [99] The parameter [DFN[[CODE[[[manakai-strict-document-children]]]]]] specifies whether the constraints on [CODE(DOMi)@en[[[Document]]]] node's child nodes should not be relaxed or not. The expected value type of the parameter is [[boolean]]. The default value is [[true]]. The parameter [DFN[[CODE[[[http://suika.fam.cx/www/2006/dom-config/strict-document-children]]]]]] is an alias of the paramter [CODE[[[manakai-strict-document-children]]]]. [95] The parameter [DFN[[CODE[[[http://suika.fam.cx/www/2006/dom-config/clone-entity-reference-subtree]]]]]] specifies whether the entity reference subtree should be cloned from corresponding entity node upon creation of the node. The expected value type of the parameter is [[boolean]]. If it is the [[DOM3]] implementation, the default value is [[true]]. Otherwise, the default value is [[false]]. [96] The parameter [DFN[[CODE[[[http://suika.fam.cx/www/2006/dom-config/dtd-attribute-type]]]]]] specifies whether the [[DTD]] attribute type should be set to the [CODE(DOMa)@en[[[schemaTypeInfo]]]] attribute of the newly created attribute node or not. The expected value type of the parameter is [[boolean]]. If it is the [[DOM3]] implementation, the default value is [[true]]. Otherwise, the default value is [[false]]. [98] The parameter [DFN[[CODE[[[http://suika.fam.cx/www/2006/dom-config/dtd-default-attribute]]]]]] specifies whether the [[DTD]] default attributes should be automatically set to elements or not. The expected value type of the parameter is [[boolean]]. If it is the [[DOM3]] implementation, the default value is [[true]]. Otherwise, the default value is [[false]]. [100] The parameter [DFN[[CODE[[[http://suika.fam.cx/www/2006/dom-config/xml-id]]]]]] specifies whether the processing of the [CODE(XMLa)@en[[[xml:id]]]] attribute should be enabled or not. The expected value type of the parameter is [[boolean]]. If it is the [[DOM3]] implementation, the default value is [[true]]. Otherwise, the default value is [[false]]. * Extension to the [CODE(DOMi)@en[[[DOMLocator]]]] interface [22] The [DFN@en[[CODE(DOMa)@en[[[utf32Offset]]]] attribute]] represents the [[UTF-32]] offset into the input source the [CODE(DOMi)@en[[[DOMLocator]]]] is pointing to. The type of this attribute is [CODE(IDL)@en[[[long]]]]. This attribute is read-only. The getter [['''MUST''']] return the [[UTF-32]] offset specified when the [CODE(DOMi)@en[[[DOMLocator]]]] object is created. If no such information is provided, then [CODE(IDL)@en[[[-1]]]] [['''MUST''']] be returned. * Extensions to the [CODE(DOMi)@en[TextTrack]] interface [59] [PRE(IDL code)[ partial interface TextTrack { readonly attribute boolean manakaiIsInvalid; readonly attribute TextTrackCueList manakaiAllCues; TextTrack manakaiCloneTrack(); }; ]PRE] [60] The [DFN[[CODE(DOMa)@en[[[manakaiIsInvalid]]]]]] attribute of the [CODE(DOMi)@en[[[TextTrack]]]] object, on getting, [['''MUST''']] return true if the track has been created by a [[WebVTT parser]] and the [[WebVTT parser]] has reported that the [[WebVTT file]] from which the track object was created cannot be successfully processed as WebVTT. Otherwise, it [['''MUST''']] return false. ;; For the purpose of this method, a [[WebVTT]] file is invalid if it does not contain the WebVTT signature such that the [[WebVTT parser]] does not continue to parse the file. Any other conformance error does not cause the attribute return true. [61] The [DFN[[CODE(DOMa)@en[[[manakaiAllCues]]]]]] attribute of the [CODE(DOMi)@en[[[TextTrack]]]] object, on getting, [['''MUST''']] return the [[live]] list that contains the cues found in the track, whether active or not, or effective or not. [62] The [DFN[[CODE(DOMm)@en[[[manakaiCloneTrack]]]]]] method of the [CODE(DOMi)@en[[[TextTrack]]]] object [['''MUST''']] return a new [CODE(DOMi)@en[[[TextTrack]]]] object. The new object [['''MUST''']] have the same values as the original object for the attributes: [CODE(DOMa)@en[[[kind]]]], [CODE(DOMa)@en[[[label]]]], [CODE(DOMa)@en[[[language]]]], [CODE(DOMa)@en[[[mode]]]], and [CODE(DOMa)@en[[[manakaiIsInvalid]]]]. The [CODE(DOMa)@en[[[manakaiAllCues]]]] attribute of the new object [['''MUST''']] have a new [CODE(DOMi)@en[[[TextTrackCueList]]]] object, containing the clones of the cues in the [CODE(DOMa)@en[[[manakaiAllCues]]]] list of the original object, in order. The clones [['''MUST''']] be the object that would be created by the [CODE(DOMm)@en[[[manakaiCloneCue]]]] method of the cues, with their [CODE(DOMa)@en[[[track]]]] attributes set to the new [CODE(DOMi)@en[[[TextTrack]]]] object. * Extensions to the [CODE(DOMi)@en[TextTrackCue]] interface [56] [PRE(IDL code)[ partial interface TextTrackCue { readonly attribute long manakaiLine; readonly attribute long manakaiColumn; TextTrackCue manakaiCloneCue(); }; ]PRE] [57] The [DFN[[CODE(DOMa)@en[[[manakaiLine]]]]]] attribute of the [CODE(DOMi)@en[[[TextTrackCue]]]] object, on getting, [['''MUST''']] return the line number in the original resource at which the cue is declared, if available, or the value -1, otherwise. [58] The [DFN[[CODE(DOMa)@en[[[manakaiColumn]]]]]] attribute of the [CODE(DOMi)@en[[[TextTrackCue]]]] object, on getting, [['''MUST''']] return the column number in the original resource at which the cue is declared, if available, or the value -1, otherwise. [63] The [DFN[[CODE(DOMm)@en[[[manakaiCloneCue]]]]]] method of the [CODE(DOMi)@en[[[TextTrackCue]]]] object [['''MUST''']] return a new [CODE(DOMi)@en[[[TextTrackCue]]]] object. The new object [['''MUST''']] have the same values as the original object for the attributes: [CODE(DOMa)@en[[[id]]]], [CODE(DOMa)@en[[[startTime]]]], [CODE(DOMa)@en[[[endTime]]]], [CODE(DOMa)@en[[[pauseOnExit]]]], [CODE(DOMa)@en[[[vertical]]]], [CODE(DOMa)@en[[[snapToLines]]]], [CODE(DOMa)@en[[[line]]]], [CODE(DOMa)@en[[[position]]]], [CODE(DOMa)@en[[[size]]]], [CODE(DOMa)@en[[[align]]]], and [CODE(DOMa)@en[[[text]]]]. * The [CODE(DOMi)@en[URIReference]] interface [FIG[ [105] [PRE(IDL code)[ [[partial]] [[interface]] [[DOMImplementation]] { [[URIReference]] [[createURIReference]](([[DOMString]] or [[URIReference]]) url); }; [NoInterfaceObject] [[interface]] [[URIReference]] { [[attribute]] [[DOMString]] [[uriReference]]; [[attribute]] [[DOMString]] [[uriScheme]]; [[attribute]] [[DOMString]] [[uriAuthority]]; [[attribute]] [[DOMString]] [[uriUserinfo]]; [[attribute]] [[DOMString]] [[uriHost]]; [[attribute]] [[DOMString]] [[uriPort]]; [[attribute]] [[DOMString]] [[uriPath]]; [[attribute]] [[DOMString]] [[uriQuery]]; [[attribute]] [[DOMString]] [[uriFragment]]; [[DOMString]][] [[getURIPathSegment]]([[unsigned long]] index); [[void]] [[setURIPathSegment]]([[unsigned long]] index, [[DOMString]] newValue); [[boolean]] [[isURI]](); [[boolean]] [[isURI3986]](); [[boolean]] [[isIRI]](); [[boolean]] [[isIRI3987]](); [[boolean]] [[isRelativeReference]](); [[boolean]] [[isRelativeReference3986]](); [[boolean]] [[isRelativeIRIReference]](); [[boolean]] [[isRelativeIRIReference3987]](); [[boolean]] [[isURIReference]](); [[boolean]] [[isURIReference3986]](); [[boolean]] [[isIRIReference]](); [[boolean]] [[isIRIReference3987]](); [[boolean]] [[isAbsoluteURI]](); [[boolean]] [[isAbsoluteURI3986]](); [[boolean]] [[isAbsoluteIRI]](); [[boolean]] [[isAbsoluteIRI3987]](); [[boolean]] [[isEmptyReference]](); [[URIReference]] [[getURIReference]](); [[URIReference]] [[getURIReference3986]](); [[URIReference]] [[getIRIReference]](); [[URIReference]] [[getIRIReference3987]](); [[URIReference]] [[getAbsoluteReference]](([[DOMString]] or [[URIReference]]) base, any opt...); [[URIReference]] [[getAbsoluteReference3986]](([[DOMString]] or [[URIReference]]) base, any opt...); [[URIReference]] [[getAbsoluteReference3987]](([[DOMString]] or [[URIReference]]) base, any opt...); [[boolean]] [[isSameDocumentReference]](([[DOMString]] or [[URIReference]]) base); [[boolean]] [[isSameDocumentReference3986]](([[DOMString]] or [[URIReference]]) base); [[boolean]] [[getRelativeReference]](([[DOMString]] or [[URIReference]]) base); [[URIReference]] [[cloneURIReference]](); }; ]PRE] ]FIG] [106] The [DFN[[CODE(DOMm)@en[[[createURIReference]]]]]] [[method]] [['''MUST''']] run the following steps: [FIG[ = If [VAR@en[url]] is a [CODE(DOMi)@en[[[URIReference]]]] object, let [VAR@en[url]] be the [[url]] of [VAR@en[url]]. = Create a new [CODE(DOMi)@en[[[URIReference]]]] object whose [[url]] is [VAR[url]] and return the object. ]FIG] [107] In [[DOM Perl Binding]], [VAR@en[url]] [['''MAY''']] be a reference to the string. It [['''MUST''']] be dereferenced before the aforementioned steps are invoked. [110] The [DFN[[CODE(DOMi)@en[[[URIReference]]]]]] object represents a [[URL]]. It has the associated [[url]]. [108] The [DFN[[CODE(DOMa)@en[[[uriReference]]]]]] attribute of the [CODE(DOMi)@en[[[URIReference]]]] object, on getting, [['''MUST''']] return the [[url]] of the [[context object]]. On setting, the attribute [['''MUST''']] set the [[url]] of the [[context object]] to the new value. [109] In [[DOM Perl binding]], the [CODE(perl)@en[[[stringify]]]] method of the [CODE(DOMi)@en[[[URIReference]]]] object [['''MUST''']] return the [[url]] of the [[context object]]. [111] Attributes [DFN[[CODE(DOMa)@en[[[uriScheme]]]]]], [DFN[[CODE(DOMa)@en[[[uriAuthority]]]]]], [DFN[[CODE(DOMa)@en[[[uriUserinfo]]]]]], [DFN[[CODE(DOMa)@en[[[uriHost]]]]]], [DFN[[CODE(DOMa)@en[[[uriPort]]]]]], [DFN[[CODE(DOMa)@en[[[uriPath]]]]]], [DFN[[CODE(DOMa)@en[[[uriQuery]]]]]], and [DFN[[CODE(DOMa)@en[[[uriFragment]]]]]] corresponding to scheme, authority, userinfo, hostname, port, path, query, and fragment components respectively. On getting, these attributes [['''MUST''']] return the corresponding component of the [[url]] of the context object, not including delimiters before or after the component, if any, or [[null]] otherwise. On setting, these attributes [['''MUST''']] replace the corresponding component by the new value, if the new value is syntactically sound value as that component, or do nothing, otherwise. @@ Need more precious definition. [112] The [DFN[[CODE(DOMm)@en[[[getURIPathSegment]]]]]] method of the [CODE(DOMi)@en[[[URIReference]]]] object [['''MUST''']] return the path segment of the [[url]] of the [[context object]] with the index specified as the argument. The path segments of the URL is the components of the path separated by a [CODE(char)[[[/]]]] character. If the path segment with the specified index is not found, [[null]] [['''MUST''']] be returned instead. [113] The [DFN[[CODE(DOMm)@en[[[setURIPathSegment]]]]]] method of the [CODE(DOMi)@en[[[URIReference]]]] object [['''MUST''']] set the path segment of the [[url]] of the [[context object]] with the index specified by the first argument [['''MUST''']] be replaced or added by the value specified as the second argument. If the index is greater than the number of path segments, the path segments with indexes greater than or equal to the number of the path segments and less than the specified index [['''MUST''']] be set to the empty string. @@ [114] Define methods; In DOM Perl Binding, string arguments can be scalar references. [115] In [[DOM Perl Binding]], the [DFN[[CODE(DOMm)@en[[[clone]]]]]] [[method]] [['''MUST''']] act as if the [CODE(DOMm)@en[[[cloneURIReference]]]] [[method]] has been invoked. [116] In [[DOM Perl Binding]], the [CODE(perl)[[[eq]]]] operator on the [CODE(DOMi)@en[[[URIReference]]]] object [['''MUST''']] compare the [[url]] of the [[context object]] with the other value. * New configuration parameters ** Loose document children [14] The [DFN@en[configuration parameter [CODE(URI)@en[[[http://suika.fam.cx/www/2006/dom-config/strict-document-children]]]]]] can be used to force the implementation to obey DOM Level 3 Core rule for children of [CODE(DOMi)@en[[[Document]]]] nodes. ;; Note that this configuration parameter does affect operations only ''after'' it is set. Changing the configuration parameter value itself does not mutate the underlying document tree even if the tree violate the rule applied under the new value. @@ The definition is incomplete. [24] If the parameter is set to [CODE(IDL)@en[[[false]]]], the getter of the [CODE(DOMa)@en[[[textContent]]]] attribute of a [CODE(DOMi)@en[[[Document]]]] object [['''MUST''']] behave as if it were a [CODE(DOMi)@en[[[DocumentFragment]]]] object, except that the concatenation process [['''MUST''']] ignore any [CODE(DOMi)@en[[[DocumentType]]]] object. If the parameter is set to [CODE(IDL)@en[[[false]]]], the setter of the [CODE(DOMa)@en[[[textContent]]]] attribute of a [CODE(DOMi)@en[[[Document]]]] object [['''MUST''']] behave as if it were a [CODE(DOMi)@en[[[DocumentFragment]]]] object. * DOM3 bug fixes [71] The [DFN[[CODE(DOMm)@en[[[createAttribute]]]]]] method of the [CODE(DOMi)@en[[[Document]]]] interface [['''MUST''']] run the following steps: [FIG[ = Let [VAR@en[localName]] be the argument. = If [VAR@en[localName]] does not match the XML [CODE[[[Name]]]] production, throw an "[CODE[[[InvalidCharacterError]]]]" exception and terminate these steps. = Return a new [[attribute]] with namespace set to [[null]], local name set to [VAR[localName]], [[node document]] set to the [[context object]], [[owner element]] set to null, and [[value]] set to the empty string. ]FIG] [72] The [DFN[[CODE(DOMm)@en[[[createAttributeNS]]]]]] method of the [CODE(DOMi)@en[[[Document]]]] interface [['''MUST''']] act as if the [CODE(DOMm)@en[[[createElementNS]]]] method was invoked, except that a new [[attribute]], instead of a new [[element]], [['''MUST''']] be created. The [[value]] of the newly created [[attribute]] [['''MUST''']] be the empty string. [73] Methods [DFN[[CODE(DOMm)@en[[[createEntityReference]]]]]] and [DFN[[CODE(DOMm)@en[[[createCDATASection]]]]]] of the [CODE(DOMi)@en[[[Document]]]] interface [['''MUST''']] [[throw]] a "[CODE[[[NotSupportedError]]]]" [[exception]]. [74] If the [CODE(DOMm)@en[[[getAttributeNode]]]] method of the [CODE(DOMi)@en[[[Element]]]] interface founds multiple attributes, it [['''MUST''']] return the first attribute. If the document is an [[HTML document]] and the [[context object]] is in the [[HTML namespace]], the argument to the method [['''MUST''']] be [[converted to ASCII lowercase]] first. [75] The [DFN[[CODE(DOMm)@en[[[setAttributeNode]]]]]] method and the [DFN[[CODE(DOMm)@en[[[setAttributeNodeNS]]]]]] method of the [CODE(DOMi)@en[[[Element]]]] interface [['''MUST''']] run these steps: [FIG[ = Let [VAR@en[newAttr]] be the argument. = If the [[owner element]] of [VAR@en[newAttr]] is not [[null]] and is different from the [[context object]], [[throw]] an "[CODE(DOMe)@en[[[InUseAttributeError]]]]" [[exception]] and abort these steps. = [[Adopt]] [VAR@en[newAttr]]. = If the [[context object]] has the [[attribute]] whose [[namespace]] and [[local name]] are equal to those of [VAR@en[newAttr]], let [VAR@en[oldAttr]] be the attribute and set the [[owner element]] of [VAR@en[oldAttr]] to [[null]]. Otherwise, let [VAR@en[oldAttr]] be [[null]]. = If [VAR[oldAttr]] is [[null]], append [VAR@en[newAttr]] to the [[attributes]] of the [[context object]]. = Otherwise, if [VAR[oldAttr]] is not [[null]], replace [VAR@en[oldAttr]] in the [[attributes]] of the [[context object]] by [VAR@en[newAttr]]. = Set the [[owner element]] of [VAR@en[newAttr]] to the [[context object]]. = Return [VAR@en[oldAttr]]. @@ MutationEvent integration is necessary... ]FIG] [88] The [CODE(DOMm)@en[[[setNamedItem]]]] method and the [CODE(DOMm)@en[[[setNamedItemNS]]]] method of the [CODE(DOMi)@en[[[NamedNodeMap]]]] interface [['''MUST''']] act in the consistent way with these methods. [79] The [DFN[[CODE(DOMm)@en[[[isSameNode]]]] method]] of the [CODE(DOMi)@en[[[Node]]]] interface [['''MUST''']] return [[false]] if the argument is [[null]]. [FIG[ [PRE(IDL code)[ [[partial]] [[interface]] [[Node]] { [[boolean]] [[isSameNode]] ([[Node]]? other); }; ]PRE] ]FIG] * Implementation-specific requirements [69] Steps [[list of elements with local name [VAR[localName]]]], [[list of elements with namespace namespace and local name [VAR[localName]]]], and [[list of elements with class names [VAR[classNames]]]] [['''MUST''']] always return the same [CODE(DOMi)@en[[[HTMLCollection]]]] object as returned by the earlier calls with the same [[context object]] and argument. ;; [70] In [[DOM Standard]] this is optional. [91] The [[document]] has the [DFN[[[strict error checking]]]] flag. By default, the flag is set. The [CODE(DOMa)@en[[[strictErrorChecking]]]] of the [CODE(DOMi)@en[[[Document]]]] interface [SRC[DOM3CORE]], on getting, [['''MUST''']] return whether the [[strict error checking]] flag of the [[document]] is set or not. On setting, the attribute [['''MUST''']] set the flag if the true value is assigned, or unset otherwise. * New language binding (informative) [29] [[manakai]] is a set of [[Perl]] modules and it defines its own binding of [[DOM]]. For more information, see [[DOM Perl Binding]] [MDPB]. * References ** Normative References :[DOM3Core]: [CITE@en[Document Object Model (DOM) Level 3 Core Specification Version 1.0]], [[W3C]] Recommendation, 7 April 2004, . The latest version of DOM Level 3 Core is avalable at . (This version of the specification is referenced.) :[HTML5]: [CITE@en[HTML 5]], [[WHATWG]] Working Draft, work in progress, . :[RFC 2119]: [CITE@en[Key words for use in RFCs to Indicate Requirement Levels]], [[IETF]], [[RFC 2119]], [[BCP 14]], March 2004, . (This version of the specification is referenced.) :[Infoset]: [CITE@en[XML Information Set (Second Edition)]], [[W3C]] Recommendation, 4 February 2004, . The latest version of XML Information Set is available at . (Latest version of the specifcation whose maturity level is higher than Candidate Recommendation is referenced.) :[SelectorsAPI]: [CITE@en[Selectors API]], [[W3C]] Editor's Draft, 29 August 2007, . The latest published version of Selectors API is available at . (Latest version of the specifcation whose maturity level is higher than Candidate Recommendation, if any, or latest Editor's Draft is referenced.) ** Informative References :[DOM2Traversal]: [CITE@en[Document Object Model (DOM) Level 2 Traversal and Range Specification Version 1.0]], [[W3C]] Recommendation, 13 November 2000, . The latest version of DOM Level 2 Traversal and Range is available at . :[EBFD]: @@ ECMAScript binding for DOM, [[W3C]] Editor's Draft. :[MDPB]: [CITE@en[manakai's DOM Perl binding]], work in progress, [[DOM Perl Binding]]. * memo (informative) [53] @@ - If they are s and at least one of them has the feature, their s are equal, i.e. they both has the feature and their are equal (as defined for except that they cannot be ), or the of the node that has the feature is empty (i.e. its is zero). - If they are s, their s are equal (as defined for except that they cannot be ). - If they are s, the numeric attributes and are equal. - If they are s, the s are equal, i.e. they have the same and for each string that exists in one list there is a string that exists in the other list and is equal, although not necessarily at the same index. In addition, the number of the items that are equal to a string in one list is equal to the number of such items in the other list.