[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 not to throw exceptions 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[[[DocumentTypeDeclaration]]]] (Work in progress) - [CODE(DOMi)@en[[[SerialWalker]]]] * Extensions to existing interfaces - Interfaces implemented by [CODE(DOMi)@en[[[Document]]]] objects * Extensions to the [CODE(DOMi)@en[Node]] interface [31] The description for the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] and [CODE(DOMi)@en[[[AttributeDefinition]]]] interfaces includes the interaction of existing attributes and methods of [CODE(DOMi)@en[[[Node]]]] interface and these new node types. ** New node types [23] Two constants are added to the definition group [CODE(DOM)@en[[[NodeType]]]]: - [10] The constant [CODE(DOMc)@en[[[ELEMENT_TYPE_DEFINITION_NODE]]]], [CODE(IDL)[[[81001]]]] in [CODE(IDL)@en[[[unsigned short]]]], represents that the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[ElementTypeDefinition]]]]. - [11] The constant [CODE(DOMc)@en[[[ATTRIBUTE_DEFINITION_NODE]]]], [CODE(IDL)[[[81002]]]] in [CODE(IDL)@en[[[unsigned short]]]], represents that the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[AttributeDefinition]]]]. ** New element type accessors [9] The [DFN@en[[CODE(DOMa)@en[[[manakaiLocalName]]]] attribute]] contains the [Q@en[real]] local name of the [CODE(DOMi)@en[[[Node]]]]. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-only. The getter of this attribute [['''MUST''']] return the same value as the [CODE(DOMa)@en[[[localName]]]] on the same [CODE(DOMi)@en[[[Node]]]], except when the [CODE(DOMa)@en[[[localName]]]] getter is so defined that it must return the canonicalized version of [Q@en[real]] local name, in that case the [Q@en[real]] local name [['''MUST''']] be returned. ;; For example, the [[HTML 5]] specification defines that the [CODE(DOMa)@en[[[localName]]]] getter of the [CODE(DOMi)@en[[[HTMLElement]]]] in an HTML document will return uppercased local name of the [CODE(DOMi)@en[[[Element]]]]. The [CODE(DOMa)@en[[[manakaiLocalName]]]] getter return the local name without any case folding even on such [CODE(DOMi)@en[[[Element]]]]. [5] The [DFN@en[[CODE(DOMa)@en[[[manakaiExpandedURI]]]] attribute]] contans the expanded URI, i.e. the concatenation of the namespace URI and the local name of the [CODE(DOMi)@en[[[Node]]]]. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-only. = If the [CODE(DOMa)@en[[[manakaiLocalName]]]] of the [CODE(DOMi)@en[[[Node]]]] is [CODE(IDL)@en[[[null]]]], then the getter [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. = Otherwise, if the [CODE(DOMa)@en[[[namespaceURI]]]] of the [CODE(DOMi)@en[[[Node]]]] is [CODE(IDL)@en[[[null]]]], then the getter [['''MUST''']] return the [CODE(DOMa)@en[[[manakaiLocalName]]]] of the [CODE(DOMi)@en[[[Node]]]]. = Otherwise, the getter [['''MUST''']] return the concatenation of the [CODE(DOMa)@en[[[namespaceURI]]]] and then [CODE(DOMa)@en[[[manakaiLocalName]]]]. ** New tree accessor and mutator [4] The [DFN@en[[CODE(DOMa)@en[[[manakaiParentElement]]]] attribute]] contains the parent element of the [CODE(DOMi)@en[[[Node]]]], if any. The type of this attribute is [CODE(DOMi)@en[[[Element]]]]. This attribute is read-only. = If the [CODE(DOMa)@en[[[parentNode]]]] of the [CODE(DOMi)@en[[[Node]]]] is [CODE(IDL)@en[[[null]]]], then the getter [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. = Otherwise, if the [CODE(DOMa)@en[[[parentNode]]]] of the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[Element]]]], then the getter [['''MUST''']] return that [CODE(DOMi)@en[[[Element]]]]. = Otherwise, the getter [['''MUST''']] return the [CODE(DOMa)@en[[[manakaiParentElement]]]] of the [CODE(DOMa)@en[[[parentNode]]]] of the [CODE(DOMi)@en[[[Node]]]]. It might be [CODE(IDL)@en[[[null]]]]. @@ ISSUE: Should the owner element be returned for an [CODE(DOMi)@en[[[Attr]]]]? [3] The [DFN@en[[CODE(DOMm)@en[[[manakaiAppendText]]]] method]] appends a string at the end of the [CODE(DOMi)@en[[[Node]]]]. This method has a parameter, [CODE(DOMp)@en[[[s]]]]. [CODE(DOMp)@en[[[s]]]] is a string that is to be appended. Its type is [CODE(DOMi)@en[[[DOMString]]]]. This method [['''MUST''']] return the [CODE(DOMi)@en[[[Node]]]] itself. ;; It is the original intention that for the DOM Perl binding the [CODE(perl)[[[.=]]]] operator is to be overloaded by this method. However, since overloading that operator by this method makes the [[Perl]] implementation (at least Perl 5.8.1 and 5.8.7 on GNU/Linux system) unstable, that feature is temporarily disabled. @@ Old version of manakai returns the $self, maybe for overloading .= operator. If the [CODE(DOMi)@en[[[Node]]]] is either [CODE(DOMi)@en[[[DocumentFragment]]]], [CODE(DOMi)@en[[[EntityReference]]]], [CODE(DOMi)@en[[[Element]]]], [CODE(DOMi)@en[[[Attr]]]], [CODE(DOMi)@en[[[Entity]]]], or [CODE(DOMi)@en[[[AttributeDefinition]]]], then the string is appended to the end of the text content of the [CODE(DOMi)@en[[[Node]]]]. Formally: - If the [CODE(DOMp)@en[[[s]]]] is empty (zero-length), then the method [['''MUST''']] do nothing. - Otherwise, if the [CODE(DOMa)@en[[[lastChild]]]] is a [CODE(DOMi)@en[[[Text]]]] (not [CODE(DOMi)@en[[[CDATASection]]]]), then the method [['''MUST''']] append the [CODE(DOMp)@en[[[p]]]] to the [CODE(DOMa)@en[[[data]]]] attribute of the [CODE(DOMi)@en[[[Text]]]]. If the [CODE(DOMi)@en[[[Text]]]] is read-only, then the method [['''MUST''']] throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception without any mutation. - Otherwise, a new [CODE(DOMi)@en[[[Text]]]] (not [CODE(DOMi)@en[[[CDATASection]]]]) whose [CODE(DOMa)@en[[[data]]]] is set to [CODE(DOMp)@en[[[s]]]] [['''MUST''']] be appended to the [CODE(DOMi)@en[[[Node]]]]. If the [CODE(DOMi)@en[[[Node]]]] is read-only, then the method [['''MUST''']] throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception without any mutation. If the [CODE(DOMi)@en[[[Node]]]] is a [CODE(DOMi)@en[[[Document]]]]: When the [CODE(URI)@en[[[http://suika.fam.cx/www/2006/dom-config/strict-document-children]]]] configuration parameter is set to [CODE(IDL)@en[[[false]]]], then the method [['''MUST''']] act as if the [CODE(DOMi)@en[[[Node]]]] is a [CODE(DOMi)@en[[[DocumentFragment]]]]. Otherwise, the method [['''MUST''']] do nothing. If the [CODE(DOMi)@en[[[Node]]]] is either [CODE(DOMi)@en[[[ProcessingInstruction]]]], [CODE(DOMi)@en[[[Comment]]]], [CODE(DOMi)@en[[[Text]]]], or [CODE(DOMi)@en[[[CDATASection]]]], then [CODE(DOMp)@en[[[s]]]] [['''MUST''']] be appended to the [CODE(DOMa)@en[[[textContent]]]] of the [CODE(DOMi)@en[[[Node]]]]. If the [CODE(DOMi)@en[[[Node]]]] is read-only, then the method [['''MUST''']] throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception without any mutation. For the other types of [CODE(DOMi)@en[[[Node]]]]s, this method [['''MUST NOT''']] has any effect. @@ TODO: How mutation events are dispatched must be defined. ** Read-only flag accessors [1] The [DFN@en[[CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute]] represents whether the [CODE(DOMi)@en[[[Node]]]] is read-only or not. This is a [CODE(IDL)@en[[[boolean]]]] attribute. This attribute is [[read-only]]. The getter [['''MUST''']] return [CODE(IDL)@en[[[true]]]] if the [CODE(DOMi)@en[[[Node]]]] is read-only. Otherwise, it [['''MUST''']] return [CODE(IDL)@en[[[false]]]]. [2] The [DFN@en[[CODE(DOMm)@en[[[manakaiSetReadOnly]]]] method]] is used to set the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute. This method has two parameters: [CODE(DOMp)@en[[[newValue]]]] and [CODE(DOMp)@en[[[deep]]]]. This method returns nothing. [CODE(DOMp)@en[[[newValue]]]], type [CODE(IDL)@en[[[boolean]]]], represents the new value of the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute. [CODE(DOMp)@en[[[deep]]]], type [CODE(IDL)@en[[[boolean]]]]. represents whether the descendants' [CODE(DOMa)@en[[[manakaiReadOnly]]]] attributes should also be set or not. When invoked, the method [['''MUST''']] set the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute, i.e. the read-only flag, of the [CODE(DOMi)@en[[[Node]]]] to [CODE(DOMp)@en[[[newValue]]]]. If the [CODE(DOMp)@en[[[deep]]]] parameter is set to [CODE(IDL)@en[[[true]]]], then the method [['''MUST''']] act as if the method is also invoked to any of the following [CODE(DOMi)@en[[[Node]]]]s with same [CODE(DOMp)@en[[[newValue]]]] and [CODE(DOMp)@en[[[deep]]]] parameters: - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[childNodes]]]] of the [CODE(DOMi)@en[[[Node]]]] - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[attributes]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is an [CODE(DOMi)@en[[[Element]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[elementTypes]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[generalEntities]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[notations]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[attributeDefinitions]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[ElementTypeDefinition]]]]) ** Metadata accessor [6] The [DFN@en[[CODE(DOMa)@en[[[manakaiLanguage]]]] attribute]] contans the language information of the [CODE(DOMi)@en[[[Node]]]], if available. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-write. This getter [['''MUST''']] act as if the following algorithm is performed: = If the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[Element]]]]: == If there is an [CODE(DOMi)@en[[[Attr]]]], in the [CODE(DOMa)@en[[[attributes]]]] list of the [CODE(DOMi)@en[[[Element]]]], whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[lang]]]], then the getter returns the [CODE(DOMa)@en[[[value]]]] of the [CODE(DOMi)@en[[[Attr]]]]. == Otherwise, if there is an [CODE(DOMi)@en[[[Attr]]]], in the [CODE(DOMa)@en[[[attributes]]]] list of the [CODE(DOMi)@en[[[Element]]]], whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(IDL)@en[[[null]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[xml]]:[[lang]]]], then the getter returns the [CODE(DOMa)@en[[[value]]]] of the [CODE(DOMi)@en[[[Attr]]]]. = If the [CODE(DOMi)@en[[[Node]]]] has a non-[CODE(IDL)@en[[[null]]]] [CODE(DOMi)@en[[[parentNode]]]], then the getter returns the [CODE(DOMa)@en[[[manakaiLanguage]]]] of that [CODE(DOMi)@en[[[Node]]]]. = Otherwise, if the [CODE(DOMi)@en[[[Node]]]] has a non-[CODE(IDL)@en[[[null]]]] [CODE(DOMa)@en[[[ownerDocument]]]], then the getter returns the [CODE(DOMa)@en[[[manakaiLanguage]]]] of that [CODE(DOMi)@en[[[Node]]]]. = Otherwise, if the [CODE(DOMi)@en[[[Node]]]] is a [CODE(DOMi)@en[[[Document]]]] and any natural language information is attached to the [CODE(DOMi)@en[[[Document]]]], for example by [CODE(HTTP)@en[[[Content-Language]]]] [[HTTP]] header field, then the getter returns it. -- If such information has different syntax and / or semantics than one for the [CODE(XMLa)@en[[[xml]]:[[lang]]]] attributes as defined in XML 1.0 and 1.1 specifications, then the getter [['''MUST''']] return an XML-compatible string that is considered as equivalent to that information. -- If such convertion if not possible, then the getter [['''MUST NOT''']] return any string in this step. -- If more than one languages are specified, then the string [CODE(lang)@en[[[mul]]]] [['''MAY''']] be used. = Otherwise, the getter returns [CODE(IDL)@en[[[null]]]]. @@ TODO: Maybe we should clarify what convertion must be done for [CODE(DOMi)@en[[[Document]]]]s. @@ TODO: [[HTML]] [CODE(HTMLa)@en[[[lang]]]] support The setter [['''MUST''']] act as if the following algorithm is performed: = Let [VAR@en[s]] as the new value given to the attribute. = If the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[Element]]]]: == If the [CODE(DOMi)@en[[[Node]]]] has one or two [CODE(DOMi)@en[[[Attr]]]]s whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[lang]]]] or whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE@en[[[null]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[xml]]:[[lang]]]], then: === If the [CODE(DOMi)@en[[[Element]]]] is read-only, then throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exceoption and abort the algorithm. === Otherwise, any such [CODE(DOMi)@en[[[Attr]]]] [['''MUST''']] be removed from the [CODE(DOMi)@en[[[Element]]]] as if [CODE(DOMm)@en[[[removeAttributeNode]]]] is invoked with appropriate parameter. ---- Note that a default attribute might appear after the remove operation. == Otherwise, if the element has an [CODE(DOMi)@en[[[Attr]]]] whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[lang]]]]: === If the [CODE(DOMi)@en[[[Attr]]]] is read-only, then throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exceoption and abort the algorithm. === Otherwise, set its [CODE(DOMa)@en[[[value]]]] to [VAR@en[s]] and set its [CODE(DOMa)@en[[[specified]]]] to [CODE(IDL)@en[[[true]]]]. == Otherwise, if the element has an [CODE(DOMi)@en[[[Attr]]]] whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(IDL)@en[[[null]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[xml]]:[[lang]]]]: === If the [CODE(DOMi)@en[[[Attr]]]] is read-only, then throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exceoption and abort the algorithm. === Otherwise, set its [CODE(DOMa)@en[[[value]]]] to [VAR@en[s]] and set its [CODE(DOMa)@en[[[specified]]]] to [CODE(IDL)@en[[[true]]]]. == Otherwise, invoke the [CODE(DOMm)@en[[[setAttributeNS]]]] method on the [CODE(DOMi)@en[[[Element]]]] with parameters [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]], [CODE(XMLa)@en[[[xml]]:[[lang]]]], and [VAR@en[s]]. --- Note that this might cause an exception is thrown. = Otherwise, setter do nothing. @@ TODO: Setter for [CODE(DOMi)@en[[[Document]]]]. @@ TODO: mutation event consideration * Extension to the [CODE(DOMi)@en[Element]] interface ** Element type accessor [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. * 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 ** Setter extension [19] The [DFN@en[[CODE(DOMa)@en[[[specified]]]] 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 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. ;; 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. [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. ** 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 [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 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. This attribute is read-write. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. 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. This attribute is read-write. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. 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. * 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. * 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. * 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.) ** 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. ([[名無しさん]])